// Mock data for the Hitcents ERP — software-company flavored
// All employees, deals, projects, tickets, etc.

const ROLES = ['Admin', 'Manager', 'Employee', 'Sales', 'Support', 'Finance'];

const DEPTS = [
  { id: 'eng', name: 'Engineering', color: '#3E73C7' },
  { id: 'des', name: 'Design', color: '#A24FB8' },
  { id: 'prd', name: 'Product', color: '#E0552B' },
  { id: 'mkt', name: 'Marketing', color: '#D18A1F' },
  { id: 'sal', name: 'Sales', color: '#2F8B5A' },
  { id: 'sup', name: 'Support', color: '#0E8A95' },
  { id: 'hr',  name: 'People Ops', color: '#C2452C' },
  { id: 'fin', name: 'Finance', color: '#5C6470' },
];

// avatar generator: deterministic warm-tinted initials
function avatarFor(name, seed) {
  const hue = (seed * 47) % 360;
  return { initials: name.split(' ').map(s => s[0]).slice(0,2).join(''), hue };
}

const EMPLOYEES = [
  // CEO
  { id: 'e1', name: 'Maren Whitlock', title: 'Chief Executive Officer', dept: 'prd', mgr: null, email: 'maren@hitcents.com', phone: '+1 270 555 0101', loc: 'Bowling Green, KY', start: '2008-03-04', role: 'Admin', status: 'Active', skills: ['Strategy','Product','Leadership'], tenure: 17 },
  // C-suite & VPs report to CEO
  { id: 'e2', name: 'Davis Carrington', title: 'VP, Engineering', dept: 'eng', mgr: 'e1', email: 'davis@hitcents.com', phone: '+1 270 555 0102', loc: 'Bowling Green, KY', start: '2011-08-15', role: 'Manager', status: 'Active', skills: ['Architecture','Go','Postgres'], tenure: 14 },
  { id: 'e3', name: 'Priya Anand', title: 'VP, Product', dept: 'prd', mgr: 'e1', email: 'priya@hitcents.com', phone: '+1 270 555 0103', loc: 'Remote — Austin', start: '2014-01-12', role: 'Manager', status: 'Active', skills: ['Roadmapping','Discovery'], tenure: 11 },
  { id: 'e4', name: 'Theo Vance', title: 'Head of Sales', dept: 'sal', mgr: 'e1', email: 'theo@hitcents.com', phone: '+1 270 555 0104', loc: 'Nashville, TN', start: '2015-06-01', role: 'Sales', status: 'Active', skills: ['Enterprise','Pipeline'], tenure: 10 },
  { id: 'e5', name: 'Yuki Tanaka', title: 'Head of Marketing', dept: 'mkt', mgr: 'e1', email: 'yuki@hitcents.com', phone: '+1 270 555 0105', loc: 'Remote — Seattle', start: '2017-04-10', role: 'Manager', status: 'Active', skills: ['Brand','Demand Gen'], tenure: 8 },
  { id: 'e6', name: 'Marisol Reyes', title: 'Head of People', dept: 'hr',  mgr: 'e1', email: 'marisol@hitcents.com', phone: '+1 270 555 0106', loc: 'Bowling Green, KY', start: '2016-09-20', role: 'Admin', status: 'Active', skills: ['Hiring','Culture'], tenure: 9 },
  { id: 'e7', name: 'Owen Brackett', title: 'Director, IT Services', dept: 'sup', mgr: 'e1', email: 'owen@hitcents.com', phone: '+1 270 555 0107', loc: 'Bowling Green, KY', start: '2013-11-03', role: 'Support', status: 'Active', skills: ['SLA','Linux'], tenure: 12 },
  { id: 'e8', name: 'Helena Borg', title: 'Director of Design', dept: 'des', mgr: 'e1', email: 'helena@hitcents.com', phone: '+1 270 555 0108', loc: 'Remote — Stockholm', start: '2018-02-14', role: 'Manager', status: 'Active', skills: ['Systems','Brand'], tenure: 7 },
  { id: 'e9', name: 'Ramon Khoury', title: 'Controller', dept: 'fin', mgr: 'e1', email: 'ramon@hitcents.com', phone: '+1 270 555 0109', loc: 'Bowling Green, KY', start: '2019-07-22', role: 'Finance', status: 'Active', skills: ['GAAP','FP&A'], tenure: 6 },
  // Engineering team under Davis
  { id: 'e10', name: 'Imani Ostrander', title: 'Staff Engineer', dept: 'eng', mgr: 'e2', email: 'imani@hitcents.com', phone: '+1 270 555 0110', loc: 'Remote — Atlanta', start: '2016-01-09', role: 'Employee', status: 'Active', skills: ['Distributed','Rust'], tenure: 9 },
  { id: 'e11', name: 'Sahil Bhandari', title: 'Senior Frontend Engineer', dept: 'eng', mgr: 'e2', email: 'sahil@hitcents.com', phone: '+1 270 555 0111', loc: 'Remote — Toronto', start: '2019-10-01', role: 'Employee', status: 'Active', skills: ['React','TS'], tenure: 6 },
  { id: 'e12', name: 'Jules Marchetti', title: 'Backend Engineer', dept: 'eng', mgr: 'e2', email: 'jules@hitcents.com', phone: '+1 270 555 0112', loc: 'Bowling Green, KY', start: '2021-05-17', role: 'Employee', status: 'Active', skills: ['Go','Kafka'], tenure: 4 },
  { id: 'e13', name: 'Casey Rourke', title: 'Mobile Engineer', dept: 'eng', mgr: 'e2', email: 'casey@hitcents.com', phone: '+1 270 555 0113', loc: 'Remote — Portland', start: '2022-08-08', role: 'Employee', status: 'Active', skills: ['iOS','Swift'], tenure: 3 },
  { id: 'e14', name: 'Nadia Ferreira', title: 'DevOps Engineer', dept: 'eng', mgr: 'e2', email: 'nadia@hitcents.com', phone: '+1 270 555 0114', loc: 'Remote — Lisbon', start: '2020-03-30', role: 'Employee', status: 'Active', skills: ['K8s','Terraform'], tenure: 5 },
  { id: 'e15', name: 'Brennan Foley', title: 'QA Lead', dept: 'eng', mgr: 'e2', email: 'brennan@hitcents.com', phone: '+1 270 555 0115', loc: 'Bowling Green, KY', start: '2018-06-04', role: 'Employee', status: 'Active', skills: ['Cypress','Test plans'], tenure: 7 },
  // Product team under Priya
  { id: 'e16', name: 'Allegra Suh', title: 'Senior Product Manager', dept: 'prd', mgr: 'e3', email: 'allegra@hitcents.com', phone: '+1 270 555 0116', loc: 'Remote — Brooklyn', start: '2020-01-20', role: 'Employee', status: 'Active', skills: ['Discovery','Analytics'], tenure: 5 },
  { id: 'e17', name: 'Tomas Riedl', title: 'Product Manager', dept: 'prd', mgr: 'e3', email: 'tomas@hitcents.com', phone: '+1 270 555 0117', loc: 'Remote — Berlin', start: '2022-02-11', role: 'Employee', status: 'Active', skills: ['Ops','PM'], tenure: 3 },
  // Design team under Helena
  { id: 'e18', name: 'Wren Aoki', title: 'Senior Product Designer', dept: 'des', mgr: 'e8', email: 'wren@hitcents.com', phone: '+1 270 555 0118', loc: 'Remote — Vancouver', start: '2021-04-19', role: 'Employee', status: 'Active', skills: ['Figma','Motion'], tenure: 4 },
  { id: 'e19', name: 'Lucia Morrow', title: 'Brand Designer', dept: 'des', mgr: 'e8', email: 'lucia@hitcents.com', phone: '+1 270 555 0119', loc: 'Remote — London', start: '2023-01-09', role: 'Employee', status: 'Active', skills: ['Type','Identity'], tenure: 2 },
  // Sales team under Theo
  { id: 'e20', name: 'Garrett Holm', title: 'Senior AE', dept: 'sal', mgr: 'e4', email: 'garrett@hitcents.com', phone: '+1 270 555 0120', loc: 'Nashville, TN', start: '2019-08-26', role: 'Sales', status: 'Active', skills: ['MEDDIC','Enterprise'], tenure: 6 },
  { id: 'e21', name: 'Aria Donnelly', title: 'Account Executive', dept: 'sal', mgr: 'e4', email: 'aria@hitcents.com', phone: '+1 270 555 0121', loc: 'Remote — Chicago', start: '2021-11-15', role: 'Sales', status: 'Active', skills: ['Mid-market'], tenure: 4 },
  { id: 'e22', name: 'Pratik Sundar', title: 'SDR', dept: 'sal', mgr: 'e4', email: 'pratik@hitcents.com', phone: '+1 270 555 0122', loc: 'Remote — Bengaluru', start: '2024-03-04', role: 'Sales', status: 'Active', skills: ['Outbound'], tenure: 1 },
  // Marketing under Yuki
  { id: 'e23', name: 'Solène Auger', title: 'Content Marketing Lead', dept: 'mkt', mgr: 'e5', email: 'solene@hitcents.com', phone: '+1 270 555 0123', loc: 'Remote — Montréal', start: '2020-10-13', role: 'Employee', status: 'Active', skills: ['SEO','Writing'], tenure: 5 },
  { id: 'e24', name: 'Bram De Vries', title: 'Growth Marketer', dept: 'mkt', mgr: 'e5', email: 'bram@hitcents.com', phone: '+1 270 555 0124', loc: 'Remote — Amsterdam', start: '2022-06-21', role: 'Employee', status: 'Active', skills: ['Paid','Lifecycle'], tenure: 3 },
  // Support under Owen
  { id: 'e25', name: 'Esi Mensah', title: 'Senior Support Engineer', dept: 'sup', mgr: 'e7', email: 'esi@hitcents.com', phone: '+1 270 555 0125', loc: 'Bowling Green, KY', start: '2019-02-04', role: 'Support', status: 'Active', skills: ['Tier 3','SQL'], tenure: 6 },
  { id: 'e26', name: 'Caleb Otieno', title: 'Support Engineer', dept: 'sup', mgr: 'e7', email: 'caleb@hitcents.com', phone: '+1 270 555 0126', loc: 'Remote — Nairobi', start: '2023-09-11', role: 'Support', status: 'Active', skills: ['Triage','Docs'], tenure: 2 },
  // HR under Marisol
  { id: 'e27', name: 'Beatriz Quirós', title: 'People Operations', dept: 'hr', mgr: 'e6', email: 'beatriz@hitcents.com', phone: '+1 270 555 0127', loc: 'Bowling Green, KY', start: '2022-04-08', role: 'Admin', status: 'Active', skills: ['Onboarding'], tenure: 3 },
  // Finance under Ramon
  { id: 'e28', name: 'Quentin Lavoie', title: 'Senior Accountant', dept: 'fin', mgr: 'e9', email: 'quentin@hitcents.com', phone: '+1 270 555 0128', loc: 'Remote — Halifax', start: '2021-07-19', role: 'Finance', status: 'Active', skills: ['Close','Audit'], tenure: 4 },
];

