// Seed data for the control center

const TODAY = new Date();
const d = (offset, hour=10, min=0) => {
  const x = new Date(TODAY);
  x.setDate(x.getDate() + offset);
  x.setHours(hour, min, 0, 0);
  return x.toISOString();
};

// Color accents + custom monogram glyph (original mark, NOT brand logo) per company
const COMPANY_COLORS = {
  "monday.com":   { bg:"linear-gradient(135deg,#FF3D57,#FF8A3D)", glyph:"three-bars" },
  "Rapyd":        { bg:"linear-gradient(135deg,#2563EB,#0EA5E9)", glyph:"orbit" },
  "NextSilicon":  { bg:"linear-gradient(135deg,#1E293B,#475569)", glyph:"chevron-stack" },
  "Paragon":      { bg:"linear-gradient(135deg,#7C3F58,#D9A78E)", glyph:"diamond" },
  "Empathy":      { bg:"linear-gradient(135deg,#E07856,#F3B89E)", glyph:"heart-pulse" },
  "Eleos":        { bg:"linear-gradient(135deg,#6B9B7A,#BFD8C4)", glyph:"leaf" },
  "eon.io":       { bg:"linear-gradient(135deg,#0F172A,#334155)", glyph:"infinity" },
  "Superplay":    { bg:"linear-gradient(135deg,#8B5CF6,#EC4899)", glyph:"play-burst" },
  "Wix":          { bg:"linear-gradient(135deg,#2A1D1A,#6B5C54)", glyph:"prism" },
};

const randLogo = (name) => COMPANY_COLORS[name] || { bg:"linear-gradient(135deg,#E07856,#7C3F58)", glyph:"dot" };

// Resolve a company's display data, merging optional in-memory overrides
// from the store. Returns { rawName, displayName, segment, logo, data }
function resolveCompany(rawName, segment, baseData){
  const identity = (window.Store && window.Store.getCompanyIdentity) ? window.Store.getCompanyIdentity(rawName) : null;
  const ov       = (window.Store && window.Store.getCompanyOverride) ? window.Store.getCompanyOverride(rawName, segment) : null;
  const baseLogo = randLogo(rawName);
  // Logo: identity is the source of truth (shared). Per-engagement override is legacy.
  const pick = (k) => (identity && identity[k] != null ? identity[k] : (ov && ov[k] != null ? ov[k] : null));
  const logo = {
    ...baseLogo,
    ...(pick("_logoBg")     != null ? { bg: pick("_logoBg") } : {}),
    ...(pick("_logoMode")   != null ? { _logoMode: pick("_logoMode") } : {}),
    ...(pick("_logoLetter") != null ? { _logoLetter: pick("_logoLetter") } : {}),
    ...(pick("_logoDomain") != null ? { _logoDomain: pick("_logoDomain") } : {}),
  };
  // Merge order: base mock → per-engagement override → shared identity (highest priority for identity fields).
  const merged = { ...(baseData || {}), ...(ov || {}), ...(identity || {}) };
  delete merged._logoBg; delete merged._logoMode; delete merged._logoLetter; delete merged._logoDomain; delete merged._displayName;

  // Derive lastTouch from the most recent touchpoint stored in the drawer (if any).
  // Touchpoints are added via the drawer's Touchpoints tab — newest first.
  if (window.Store && window.Store.getTouchpoints) {
    const tps = window.Store.getTouchpoints(rawName, segment);
    if (tps && tps.length) {
      const latest = tps[0]; // touchpoints are inserted at the head
      merged.lastTouch = {
        type: latest.type || merged.lastTouch?.type || "call",
        who:  latest.who  || merged.lastTouch?.who  || "—",
        when: latest.date || latest.when || "Just now",
        note: latest.note || latest.title || "",
      };
    }
  }

  return {
    rawName,
    displayName: (identity && identity._displayName) || (ov && ov._displayName) || rawName,
    segment,
    logo,
    data: merged,
  };
}

if(typeof window !== "undefined") window.resolveCompany = resolveCompany;