// Stamp avatars
EMPLOYEES.forEach((e, i) => { e.avatar = avatarFor(e.name, i + 1); });

const CUSTOMERS = [
  { id: 'c1', name: 'Stratoscale Robotics', industry: 'Robotics', size: '850', mrr: 28400, since: '2022-03-12', owner: 'e20', tier: 'Enterprise', health: 'Healthy', tags: ['expansion','reference'], website: 'stratoscale.io', hq: 'Boulder, CO' },
  { id: 'c2', name: 'Northbrook Manufacturing', industry: 'Manufacturing', size: '2400', mrr: 41200, since: '2020-08-04', owner: 'e20', tier: 'Enterprise', health: 'At risk', tags: ['renewal-Q3'], website: 'northbrook.co', hq: 'Detroit, MI' },
  { id: 'c3', name: 'Vellum Health', industry: 'Healthcare', size: '320', mrr: 12800, since: '2023-06-17', owner: 'e21', tier: 'Mid-market', health: 'Healthy', tags: [], website: 'vellum.health', hq: 'Boston, MA' },
  { id: 'c4', name: 'Marigold Studios', industry: 'Creative', size: '64', mrr: 4200, since: '2024-02-21', owner: 'e21', tier: 'SMB', health: 'Healthy', tags: ['advocate'], website: 'marigold.studio', hq: 'Brooklyn, NY' },
  { id: 'c5', name: 'Klein & Auer Logistics', industry: 'Logistics', size: '1100', mrr: 22600, since: '2021-11-30', owner: 'e20', tier: 'Enterprise', health: 'Healthy', tags: [], website: 'klein-auer.de', hq: 'Hamburg, DE' },
  { id: 'c6', name: 'Pinecrest Schools', industry: 'Education', size: '180', mrr: 3800, since: '2024-09-02', owner: 'e21', tier: 'SMB', health: 'New', tags: ['onboarding'], website: 'pinecrest.edu', hq: 'Asheville, NC' },
  { id: 'c7', name: 'Halcyon Biotech', industry: 'Biotech', size: '410', mrr: 17500, since: '2023-01-15', owner: 'e20', tier: 'Mid-market', health: 'Healthy', tags: ['expansion'], website: 'halcyonbio.com', hq: 'San Diego, CA' },
  { id: 'c8', name: 'Junction Bank', industry: 'Finance', size: '5200', mrr: 0, since: null, owner: 'e20', tier: 'Enterprise', health: 'Prospect', tags: ['compliance-review'], website: 'junctionbank.com', hq: 'New York, NY' },
];

// Contacts — each belongs to exactly one company (companyId → CUSTOMERS.id).
// A company can have many contacts. `primary` marks the main relationship owner.
const CONTACTS = [
  // Stratoscale Robotics (c1)
  { id: 'ct1',  name: 'Daria Whitmore', title: 'Chief Financial Officer', companyId: 'c1', email: 'daria@stratoscale.io', phone: '+1 303 555 0148', primary: true,  status: 'Active', role: 'Economic buyer' },
  { id: 'ct2',  name: 'Maya Lindqvist', title: 'VP Engineering',          companyId: 'c1', email: 'maya@stratoscale.io',  phone: '+1 303 555 0151', primary: false, status: 'Active', role: 'Champion' },
  { id: 'ct3',  name: 'Devin Castellano', title: 'IT Procurement Lead',   companyId: 'c1', email: 'devin@stratoscale.io', phone: '+1 303 555 0162', primary: false, status: 'Active', role: 'Procurement' },
  // Northbrook Manufacturing (c2)
  { id: 'ct4',  name: 'Roy Eberhart', title: 'Chief Information Officer',  companyId: 'c2', email: 'reberhart@northbrook.co', phone: '+1 313 555 0110', primary: true,  status: 'Active', role: 'Economic buyer' },
  { id: 'ct5',  name: 'Sandra Pell', title: 'Director of Operations',      companyId: 'c2', email: 'spell@northbrook.co',     phone: '+1 313 555 0124', primary: false, status: 'Active', role: 'Champion' },
  // Vellum Health (c3)
  { id: 'ct6',  name: 'Aviv Reuven', title: 'Chief Operating Officer',     companyId: 'c3', email: 'aviv@vellum.health',   phone: '+1 617 555 0133', primary: true,  status: 'Active', role: 'Economic buyer' },
  { id: 'ct7',  name: 'Priya Nair', title: 'Head of Clinical Systems',     companyId: 'c3', email: 'priya@vellum.health',  phone: '+1 617 555 0140', primary: false, status: 'Active', role: 'User' },
  // Marigold Studios (c4)
  { id: 'ct8',  name: 'Renée Hsieh', title: 'Founder & Creative Director', companyId: 'c4', email: 'renee@marigold.studio', phone: '+1 718 555 0177', primary: true,  status: 'Active', role: 'Decision maker' },
  // Klein & Auer Logistics (c5)
  { id: 'ct9',  name: 'Helmut Bauer', title: 'Geschäftsführer (MD)',       companyId: 'c5', email: 'h.bauer@klein-auer.de', phone: '+49 40 555 0190', primary: true,  status: 'Active', role: 'Economic buyer' },
  { id: 'ct10', name: 'Lena Vogt', title: 'Data Protection Officer',       companyId: 'c5', email: 'l.vogt@klein-auer.de',  phone: '+49 40 555 0198', primary: false, status: 'Active', role: 'Legal / compliance' },
  // Pinecrest Schools (c6)
  { id: 'ct11', name: 'Dr. Tanya Beecroft', title: 'Superintendent',       companyId: 'c6', email: 'tbeecroft@pinecrest.edu', phone: '+1 828 555 0102', primary: true, status: 'Active', role: 'Decision maker' },
  { id: 'ct12', name: 'Marcus Hale', title: 'IT Coordinator',              companyId: 'c6', email: 'mhale@pinecrest.edu',   phone: '+1 828 555 0119', primary: false, status: 'Active', role: 'Admin' },
  // Halcyon Biotech (c7)
  { id: 'ct13', name: 'Maya Forrest', title: 'Chief Marketing Officer',    companyId: 'c7', email: 'mforrest@halcyonbio.com', phone: '+1 858 555 0166', primary: true, status: 'Active', role: 'Economic buyer' },
  { id: 'ct14', name: 'Owen Brandt', title: 'Data Science Lead',           companyId: 'c7', email: 'obrandt@halcyonbio.com',  phone: '+1 858 555 0171', primary: false, status: 'Active', role: 'Champion' },
  // Junction Bank (c8)
  { id: 'ct15', name: 'Ines Holloway', title: 'Head of Procurement',       companyId: 'c8', email: 'i.holloway@junctionbank.com', phone: '+1 212 555 0145', primary: true,  status: 'Active', role: 'Procurement' },
  { id: 'ct16', name: 'Theo Marsh', title: 'VP Information Security',      companyId: 'c8', email: 't.marsh@junctionbank.com',   phone: '+1 212 555 0152', primary: false, status: 'Active', role: 'Technical evaluator' },
  { id: 'ct17', name: 'Carla Nguyen', title: 'Compliance Manager',         companyId: 'c8', email: 'c.nguyen@junctionbank.com', phone: '+1 212 555 0159', primary: false, status: 'Active', role: 'Legal / compliance' },
];
CONTACTS.forEach((c, i) => { c.avatar = avatarFor(c.name.replace(/^Dr\.\s/, ''), i + 40); });