// ===== MD SERVICE COMPANIES =====
const MD_DATA = {
  "monday.com": {
    health:"green",
    services:["Executive Cardiac Screening","Quarterly Physicals","Sleep Studies","Concierge Hotline"],
    champion:{ name:"Shira Levi", role:"Chief People Officer", email:"shira@monday.com", phone:"+972 54 882 1140", since:"Apr 2024", relationship:"warm", note:"Sponsored the original deal. Pushes for utilization reports every quarter; trusts our team with full exec roster." },
    poc:{ name:"Shira Levi", role:"Chief People Officer", email:"shira@monday.com" },
    lastTouch:{ type:"call", who:"Dr. Yohai", when:"2 days ago", note:"Quarterly health review for exec team. Flagged 3 execs for advanced cardiac workup. Team is happy with response times." },
    currentProject:"Executive cardiac screening — Tel Aviv HQ, 42 execs. Week 2 of 4.",
    openTasks:3,
    renewalDays:47,
    renewalDate:"Jun 10, 2026",
    nextCall:"Thu · 14:00",
    mrr:"₪68,000",
    opportunity:"Expand to Warsaw + NYC offices (~140 employees). Est. value ₪24K/mo.",
    contacts:[
      { name:"Eran Zinman", role:"Co-Founder & CTO", initial:"EZ" },
      { name:"Shira Levi", role:"Chief People Officer", initial:"SL" },
      { name:"Daniel Shwartz", role:"Exec Assistant", initial:"DS" },
    ],
    tasks:[
      { title:"Send cardiac screening results to Eran", due:"Today", status:"soon", done:false },
      { title:"Book follow-ups for 3 flagged execs", due:"Tomorrow", status:"", done:false },
      { title:"Prepare Warsaw office expansion proposal", due:"Apr 30", status:"", done:false },
    ],
    timeline:[
      { type:"call", who:"Dr. Yohai", date:"2 days ago", title:"Quarterly review call", note:"Reviewed 42 screenings. 3 flagged for advanced workup. CPO wants to add sleep study package." },
      { type:"meet", who:"Nurse Team", date:"1 week ago", title:"On-site cardiac screening day 1/2", note:"Day 1 complete. 24 execs screened. Blood draws sent to Assuta. Day 2 scheduled." },
      { type:"email", who:"Shira Levi", date:"2 weeks ago", title:"Onboarding paperwork signed", note:"All 42 execs signed medical consent. Ready for screening week." },
    ],
  },
  "Rapyd": {
    health:"amber",
    services:["Quarterly Exec Physicals","Concierge Hotline","Family Medicine"],
    champion:{ name:"Maya Cohen", role:"Chief of Staff to CEO", email:"maya@rapyd.net", phone:"+972 52 314 0098", since:"Sep 2023", relationship:"strong", note:"Our daily operator. Schedules Arik's physicals, escalates blockers, gets things unstuck inside Rapyd." },
    poc:{ name:"Maya Cohen", role:"Chief of Staff to CEO", email:"maya@rapyd.net" },
    lastTouch:{ type:"email", who:"Arik Shtilman", when:"8 days ago", note:"CEO reschedule — pushed quarterly exec physicals from March to May. Needs updated cost breakdown by Friday." },
    currentProject:"Delayed: Quarterly exec physicals (18 execs). Rescheduling to May.",
    openTasks:2,
    renewalDays:12,
    renewalDate:"May 6, 2026",
    nextCall:"Overdue · reschedule",
    mrr:"₪32,000",
    opportunity:"Add family membership tier for C-suite partners. Est. +₪14K/mo.",
    contacts:[
      { name:"Arik Shtilman", role:"Co-Founder & CEO", initial:"AS" },
      { name:"Maya Cohen", role:"Chief of Staff", initial:"MC" },
    ],
    tasks:[
      { title:"Send Q2 physicals cost breakdown", due:"Apr 26", status:"overdue", done:false },
      { title:"Reschedule exec physicals for May 12-15", due:"Apr 30", status:"soon", done:false },
    ],
    timeline:[
      { type:"email", who:"Arik", date:"8 days ago", title:"Rescheduling physicals", note:"CEO is pushing Q1 physicals to May due to funding round closing." },
      { type:"call", who:"Dr. Yohai", date:"3 weeks ago", title:"Renewal discussion", note:"Arik open to renewal, wants to add family tier. Need proposal by renewal date." },
    ],
  },
  "NextSilicon": {
    health:"green",
    services:["C-Suite Longevity Program","Genomics","Advanced Bloodwork","Sleep Tracking"],
    champion:{ name:"Tal Rabin", role:"Head of People", email:"tal@nextsilicon.com", phone:"+972 50 271 9034", since:"Feb 2026", relationship:"new", note:"Owns logistics, consent forms and scheduling. Brought us in after meeting Dr. Yohai at TechAviv." },
    poc:{ name:"Tal Rabin", role:"Head of People", email:"tal@nextsilicon.com" },
    lastTouch:{ type:"meet", who:"Dr. Yohai + Elad", when:"Yesterday", note:"Kickoff meeting for new C-suite longevity program. 6 executives. Baseline testing starts next week." },
    currentProject:"NEW: C-suite longevity program kickoff. Baseline testing Apr 28.",
    openTasks:5,
    renewalDays:360,
    renewalDate:"Apr 2027",
    nextCall:"Tue · 11:30",
    mrr:"₪48,000",
    opportunity:"Hardware team wellness — 120 engineers. Awaiting HR approval.",
    contacts:[
      { name:"Elad Raz", role:"CEO & Founder", initial:"ER" },
      { name:"Tal Rabin", role:"Head of People", initial:"TR" },
    ],
    tasks:[
      { title:"Order genomics kits (6x)", due:"Today", status:"soon", done:false },
      { title:"Schedule baseline blood work at Assuta", due:"Apr 28", status:"", done:false },
      { title:"Prepare longevity program handbook", due:"May 1", status:"", done:false },
      { title:"Confirm Tal Rabin intro call", due:"May 3", status:"", done:true },
      { title:"Engineering team wellness pitch", due:"May 10", status:"", done:false },
    ],
    timeline:[
      { type:"meet", who:"Dr. Yohai + Elad", date:"Yesterday", title:"Program kickoff", note:"Confirmed 6 execs. Elad wants quarterly cadence, not monthly. Adding sleep tracking." },
      { type:"call", who:"Tal Rabin", date:"5 days ago", title:"HR onboarding call", note:"Tal will handle consent forms and scheduling logistics." },
    ],
  },
  "Paragon": {
    health:"green",
    services:["Annual Exec Screening","Hormone Optimization (proposed)"],
    champion:{ name:"Brandon Foo", role:"CEO & Co-Founder", email:"brandon@useparagon.com", phone:"+1 415 224 0911", since:"Jan 2025", relationship:"strong", note:"Direct line. Texts Dr. Yohai. Wants to expand the program personally — hormone optimization is his ask." },
    poc:{ name:"Brandon Foo", role:"CEO & Co-Founder", email:"brandon@useparagon.com" },
    lastTouch:{ type:"call", who:"Dr. Yohai", when:"4 days ago", note:"Annual screening results review. All clear. Brandon asked about hormone optimization protocol." },
    currentProject:"Annual exec screenings complete. Follow-up protocols in design.",
    openTasks:2,
    renewalDays:88,
    renewalDate:"Jul 21, 2026",
    nextCall:"Next week",
    mrr:"₪21,000",
    opportunity:"Hormone optimization add-on for Brandon + 2 VPs.",
    contacts:[
      { name:"Brandon Foo", role:"CEO & Co-Founder", initial:"BF" },
    ],
    tasks:[
      { title:"Draft hormone optimization proposal", due:"May 2", status:"", done:false },
      { title:"Send annual reports PDF", due:"Today", status:"soon", done:false },
    ],
    timeline:[
      { type:"call", who:"Dr. Yohai", date:"4 days ago", title:"Annual results review", note:"All clean. Discussion moved to hormone optimization, which Brandon is very interested in." },
    ],
  },
  "Empathy": {
    health:"green",
    services:["Single-Member Concierge","Family Care"],
    champion:{ name:"Ron Gura", role:"CEO & Co-Founder", email:"ron@empathy.com", phone:"+1 212 489 7720", since:"Aug 2025", relationship:"strong", note:"Personal client first. Now wants to bring his exec team on after we cared for his father." },
    poc:{ name:"Ron Gura", role:"CEO & Co-Founder", email:"ron@empathy.com" },
    lastTouch:{ type:"email", who:"Ron Gura", when:"6 days ago", note:"Thanking team for handling his father's case with care. Wants to expand to his full exec team (8 people)." },
    currentProject:"Single-member program. Exec team expansion in discussion.",
    openTasks:1,
    renewalDays:200,
    renewalDate:"Nov 2026",
    nextCall:"Fri · 09:00",
    mrr:"₪8,400",
    opportunity:"Exec team expansion — 8 additional members. Est. +₪48K/mo.",
    contacts:[
      { name:"Ron Gura", role:"CEO & Co-Founder", initial:"RG" },
    ],
    tasks:[
      { title:"Send exec team expansion proposal", due:"Apr 29", status:"", done:false },
    ],
    timeline:[
      { type:"email", who:"Ron Gura", date:"6 days ago", title:"Expansion interest", note:"Ron wants to bring on his full leadership team after positive experience with his father's care." },
    ],
  },
  "Eleos": {
    health:"amber",
    services:["Executive Concierge","Quarterly Physicals"],
    champion:{ name:"Alon Joffe", role:"CEO & Co-Founder", email:"alon@eleos.health", phone:"+972 54 990 4421", since:"Mar 2025", relationship:"warm", note:"Travels heavily. Prefers WhatsApp over email. Needs a steady hand to keep cadence." },
    poc:{ name:"Alon Joffe", role:"CEO & Co-Founder", email:"alon@eleos.health" },
    lastTouch:{ type:"call", who:"Dr. Yohai", when:"3 weeks ago", note:"Quick check-in. Alon was traveling. Needs to reschedule deep-dive on Q2 plan." },
    currentProject:"Waiting on client — Q2 plan sign-off overdue.",
    openTasks:1,
    renewalDays:62,
    renewalDate:"Jun 25, 2026",
    nextCall:"Needs reschedule",
    mrr:"₪18,000",
    opportunity:"Likely renewal. No expansion signal yet.",
    contacts:[
      { name:"Alon Joffe", role:"CEO & Co-Founder", initial:"AJ" },
    ],
    tasks:[
      { title:"Follow up on Q2 plan sign-off", due:"Apr 25", status:"overdue", done:false },
    ],
    timeline:[
      { type:"call", who:"Dr. Yohai", date:"3 weeks ago", title:"Brief check-in", note:"Alon traveling. Need to re-engage ASAP." },
    ],
  },
  "eon.io": {
    health:"green",
    services:["Monthly Concierge","Bloodwork","Nutritional Coaching"],
    champion:{ name:"Aviv Gafni", role:"CEO", email:"aviv@eon.io", phone:"+972 50 661 7785", since:"Jul 2024", relationship:"strong", note:"Single-member program. Engaged, consistent — never misses a monthly. Exploring family tier." },
    poc:{ name:"Aviv Gafni", role:"CEO", email:"aviv@eon.io" },
    lastTouch:{ type:"meet", who:"Dr. Yohai + Aviv", when:"5 days ago", note:"Monthly 1:1. Reviewed recent bloodwork. All metrics trending positive." },
    currentProject:"Monthly concierge protocol. Stable.",
    openTasks:1,
    renewalDays:154,
    renewalDate:"Sep 2026",
    nextCall:"May 20",
    mrr:"₪12,000",
    opportunity:"Spouse + 2 adult children could join family tier.",
    contacts:[
      { name:"Aviv Gafni", role:"CEO", initial:"AG" },
    ],
    tasks:[
      { title:"Send May bloodwork reminder", due:"May 15", status:"", done:false },
    ],
    timeline:[
      { type:"meet", who:"Dr. Yohai + Aviv", date:"5 days ago", title:"Monthly 1:1", note:"Everything stable. Discussed possibility of family tier." },
    ],
  },
  "Superplay": {
    health:"red",
    services:["Executive Concierge","Quarterly Physicals"],
    champion:{ name:"Yael Peretz", role:"Executive Assistant to CEO", email:"yael@superplay.com", phone:"+972 54 110 2299", since:"May 2025", relationship:"distant", note:"Currently the only door in. CEO heads-down on Series C — Yael is the gatekeeper. Needs careful handling." },
    poc:{ name:"Yael Peretz", role:"Executive Assistant", email:"yael@superplay.com" },
    lastTouch:{ type:"email", who:"Assistant", when:"11 days ago", note:"Gilad's assistant replied. CEO is heads-down on Series C close. Wants to postpone all non-urgent matters." },
    currentProject:"Paused — client focused on funding round.",
    openTasks:2,
    renewalDays:8,
    renewalDate:"May 2, 2026",
    nextCall:"Blocked",
    mrr:"₪15,000",
    opportunity:"At risk — renewal conversation not happening. Need to reach Gilad directly.",
    contacts:[
      { name:"Gilad Almog", role:"CEO & Co-Founder", initial:"GA" },
      { name:"Yael Peretz", role:"Executive Assistant", initial:"YP" },
    ],
    tasks:[
      { title:"Text Gilad directly re: renewal", due:"Today", status:"overdue", done:false },
      { title:"Draft renewal pause option (6mo skip)", due:"Apr 28", status:"soon", done:false },
    ],
    timeline:[
      { type:"email", who:"Yael Peretz", date:"11 days ago", title:"Postponing meetings", note:"CEO in Series C close. Non-urgent matters pushed." },
      { type:"call", who:"Dr. Yohai", date:"1 month ago", title:"Last direct convo", note:"Gilad vague on renewal. Mentioned tight cashflow during round." },
    ],
  },
};