const DEAL_STAGES = [
  { id: 'lead', name: 'Lead', color: '#7A6B62' },
  { id: 'qual', name: 'Qualified', color: '#3E73C7' },
  { id: 'prop', name: 'Proposal', color: '#A24FB8' },
  { id: 'negt', name: 'Negotiation', color: '#D18A1F' },
  { id: 'won',  name: 'Closed Won', color: '#2F8B5A' },
  { id: 'lost', name: 'Closed Lost', color: '#C2452C' },
];

const DEALS = [
  { id: 'd1', name: 'Stratoscale — Platform tier upgrade', customer: 'c1', value: 142000, stage: 'negt', owner: 'e20', close: '2026-06-30', probability: 70, source: 'Expansion', daas: 60000, seats: 120, seatPrice: 500, setup: 10000, mvp: 12000 },
  { id: 'd2', name: 'Northbrook — Renewal + Add-on', customer: 'c2', value: 384000, stage: 'prop', owner: 'e20', close: '2026-07-15', probability: 45, source: 'Renewal', daas: 200000, seats: 300, seatPrice: 500, setup: 14000, mvp: 20000 },
  { id: 'd3', name: 'Vellum Health — Seat expansion', customer: 'c3', value: 56000, stage: 'qual', owner: 'e21', close: '2026-06-22', probability: 55, source: 'Inbound', daas: 20000, seats: 60, seatPrice: 500, setup: 6000, mvp: 0 },
  { id: 'd4', name: 'Junction Bank — Pilot SOW', customer: 'c8', value: 220000, stage: 'qual', owner: 'e20', close: '2026-08-30', probability: 35, source: 'Outbound', daas: 120000, seats: 100, seatPrice: 700, setup: 30000, mvp: 0 },
  { id: 'd5', name: 'Halcyon Biotech — Analytics module', customer: 'c7', value: 78000, stage: 'prop', owner: 'e20', close: '2026-07-01', probability: 60, source: 'Expansion', daas: 40000, seats: 50, seatPrice: 500, setup: 8000, mvp: 5000 },
  { id: 'd6', name: 'Marigold Studios — Team plan', customer: 'c4', value: 14400, stage: 'won', owner: 'e21', close: '2026-05-04', probability: 100, source: 'Inbound', daas: 0, seats: 24, seatPrice: 450, setup: 1600, mvp: 2000 },
  { id: 'd7', name: 'Klein & Auer — EU data residency', customer: 'c5', value: 96000, stage: 'negt', owner: 'e20', close: '2026-06-12', probability: 75, source: 'Renewal', daas: 50000, seats: 60, seatPrice: 600, setup: 10000, mvp: 0 },
  { id: 'd8', name: 'Pinecrest Schools — District contract', customer: 'c6', value: 28000, stage: 'lead', owner: 'e21', close: '2026-09-01', probability: 20, source: 'Partner', daas: 0, seats: 40, seatPrice: 550, setup: 6000, mvp: 0 },
  { id: 'd9', name: 'Foxtail Robotics — POC', customer: null, customerName: 'Foxtail Robotics', value: 42000, stage: 'lead', owner: 'e22', close: '2026-09-20', probability: 15, source: 'Outbound', daas: 0, seats: 0, seatPrice: 0, setup: 12000, mvp: 30000 },
  { id: 'd10',name: 'Plenum Analytics — Mid-market', customer: null, customerName: 'Plenum Analytics', value: 64000, stage: 'qual', owner: 'e21', close: '2026-07-30', probability: 40, source: 'Inbound', daas: 30000, seats: 40, seatPrice: 600, setup: 10000, mvp: 0 },
  { id: 'd11',name: 'Cerulean Foods — Lost: budget', customer: null, customerName: 'Cerulean Foods', value: 36000, stage: 'lost', owner: 'e21', close: '2026-04-10', probability: 0, source: 'Inbound', daas: 10000, seats: 30, seatPrice: 500, setup: 6000, mvp: 5000 },
];
// Contract value is derived from the line items below.
function dealContractValue(d) {
  return (d.daas || 0) + (d.seats || 0) * (d.seatPrice || 0) + (d.setup || 0) + (d.mvp || 0);
}
DEALS.forEach(d => { d.value = dealContractValue(d); });

// Innovation board — ideas
const IDEA_COLS = [
  { id: 'parking', name: 'Parking lot' },
  { id: 'shaping', name: 'Shaping' },
  { id: 'next', name: 'Up next' },
  { id: 'building', name: 'Building' },
  { id: 'shipped', name: 'Shipped' },
];

const IDEAS = [
  { id: 'i1', title: 'AI ticket summarizer for IT Services', col: 'shaping', tier: 'A', owner: 'e7', tags: ['ai','support'], desc: 'Daily digest of open tickets + auto-tag severity.' },
  { id: 'i2', title: 'Pipeline-aware forecasting', col: 'parking', tier: 'C', owner: 'e4', tags: ['crm','ml'], desc: 'Use stage-conversion history to predict quarterly bookings.' },
  { id: 'i3', title: 'Affiliate referral leaderboard', col: 'next', tier: 'B', owner: 'e5', tags: ['affiliates','gamify'], desc: 'Monthly leaderboard + tiered bonuses for top performers.' },
  { id: 'i4', title: 'Customer health score', col: 'building', tier: 'S', owner: 'e3', tags: ['crm','retention'], desc: 'Composite of usage + tickets + NPS — drives renewal motion.' },
  { id: 'i5', title: 'Mobile time tracking', col: 'parking', tier: 'D', owner: 'e6', tags: ['hr'], desc: 'Mobile-first clock-in for contractors.' },
  { id: 'i6', title: 'Atlas plugin marketplace', col: 'shaping', tier: 'S', owner: 'e3', tags: ['platform','revenue'], desc: 'Open partner ecosystem with revenue share.' },
  { id: 'i7', title: 'Slack-native daily standup', col: 'shipped', tier: 'C', owner: 'e10', tags: ['internal'], desc: 'Async standup posted to project channels at 9am local.' },
  { id: 'i8', title: 'Idea voting Slack bot', col: 'shipped', tier: 'C', owner: 'e11', tags: ['internal'], desc: 'Vote on innovation board directly from Slack.' },
  { id: 'i9', title: 'CRM auto-enrichment via Clearbit', col: 'next', tier: 'B', owner: 'e4', tags: ['crm','automation'], desc: 'Auto-populate firmographics on new lead.' },
  { id: 'i10', title: 'Onboarding scorecard for new hires', col: 'shaping', tier: 'C', owner: 'e6', tags: ['hr'], desc: '30/60/90 day scorecard surfaced to manager.' },
  { id: 'i11', title: 'Calendar-aware time off requests', col: 'building', tier: 'B', owner: 'e6', tags: ['hr'], desc: 'Suggest least-impactful weeks for time off based on roadmap.' },
  { id: 'i12', title: 'Voice-of-customer digest', col: 'parking', tier: 'C', owner: 'e3', tags: ['research'], desc: 'Weekly auto-clustered themes from support + sales notes.' },
];

// File system
const FILES = [
  { id: 'f-root', name: 'Hitcents', parent: null, kind: 'folder' },

  { id: 'f-co', name: 'Company', parent: 'f-root', kind: 'folder', acl: 'All staff' },
  { id: 'f-co-1', name: 'Employee handbook 2026.pdf', parent: 'f-co', kind: 'pdf', size: 2400000, modified: '2026-01-12', owner: 'e6' },
  { id: 'f-co-2', name: 'Benefits — open enrollment 2026.pdf', parent: 'f-co', kind: 'pdf', size: 1100000, modified: '2026-02-04', owner: 'e6' },
  { id: 'f-co-3', name: 'All-hands deck — Q2 2026.pptx', parent: 'f-co', kind: 'pptx', size: 14200000, modified: '2026-04-22', owner: 'e1' },
  { id: 'f-co-4', name: 'Office wifi.txt', parent: 'f-co', kind: 'txt', size: 300, modified: '2026-03-01', owner: 'e7' },

  { id: 'f-eng', name: 'Engineering', parent: 'f-root', kind: 'folder', acl: 'Engineering' },
  { id: 'f-eng-1', name: 'Atlas architecture v4.fig', parent: 'f-eng', kind: 'fig', size: 4200000, modified: '2026-05-10', owner: 'e10' },
  { id: 'f-eng-2', name: 'Incident playbook.md', parent: 'f-eng', kind: 'md', size: 24000, modified: '2026-05-02', owner: 'e14' },
  { id: 'f-eng-3', name: 'On-call rotation Q2.xlsx', parent: 'f-eng', kind: 'xlsx', size: 86000, modified: '2026-04-30', owner: 'e14' },

  { id: 'f-sal', name: 'Sales', parent: 'f-root', kind: 'folder', acl: 'Sales, Finance' },
  { id: 'f-sal-1', name: 'Master Services Agreement — template.docx', parent: 'f-sal', kind: 'docx', size: 188000, modified: '2026-02-15', owner: 'e9' },
  { id: 'f-sal-2', name: 'Pricing matrix 2026.xlsx', parent: 'f-sal', kind: 'xlsx', size: 220000, modified: '2026-05-01', owner: 'e4' },
  { id: 'f-sal-3', name: 'Northbrook — renewal proposal.pdf', parent: 'f-sal', kind: 'pdf', size: 3400000, modified: '2026-05-12', owner: 'e20' },
  { id: 'f-sal-4', name: 'Stratoscale case study.pdf', parent: 'f-sal', kind: 'pdf', size: 2900000, modified: '2026-04-18', owner: 'e23' },

  { id: 'f-mkt', name: 'Marketing', parent: 'f-root', kind: 'folder', acl: 'Marketing' },
  { id: 'f-mkt-1', name: 'Brand guidelines 2026.pdf', parent: 'f-mkt', kind: 'pdf', size: 8400000, modified: '2026-03-22', owner: 'e8' },
  { id: 'f-mkt-2', name: 'Logo — primary.svg', parent: 'f-mkt', kind: 'svg', size: 14000, modified: '2026-03-04', owner: 'e19' },
  { id: 'f-mkt-3', name: 'Atlas v4 launch assets', parent: 'f-mkt', kind: 'folder', acl: 'Marketing' },

  { id: 'f-prd', name: 'Product', parent: 'f-root', kind: 'folder', acl: 'Product, Design' },
  { id: 'f-prd-1', name: 'Atlas v4 PRD.md', parent: 'f-prd', kind: 'md', size: 64000, modified: '2026-05-08', owner: 'e16' },
  { id: 'f-prd-2', name: 'Compass mobile spec.fig', parent: 'f-prd', kind: 'fig', size: 6200000, modified: '2026-05-11', owner: 'e18' },

  { id: 'f-fin', name: 'Finance', parent: 'f-root', kind: 'folder', acl: 'Finance, Admin' },
  { id: 'f-fin-1', name: '2025 board pack.pdf', parent: 'f-fin', kind: 'pdf', size: 12000000, modified: '2026-02-28', owner: 'e9' },
  { id: 'f-fin-2', name: 'Q1 close — 2026.xlsx', parent: 'f-fin', kind: 'xlsx', size: 480000, modified: '2026-04-15', owner: 'e28' },
];