// ===== MGMT COMPANIES =====
const MGMT_DATA = {
  "monday.com": {
    health:"green",
    services:["Employee Concierge (1,400)","On-Demand GP","Mental Health (proposed)"],
    poc:{ name:"Shira Levi", role:"CPO", email:"shira@monday.com" },
    lastTouch:{ type:"call", who:"Dr. Yohai + Shira", when:"1 week ago", note:"Reviewed Q1 utilization report. 87% of benefit used. Discussing expanding mental health coverage." },
    currentProject:"Retainer: 1,400-person employee medical concierge. Q2 planning.",
    openTasks:4,
    renewalDays:47,
    renewalDate:"Jun 10, 2026",
    nextCall:"Thu · 14:00",
    mrr:"₪120,000",
    opportunity:"Mental health tier add-on. Est. +₪38K/mo.",
    contacts:[
      { name:"Shira Levi", role:"CPO", initial:"SL" },
      { name:"Ido Ben-Shoshan", role:"VP HR", initial:"IB" },
    ],
    tasks:[
      { title:"Prepare Q1 utilization report (final)", due:"Today", status:"soon", done:false },
      { title:"Mental health tier proposal", due:"May 5", status:"", done:false },
      { title:"Renewal doc pre-read", due:"May 20", status:"", done:false },
      { title:"Schedule Q2 kickoff", due:"Jun 1", status:"", done:false },
    ],
    timeline:[
      { type:"call", who:"Shira Levi", date:"1 week ago", title:"Q1 utilization review", note:"87% benefit used — industry leading. Mental health tier interest confirmed." },
      { type:"meet", who:"Dr. Yohai + Ido", date:"3 weeks ago", title:"HR ops sync", note:"Quarterly ops review. All SLAs green." },
    ],
  },
  "Wix": {
    health:"green",
    services:["Employee Concierge (5,600)","14-Country Network","On-Site Clinics"],
    poc:{ name:"Nir Zohar", role:"President & COO", email:"nir@wix.com" },
    lastTouch:{ type:"email", who:"Nir Zohar", when:"3 days ago", note:"Approved expansion from Tel Aviv to Kyiv and Vilnius offices. Onboarding timeline needed." },
    currentProject:"Retainer: 5,600 employees, 14 countries. Eastern Europe expansion.",
    openTasks:6,
    renewalDays:215,
    renewalDate:"Dec 2026",
    nextCall:"Mon · 10:30",
    mrr:"₪280,000",
    opportunity:"Expansion approved: +1,200 employees (Kyiv, Vilnius). ~₪56K/mo additional.",
    contacts:[
      { name:"Nir Zohar", role:"President & COO", initial:"NZ" },
      { name:"Aviva Feiner", role:"Chief HR Officer", initial:"AF" },
      { name:"Itai Shor", role:"Benefits Lead", initial:"IS" },
    ],
    tasks:[
      { title:"Kyiv office scoping doc", due:"Apr 28", status:"soon", done:false },
      { title:"Vilnius local provider contracts", due:"May 3", status:"", done:false },
      { title:"Onboarding timeline — 1,200 new users", due:"May 5", status:"", done:false },
      { title:"Localization for benefit portal (UA/LT)", due:"May 12", status:"", done:false },
      { title:"Quarterly business review deck", due:"May 20", status:"", done:false },
      { title:"On-site clinic feasibility", due:"Jun 1", status:"", done:true },
    ],
    timeline:[
      { type:"email", who:"Nir Zohar", date:"3 days ago", title:"Expansion approved", note:"Green light on Kyiv + Vilnius. Wants full plan by May 10." },
      { type:"meet", who:"Dr. Yohai + Nir + Aviva", date:"2 weeks ago", title:"Expansion scoping", note:"Discussed logistics, local provider mapping, compliance." },
    ],
  },
  "Superplay": {
    health:"amber",
    services:["Employee Benefit (340)","On-Demand GP"],
    poc:{ name:"Oren Zaidel", role:"CFO", email:"oren@superplay.com" },
    lastTouch:{ type:"email", who:"Oren Zaidel", when:"9 days ago", note:"CFO asking for cost justification for retainer during runway review." },
    currentProject:"Retainer: 340 employees. Cost scrutiny during Series C.",
    openTasks:2,
    renewalDays:8,
    renewalDate:"May 2, 2026",
    nextCall:"Reschedule",
    mrr:"₪42,000",
    opportunity:"Pivot to usage-based model to survive runway squeeze.",
    contacts:[
      { name:"Oren Zaidel", role:"CFO", initial:"OZ" },
      { name:"Gilad Almog", role:"CEO", initial:"GA" },
    ],
    tasks:[
      { title:"Send utilization ROI memo", due:"Apr 25", status:"overdue", done:false },
      { title:"Draft usage-based pricing option", due:"Apr 28", status:"soon", done:false },
    ],
    timeline:[
      { type:"email", who:"Oren", date:"9 days ago", title:"Cost justification request", note:"CFO asking for hard ROI numbers. Need to ship memo." },
    ],
  },
  "Eleos": {
    health:"green",
    services:["Employee Concierge (180)","Onboarding Health Checks"],
    poc:{ name:"Raviv Turner", role:"COO", email:"raviv@eleos.health" },
    lastTouch:{ type:"call", who:"Dr. Yohai + Raviv", when:"2 days ago", note:"Monthly ops sync. Adding 30 new hires in May. All on track." },
    currentProject:"Retainer: 180 employees (growing to 210). Healthy.",
    openTasks:2,
    renewalDays:62,
    renewalDate:"Jun 25, 2026",
    nextCall:"May 5",
    mrr:"₪34,000",
    opportunity:"Scaling with headcount — natural expansion.",
    contacts:[
      { name:"Raviv Turner", role:"COO", initial:"RT" },
      { name:"Alon Joffe", role:"CEO", initial:"AJ" },
    ],
    tasks:[
      { title:"Onboard 30 new hires (May cohort)", due:"May 15", status:"", done:false },
      { title:"Q2 health check", due:"Jun 10", status:"", done:false },
    ],
    timeline:[
      { type:"call", who:"Raviv", date:"2 days ago", title:"Monthly ops sync", note:"All green. 30 new hires confirmed. Planning Q2." },
    ],
  },
};