// Activity feed
const ACTIVITY = [
  { id: 'ac1', who: 'e20', what: 'moved deal', obj: 'Stratoscale upgrade', detail: 'Negotiation → Closed Won? pending legal', when: '14 min ago', section: 'CRM' },
  { id: 'ac2', who: 'e9', what: 'marked invoice paid', obj: 'INV-2045 — Northbrook', detail: '$41,200 received', when: '32 min ago', section: 'Invoices' },
  { id: 'ac3', who: 'e9', what: 'recorded a bill', obj: 'BILL-7012 — AWS', detail: '$40,000 · due Jun 12', when: '1 hr ago', section: 'Bills' },
  { id: 'ac4', who: 'e20', what: 'added customer', obj: 'Halcyon Biotech', detail: 'Mid-market · San Diego', when: '2 hrs ago', section: 'Customers' },
  { id: 'ac5', who: 'e3', what: 'promoted idea', obj: 'Customer health score', detail: 'Up next → Building', when: '3 hrs ago', section: 'Innovation' },
  { id: 'ac6', who: 'e6', what: 'added employee', obj: 'Pratik Sundar', detail: 'started in Sales as SDR', when: 'yesterday', section: 'HRM' },
  { id: 'ac7', who: 'e9', what: 'reconciled account', obj: 'Operating Checking', detail: '3 transactions cleared', when: 'yesterday', section: 'Banking' },
  { id: 'ac8', who: 'e23', what: 'published file', obj: 'Stratoscale case study.pdf', detail: 'Sales / public collateral', when: '2 days ago', section: 'Files' },
];

// User accounts — each can link to AT MOST one employee (or none).
// Employees can also exist with no user account. Both sides can be orphaned.
const USERS = [
  { id: 'u1',  email: 'maren@hitcents.com',     employeeId: 'e1',  role: 'Admin',    status: 'Active',    lastActive: '4 min ago',  twofa: true },
  { id: 'u2',  email: 'davis@hitcents.com',     employeeId: 'e2',  role: 'Manager',  status: 'Active',    lastActive: '22 min ago', twofa: true },
  { id: 'u3',  email: 'marisol@hitcents.com',   employeeId: 'e6',  role: 'Admin',    status: 'Active',    lastActive: '1 h ago',    twofa: true },
  { id: 'u4',  email: 'ramon@hitcents.com',     employeeId: 'e9',  role: 'Finance',  status: 'Active',    lastActive: '3 h ago',    twofa: true },
  { id: 'u5',  email: 'garrett@hitcents.com',   employeeId: 'e20', role: 'Sales',    status: 'Active',    lastActive: '12 min ago', twofa: false },
  { id: 'u6',  email: 'imani@hitcents.com',     employeeId: 'e10', role: 'Employee', status: 'Active',    lastActive: '2 h ago',    twofa: true },
  { id: 'u7',  email: 'helena@hitcents.com',    employeeId: 'e8',  role: 'Manager',  status: 'Active',    lastActive: 'yesterday',  twofa: true },
  { id: 'u8',  email: 'esi@hitcents.com',       employeeId: 'e25', role: 'Support',  status: 'Active',    lastActive: '8 min ago',  twofa: true },
  // Orphaned users — no linked employee
  { id: 'u9',  email: 'audit-svc@hitcents.com', employeeId: null,  role: 'Support',  status: 'Active',    lastActive: '5 h ago',    twofa: true,  note: 'Service account' },
  { id: 'u10', email: 'j.tran@hitcents.com',    employeeId: null,  role: 'Employee', status: 'Invited',   lastActive: '—',          twofa: false, note: 'Invite pending' },
  { id: 'u11', email: 'former.lee@hitcents.com',employeeId: null,  role: 'Employee', status: 'Suspended', lastActive: '3 mo ago',   twofa: false, note: 'Offboarded' },
];

// Software license / subscription tracker (HR + IT asset register)
const LICENSE_UNITS = ['BusDev', 'Gaming', 'SaaS', 'DaaS', 'Studio', 'Marketing', 'IT', 'Finance', 'Operations'];