// ===== NEW BUSINESS EVENTS =====
const NEW_BIZ = [
  {
    id:"cancer-wix",
    type:"Screening Event",
    title:"Breast Cancer Screening — Wix Women",
    client:"Wix",
    month:"MAY", day:"14", year:"2026",
    headcount:"220 women",
    stage:"hot",
    stageLabel:"Confirmed",
    venue:"Wix Tel Aviv HQ",
    value:"₪145,000",
    note:"2-day on-site. Mobile mammography unit + clinical consults. Full team locked.",
  },
  {
    id:"md-kickoff-next",
    type:"Private MD Kickoff",
    title:"NextSilicon C-Suite Longevity Program",
    client:"NextSilicon",
    month:"APR", day:"28", year:"2026",
    headcount:"6 executives",
    stage:"prep",
    stageLabel:"Prep Week",
    venue:"Medical by Moveo Clinic",
    value:"₪96,000 setup · ₪48K/mo",
    note:"Genomics kits ordered. Baseline bloodwork scheduled. Handbook in design.",
  },
  {
    id:"cardiac-rapyd",
    type:"Screening Event",
    title:"Cardiac Screening Day — Rapyd Leadership",
    client:"Rapyd",
    month:"MAY", day:"23", year:"2026",
    headcount:"18 execs",
    stage:"prep",
    stageLabel:"Scheduling",
    venue:"Rapyd HQ",
    value:"₪62,000",
    note:"Rescheduled from March. Need to confirm Assuta lab capacity.",
  },
  {
    id:"project-paragon",
    type:"Large Project",
    title:"Hormone Optimization Protocol Design — Paragon Leadership",
    client:"Paragon",
    month:"MAY", day:"06", year:"2026",
    headcount:"3 execs",
    stage:"hot",
    stageLabel:"Proposal Sent",
    venue:"Remote + 2 visits",
    value:"₪58,000",
    note:"Brandon very engaged. Awaiting PO signature.",
  },
  {
    id:"md-kickoff-empathy",
    type:"Private MD Kickoff",
    title:"Empathy Exec Team Expansion",
    client:"Empathy",
    month:"JUN", day:"02", year:"2026",
    headcount:"8 execs",
    stage:"hot",
    stageLabel:"Verbal Yes",
    venue:"NYC + Tel Aviv",
    value:"₪124,000 setup",
    note:"Ron wants to bring on full leadership after positive individual experience." ,
  },
  {
    id:"womens-health-monday",
    type:"Screening Event",
    title:"Women's Health Day — monday.com",
    client:"monday.com",
    month:"JUL", day:"09", year:"2026",
    headcount:"~400 women",
    stage:"won",
    stageLabel:"Scoping",
    venue:"monday.com TLV + Warsaw",
    value:"₪210,000",
    note:"Bi-location event. Warsaw needs local partnership." ,
  },
];

// ===== INTERNAL =====
const TEAM = [
  { name:"Dr. Noa Ben-Ari", role:"Medical Director", status:"on-call", avatar:"linear-gradient(135deg,#E07856,#7C3F58)", initial:"NB" },
  { name:"Dr. Amit Keren", role:"Cardiology Lead", status:"in-clinic", avatar:"linear-gradient(135deg,#6B9B7A,#4A6E68)", initial:"AK" },
  { name:"Maya Cohen, RN", role:"Head Nurse", status:"on-site: monday.com", avatar:"linear-gradient(135deg,#D9A78E,#7C3F58)", initial:"MC" },
  { name:"Tamar Gold", role:"Ops Manager", status:"remote", avatar:"linear-gradient(135deg,#E8B84A,#B08A2A)", initial:"TG" },
  { name:"Yossi Levin", role:"Client Success Lead", status:"available", avatar:"linear-gradient(135deg,#7BA098,#4A6E68)", initial:"YL" },
];

const HIRING = [
  { title:"Physician — Internal Medicine", loc:"Tel Aviv · Full-time", stage:"final interviews", status:"doing" },
  { title:"Registered Nurse (2 positions)", loc:"Tel Aviv · Full-time", stage:"screening", status:"doing" },
  { title:"Client Success Manager", loc:"Tel Aviv · Hybrid", stage:"offer sent", status:"ok" },
  { title:"Ops Coordinator", loc:"Tel Aviv · Full-time", stage:"on hold", status:"blocked" },
];