const LICENSES = [
  { id: 'lic1',  name: 'Amazon Web Services', owner: 'e14', purchase: '2024-02-01', monthly: 40000, card: 'Amex ··7012', loginUrl: 'https://console.aws.amazon.com', accountId: 'aws-481920', username: 'ops@hitcents.com', password: 'Hc!Aws2024$cloud', mfa: ['Authenticator app', 'Hardware key (YubiKey)'], purpose: 'Production cloud infrastructure & hosting', unit: 'SaaS' },
  { id: 'lic2',  name: 'GitHub Enterprise', owner: 'e2', purchase: '2023-06-15', monthly: 800, card: 'Amex ··7012', loginUrl: 'https://github.com/login', accountId: 'gh-hitcents', username: 'eng@hitcents.com', password: 'Gh#Repo2023!main', mfa: ['Authenticator app'], purpose: 'Source control & CI for all engineering', unit: 'SaaS' },
  { id: 'lic3',  name: 'Figma Organization', owner: 'e8', purchase: '2023-09-20', monthly: 540, card: 'Visa ··4421', loginUrl: 'https://figma.com/login', accountId: 'figma-org-2299', username: 'design@hitcents.com', password: 'Fig!Design88pen', mfa: ['SMS'], purpose: 'Product & brand design files', unit: 'Studio' },
  { id: 'lic4',  name: 'Unity Pro', owner: 'e13', purchase: '2024-01-10', monthly: 2040, card: 'Brex ··9930', loginUrl: 'https://id.unity.com', accountId: 'unity-seat-44', username: 'studio@hitcents.com', password: 'Un1ty#Game2024', mfa: ['Authenticator app'], purpose: 'Game engine — 12 dev seats', unit: 'Gaming' },
  { id: 'lic5',  name: 'Steamworks', owner: 'e3', purchase: '2022-11-03', monthly: 0, card: 'Brex ··9930', loginUrl: 'https://partner.steamgames.com', accountId: 'steam-partner-1182', username: 'publishing@hitcents.com', password: 'St3am$Publish22', mfa: ['Steam Guard (email)'], purpose: 'Game distribution & store pages', unit: 'Gaming' },
  { id: 'lic6',  name: 'Adobe Creative Cloud', owner: 'e19', purchase: '2023-04-12', monthly: 1200, card: 'Visa ··4421', loginUrl: 'https://account.adobe.com', accountId: 'adobe-team-7741', username: 'creative@hitcents.com', password: 'Adb!Creative33', mfa: ['Authenticator app'], purpose: 'Marketing & brand creative suite', unit: 'Marketing' },
  { id: 'lic7',  name: 'Datadog', owner: 'e14', purchase: '2024-04-20', monthly: 8000, card: 'Amex ··7012', loginUrl: 'https://app.datadoghq.com', accountId: 'dd-hitcents-prod', username: 'sre@hitcents.com', password: 'D0g#Monitor44', mfa: ['Authenticator app', 'SMS'], purpose: 'Observability & alerting', unit: 'SaaS' },
  { id: 'lic8',  name: 'Linear', owner: 'e2', purchase: '2024-06-01', monthly: 1200, card: 'Amex ··7012', loginUrl: 'https://linear.app/login', accountId: 'linear-hc', username: 'eng@hitcents.com', password: 'L1near!Plan26', mfa: ['Authenticator app'], purpose: 'Issue tracking & sprint planning', unit: 'SaaS' },
  { id: 'lic9',  name: 'Google Workspace', owner: 'e1', purchase: '2019-01-15', monthly: 4900, card: 'Amex ··7012', loginUrl: 'https://admin.google.com', accountId: 'gws-hitcents.com', username: 'admin@hitcents.com', password: 'Gw5#Admin!core', mfa: ['Hardware key (YubiKey)', 'Authenticator app'], purpose: 'Email, docs & calendar — all staff', unit: 'IT' },
  { id: 'lic10', name: 'HubSpot Marketing', owner: 'e5', purchase: '2023-08-08', monthly: 3200, card: 'Visa ··4421', loginUrl: 'https://app.hubspot.com/login', accountId: 'hub-2284119', username: 'marketing@hitcents.com', password: 'Hub$pot!Grow23', mfa: ['SMS'], purpose: 'Marketing automation & CRM sync', unit: 'BusDev' },
  { id: 'lic11', name: 'Stripe', owner: 'e9', purchase: '2020-03-22', monthly: 0, card: 'n/a (payout processor)', loginUrl: 'https://dashboard.stripe.com/login', accountId: 'acct_1Hc9920Xy', username: 'finance@hitcents.com', password: 'Str!pe#Pay2020', mfa: ['Hardware key (YubiKey)', 'SMS'], purpose: 'Billing, invoices & affiliate payouts', unit: 'Finance' },
  { id: 'lic12', name: '1Password Business', owner: 'e7', purchase: '2022-05-30', monthly: 224, card: 'Amex ··7012', loginUrl: 'https://hitcents.1password.com', accountId: '1p-hitcents', username: 'it@hitcents.com', password: 'OnePw!Vault22', mfa: ['Authenticator app', 'Hardware key (YubiKey)'], purpose: 'Company-wide password vault', unit: 'IT' },
  { id: 'lic13', name: 'Notion', owner: 'e16', purchase: '2023-02-14', monthly: 480, card: 'Brex ··9930', loginUrl: 'https://notion.so/login', accountId: 'notion-ws-hc', username: 'product@hitcents.com', password: 'N0tion#Docs23', mfa: ['SMS'], purpose: 'Internal wiki & PRDs', unit: 'SaaS' },
  { id: 'lic14', name: 'Vercel', owner: 'e11', purchase: '2024-03-05', monthly: 600, card: 'Amex ··7012', loginUrl: 'https://vercel.com/login', accountId: 'vercel-hc-team', username: 'web@hitcents.com', password: 'Vrcl!Deploy24', mfa: ['Authenticator app'], purpose: 'Marketing site & microsite hosting', unit: 'DaaS' },
  { id: 'lic15', name: 'Zoom Business', owner: 'e6', purchase: '2021-09-01', monthly: 750, card: 'Visa ··4421', loginUrl: 'https://zoom.us/signin', accountId: 'zoom-2299-biz', username: 'people@hitcents.com', password: 'Z00m!Meet21', mfa: ['SMS'], purpose: 'Video conferencing — all staff', unit: 'Operations' },
  { id: 'lic16', name: 'Salesforce (Sandbox)', owner: 'e4', purchase: '2024-05-18', monthly: 1500, card: 'Visa ··4421', loginUrl: 'https://login.salesforce.com', accountId: 'sf-hc-sbx-01', username: 'sales@hitcents.com', password: 'Sf!Sandbox24', mfa: ['Authenticator app'], purpose: 'CRM evaluation & data migration testing', unit: 'BusDev' },
];

// ─────────────────────────────────────────────────────────────────
// Vendors — companies we BUY from (software providers + service vendors).
// Each vendor groups the software licenses, contracts, and points of
// contact associated with it. `aliases` match license / contract names.
// ─────────────────────────────────────────────────────────────────
const VENDOR_CATEGORIES = ['Cloud & Infrastructure', 'Engineering Tools', 'Design', 'Game Development', 'Observability', 'Project Management', 'Productivity', 'Marketing', 'Creative', 'Security', 'Facilities', 'Compliance', 'Other'];