const INTERNAL_TASKS = [
  { title:"Q2 all-hands agenda", owner:"Dr. Yohai", due:"Apr 29", status:"doing" },
  { title:"New clinic space — architect sign-off", owner:"Tamar Gold", due:"May 3", status:"doing" },
  { title:"HIPAA / Israeli privacy audit", owner:"Yossi Levin", due:"May 10", status:"ok" },
  { title:"Launch partner portal v2", owner:"Eng team", due:"May 20", status:"doing" },
  { title:"Renegotiate Assuta lab rates", owner:"Dr. Yohai", due:"Apr 30", status:"blocked" },
];

const FINANCE = {
  mrr: { val:"₪1.04M", trend:"+12.4%" },
  ar:  { val:"₪432K", sub:"30-day outstanding", pct:72 },
  runway: { val:"18", unit:"mo", sub:"Current burn: ₪640K/mo", pct:60 },
  collect: { val:"94.2%", sub:"Collection rate, Q1", pct:94 },
};

// ===== AGENDA =====
const AGENDA_TODAY = [
  { time:"09:00", title:"Morning clinic huddle", meta:"All clinical staff · Clinic", tag:"int", tagLabel:"Internal" },
  { time:"10:30", title:"Eleos · Raviv Turner · Monthly ops", meta:"Video · 30 min", tag:"mgmt", tagLabel:"Management" },
  { time:"12:00", title:"Lunch block — protected", meta:"No calls", tag:"int", tagLabel:"Internal" },
  { time:"14:00", title:"monday.com · Shira Levi · Q1 utilization", meta:"Video · 45 min", tag:"mgmt", tagLabel:"Management" },
  { time:"16:00", title:"NextSilicon kickoff — kit inventory check", meta:"Clinic · 20 min", tag:"new", tagLabel:"New Biz" },
  { time:"17:30", title:"1:1 with Dr. Noa Ben-Ari", meta:"Office · 30 min", tag:"int", tagLabel:"Internal" },
];
const AGENDA_TOMORROW = [
  { time:"08:30", title:"Rapyd · Arik reschedule attempt", meta:"Call", tag:"md", tagLabel:"MD Service" },
  { time:"11:30", title:"NextSilicon · Elad Raz · Pre-kickoff", meta:"Video · 30 min", tag:"md", tagLabel:"MD Service" },
  { time:"15:00", title:"Interview: Physician — Internal Med (final)", meta:"Office · 90 min", tag:"int", tagLabel:"Internal" },
];
const AGENDA_WEEK = [
  { time:"THU", title:"monday.com quarterly review (in-person)", meta:"monday.com HQ · 2 hr", tag:"mgmt", tagLabel:"Management" },
  { time:"FRI", title:"Empathy · Ron Gura · Expansion call", meta:"Video · 45 min", tag:"md", tagLabel:"MD Service" },
  { time:"MON", title:"Wix · Nir Zohar · Eastern Europe sync", meta:"Video · 60 min", tag:"mgmt", tagLabel:"Management" },
];