const VENDORS = [
  { id: 'v1',  name: 'Amazon Web Services', category: 'Cloud & Infrastructure', owner: 'e14', status: 'Active', since: '2024-02-01', website: 'aws.amazon.com',      hq: 'Seattle, WA',        annualSpend: 480000, terms: 'Net 30', licenses: ['lic1'],  aliases: ['Amazon Web Services'], tags: ['critical','infrastructure'] },
  { id: 'v2',  name: 'GitHub',              category: 'Engineering Tools',      owner: 'e2',  status: 'Active', since: '2023-06-15', website: 'github.com',           hq: 'San Francisco, CA',  annualSpend: 9600,   terms: 'Annual',  licenses: ['lic2'],  aliases: ['GitHub','GitHub Enterprise'], tags: ['engineering'] },
  { id: 'v3',  name: 'Figma',               category: 'Design',                 owner: 'e8',  status: 'Active', since: '2023-09-20', website: 'figma.com',            hq: 'San Francisco, CA',  annualSpend: 6480,   terms: 'Annual',  licenses: ['lic3'],  aliases: ['Figma','Figma Organization'], tags: ['design'] },
  { id: 'v4',  name: 'Unity Technologies',  category: 'Game Development',        owner: 'e13', status: 'Active', since: '2024-01-10', website: 'unity.com',            hq: 'San Francisco, CA',  annualSpend: 24480,  terms: 'Annual',  licenses: ['lic4'],  aliases: ['Unity','Unity Pro'], tags: ['gaming'] },
  { id: 'v5',  name: 'Datadog',             category: 'Observability',          owner: 'e14', status: 'Active', since: '2024-04-20', website: 'datadoghq.com',        hq: 'New York, NY',       annualSpend: 96000,  terms: 'Annual',  licenses: ['lic7'],  aliases: ['Datadog','Datadog Inc.'], tags: ['monitoring'] },
  { id: 'v6',  name: 'Linear Orbit',        category: 'Project Management',     owner: 'e2',  status: 'Review',  since: '2024-06-01', website: 'linear.app',          hq: 'San Francisco, CA',  annualSpend: 14400,  terms: 'Annual',  licenses: ['lic8'],  aliases: ['Linear','Linear Orbit, Inc.'], tags: ['engineering'] },
  { id: 'v7',  name: 'Google',              category: 'Productivity',           owner: 'e1',  status: 'Active', since: '2019-01-15', website: 'workspace.google.com', hq: 'Mountain View, CA',  annualSpend: 58800,  terms: 'Annual',  licenses: ['lic9'],  aliases: ['Google','Google Workspace'], tags: ['critical','all-staff'] },
  { id: 'v8',  name: 'HubSpot',             category: 'Marketing',              owner: 'e5',  status: 'Active', since: '2023-08-08', website: 'hubspot.com',          hq: 'Cambridge, MA',      annualSpend: 38400,  terms: 'Annual',  licenses: ['lic10'], aliases: ['HubSpot','HubSpot Marketing'], tags: ['marketing'] },
  { id: 'v9',  name: 'Adobe',               category: 'Creative',               owner: 'e19', status: 'Active', since: '2023-04-12', website: 'adobe.com',            hq: 'San Jose, CA',       annualSpend: 14400,  terms: 'Annual',  licenses: ['lic6'],  aliases: ['Adobe','Adobe Creative Cloud'], tags: ['creative'] },
  { id: 'v10', name: '1Password',           category: 'Security',               owner: 'e7',  status: 'Active', since: '2022-05-30', website: '1password.com',        hq: 'Toronto, ON',        annualSpend: 2688,   terms: 'Annual',  licenses: ['lic12'], aliases: ['1Password','1Password Business'], tags: ['security'] },
  { id: 'v11', name: 'Greenbriar Commercial Properties', category: 'Facilities', owner: 'e6', status: 'Active', since: '2021-01-01', website: 'greenbriarcre.com',   hq: 'Bowling Green, KY',  annualSpend: 384000, terms: 'Net 15',  licenses: [],        aliases: ['Greenbriar Commercial Properties'], tags: ['facilities','lease'] },
  { id: 'v12', name: 'PEER Audit Co.',      category: 'Compliance',             owner: 'e9',  status: 'Active', since: '2026-02-01', website: 'peeraudit.com',        hq: 'Chicago, IL',        annualSpend: 84000,  terms: 'On milestone', licenses: [],   aliases: ['PEER Audit Co.'], tags: ['compliance','soc2'] },
];

const VENDOR_CONTACTS = [
  { id: 'vct1', name: 'Daniel Pak',      title: 'Enterprise BD',           vendorId: 'v1',  email: 'dpak@amazon.com',         phone: '+1 206 555 0110', primary: true,  status: 'Active', role: 'Account exec' },
  { id: 'vct2', name: 'Renata Cole',     title: 'Technical Account Manager', vendorId: 'v1', email: 'rcole@amazon.com',        phone: '+1 206 555 0144', primary: false, status: 'Active', role: 'Support' },
  { id: 'vct3', name: 'Marcus Yeo',      title: 'Account Executive',        vendorId: 'v5',  email: 'marcus.yeo@datadoghq.com', phone: '+1 212 555 0188', primary: true,  status: 'Active', role: 'Account exec' },
  { id: 'vct4', name: 'Priscilla Tan',   title: 'Workspace Account Manager', vendorId: 'v7', email: 'ptan@google.com',         phone: '+1 650 555 0133', primary: true,  status: 'Active', role: 'Account manager' },
  { id: 'vct5', name: 'Owen Briggs',     title: 'Customer Success Manager', vendorId: 'v8',  email: 'obriggs@hubspot.com',     phone: '+1 617 555 0121', primary: true,  status: 'Active', role: 'CSM' },
  { id: 'vct6', name: 'Sora Lindqvist',  title: 'Account Manager',          vendorId: 'v3',  email: 'sora@figma.com',          phone: '+1 415 555 0177', primary: true,  status: 'Active', role: 'Account manager' },
  { id: 'vct7', name: 'Hank Devlin',     title: 'Property Manager',         vendorId: 'v11', email: 'hank@greenbriarcre.com',  phone: '+1 270 555 0190', primary: true,  status: 'Active', role: 'Primary' },
  { id: 'vct8', name: 'Lena Ortiz',      title: 'Engagement Partner',       vendorId: 'v12', email: 'lortiz@peeraudit.com',    phone: '+1 312 555 0102', primary: true,  status: 'Active', role: 'Partner' },
  { id: 'vct9', name: 'Tobias Frank',    title: 'Renewals Specialist',      vendorId: 'v6',  email: 'tobias@linear.app',       phone: '+1 415 555 0166', primary: true,  status: 'Active', role: 'Renewals' },
];
VENDOR_CONTACTS.forEach((c, i) => { c.avatar = avatarFor(c.name, i + 120); });

window.HitcentsData = {
  ROLES, DEPTS, EMPLOYEES, USERS,
  CUSTOMERS, CONTACTS, DEAL_STAGES, DEALS,
  IDEA_COLS, IDEAS,
  FILES, ACTIVITY,
  LICENSE_UNITS, LICENSES,
  VENDOR_CATEGORIES, VENDORS, VENDOR_CONTACTS,
};