const ALERTS = [
  { level:"red", title:"Superplay MD retainer renews in 8 days", meta:"CEO unresponsive · high risk", icon:"⚠", clientName:"Superplay", segment:"md" },
  { level:"red", title:"Rapyd proposal overdue (2 days)", meta:"Arik waiting on cost breakdown", icon:"⏰", clientName:"Rapyd", segment:"md" },
  { level:"amber", title:"Eleos MD — Q2 sign-off pending 3 weeks", meta:"Alon traveling · needs reschedule", icon:"◐", clientName:"Eleos", segment:"md" },
  { level:"amber", title:"6 overdue client tasks", meta:"Across 3 MD Service accounts", icon:"✓" },
];

const KPIs = [
  { lbl:"Monthly Revenue", val:"₪1.04M", unit:"", trend:"+12.4%", trendType:"pos", sub:"vs last month" },
  { lbl:"Active Clients", val:"12", unit:"", trend:"+2", trendType:"pos", sub:"across 4 segments" },
  { lbl:"Open Tasks", val:"28", unit:"", trend:"6 overdue", trendType:"neg", sub:"across the team" },
  { lbl:"Pipeline Value", val:"₪695K", unit:"", trend:"+₪142K", trendType:"pos", sub:"new biz this qtr" },
];

// ===== NEW BUSINESS PIPELINE =====
// Booked / signed but not yet steady. Cards flow through onboarding stages.
// kind: "md" | "mgmt" | "event" — drives badge color + drawer behavior.
const NEW_BUSINESS_STAGES = [
  { k:"signed",     label:"Just signed",       sub:"Paperwork done, kickoff TBD" },
  { k:"scheduled",  label:"Kickoff scheduled", sub:"Date in the calendar" },
  { k:"onboarding", label:"In onboarding",     sub:"Kickoff happened, ramping up" },
  { k:"live",       label:"Going live",        sub:"First deliverables imminent" },
  { k:"graduating", label:"Graduating",        sub:"About to flip to steady" },
];

const NEW_BUSINESS = [
  {
    id:"nb-monday-warsaw", kind:"mgmt", stage:"signed",
    company:"monday.com — Warsaw",
    segment:"Management",
    logoBg:"linear-gradient(135deg,#FF3D57,#FF8A3D)", logoLetter:"m",
    value:"₪58K/mo", valueNote:"Expansion deal, 140 employees",
    owner:"Dr. Yohai", ownerInitials:"DY",
    nextStep:"Send kickoff agenda by Apr 30", lastTouch:"Contract countersigned · 2 days ago",
    notes:"Eran Zinman wants to mirror the Tel Aviv setup. Coordinate with monday HR.",
  },
  {
    id:"nb-rapyd-cardiac", kind:"event", stage:"scheduled",
    company:"Rapyd — Cardiac Screening Day",
    segment:"One-time event",
    logoBg:"linear-gradient(135deg,#2563EB,#0EA5E9)", logoLetter:"R",
    value:"₪62,000", valueNote:"18 execs, 1 day",
    owner:"Maya Cohen, RN", ownerInitials:"MC",
    nextStep:"Confirm Assuta lab capacity by May 9", lastTouch:"Date locked: May 23 · yesterday",
    notes:"Rescheduled from March — keep close eye on cardiologist availability.",
  },
  {
    id:"nb-paragon-md", kind:"md", stage:"scheduled",
    company:"Paragon — Hormone Protocol",
    segment:"MD Services",
    logoBg:"linear-gradient(135deg,#7C3F58,#D9A78E)", logoLetter:"P",
    value:"₪48K/mo + setup", valueNote:"3 executives",
    owner:"Dr. Amit Keren", ownerInitials:"AK",
    nextStep:"Kickoff call May 6 — protocol design", lastTouch:"Proposal accepted · 3 days ago",
    notes:"Brandon Foo + 2 VPs. Hormone panel + nutritionist add-on.",
  },
  {
    id:"nb-nextsilicon-md", kind:"md", stage:"onboarding",
    company:"NextSilicon — C-Suite Longevity",
    segment:"MD Services",
    logoBg:"linear-gradient(135deg,#1E293B,#475569)", logoLetter:"N",
    value:"₪96K setup · ₪48K/mo", valueNote:"6 executives",
    owner:"Dr. Noa Ben-Ari", ownerInitials:"NB",
    nextStep:"Bloodwork sweep + first 1:1s this week", lastTouch:"Genomics kits delivered · today",
    notes:"Handbook in final design. First medical 1:1s scheduled Apr 28–May 2.",
  },
  {
    id:"nb-fundbox-mgmt", kind:"mgmt", stage:"onboarding",
    company:"Fundbox — Exec Care",
    segment:"Management",
    logoBg:"linear-gradient(135deg,#0EA5A4,#22C55E)", logoLetter:"F",
    value:"₪34K/mo", valueNote:"4-person C-suite",
    owner:"Tamar Gold", ownerInitials:"TG",
    nextStep:"Match each exec to internal MD by May 10", lastTouch:"First weekly check-in done · 4 days ago",
    notes:"CEO had concierge-style at previous company — match expectations.",
  },
  {
    id:"nb-wix-screening", kind:"event", stage:"live",
    company:"Wix Women — Breast Cancer Screening",
    segment:"One-time event",
    logoBg:"linear-gradient(135deg,#FF3D57,#FF8A3D)", logoLetter:"W",
    value:"₪145,000", valueNote:"220 women, 2 days",
    owner:"Dr. Noa Ben-Ari", ownerInitials:"NB",
    nextStep:"Mobile mammography unit arrives May 13", lastTouch:"Final headcount confirmed · today",
    notes:"Largest single-event we've run. PR opportunity if it goes smoothly.",
  },
  {
    id:"nb-melio-md", kind:"md", stage:"live",
    company:"Melio — Founder Care",
    segment:"MD Services",
    logoBg:"linear-gradient(135deg,#8B5CF6,#EC4899)", logoLetter:"M",
    value:"₪14K/mo", valueNote:"Co-founder pair",
    owner:"Dr. Yohai", ownerInitials:"DY",
    nextStep:"First quarterly review May 12", lastTouch:"Both founders cleared baseline · last week",
    notes:"Light-touch program. Co-founders want minimal touchpoints.",
  },
  {
    id:"nb-monday-warsaw-grad", kind:"mgmt", stage:"graduating",
    company:"Lemonade — Exec Wellness",
    segment:"Management",
    logoBg:"linear-gradient(135deg,#FF3D57,#FF8A3D)", logoLetter:"L",
    value:"₪42K/mo", valueNote:"7-person leadership team",
    owner:"Yossi Levin", ownerInitials:"YL",
    nextStep:"Flip to steady ops May 15 — handoff to Tamar", lastTouch:"All execs onboarded · last week",
    notes:"Ready to graduate. Handing off to ongoing Management team.",
  },
];

Object.assign(window, {
  MD_DATA, MGMT_DATA, NEW_BIZ, TEAM, HIRING, INTERNAL_TASKS, FINANCE,
  AGENDA_TODAY, AGENDA_TOMORROW, AGENDA_WEEK, ALERTS, KPIs,
  COMPANY_COLORS, randLogo,
  NEW_BUSINESS, NEW_BUSINESS_STAGES,
});
