// PERSONA PLATFORM — Data layer
const PERSONA_DATA = {
  kpis: {
    total: 2841, defendants: 342, witnesses: 1054,
    attorneys: 512, judges: 84, agents: 184, experts: 125,
    psychAssessed: 142, highRisk: 28, newThisWeek: 18,
  },

  people: [
    {
      id: 'PE-001', name: 'Marcus Harrell Jr.', type: 'Defendant',
      roles: ['Target', 'Corporate Officer'], status: 'Indicted', risk: 'High',
      dob: '1978-04-12', aliases: ['Marc', 'M-Dog'],
      organization: 'Sterling Financial Group', title: 'Chief Risk Officer',
      matters: ['U.S. v. Harrell', 'SEC v. Sterling Financial'],
      counsel: ['Elise Bowman, Esq. (Defense)'],
      tags: ['Flight Risk', 'Cooperation Target', 'White Collar'],
      notes: 'Primary architect of the Sterling wire fraud conspiracy. Orchestrated a $42M misrepresentation scheme involving falsified risk assessments presented to institutional lenders. Currently under pre-trial supervision with GPS monitoring.',
      lastUpdated: '2026-04-20',
      psych: {
        ocean: { o: 82, c: 95, e: 40, a: 28, n: 78 },
        vulnerabilities: ['Status Preservation', 'Loss Aversion', 'Fear of Incarceration', 'Professional Identity'],
        biases: ['Overconfidence Effect', 'Sunk Cost Fallacy', 'Dunning-Kruger (compliance)'],
        interrogation: 'Highly reactive to challenges to professional competence. Avoid aggressive confrontation — apply PEACE model with open-ended recall prompts. Most susceptible to "minimization" themes that frame his conduct as systemic failure rather than individual intent. Responds to perceived peers.',
        deception: ['Linguistic distancing: avoids "I" pronouns when discussing Q3 financials', 'Micro-expressions of contempt on confrontation with co-conspirator emails', 'Elevated speech rate when discussing November board meeting'],
        assessedBy: 'Dr. R. Simmons, PsyD (Forensic)', assessedDate: '2026-03-22',
      },
    },
    {
      id: 'PE-002', name: 'Dr. Priya Venkataraman', type: 'Defendant',
      roles: ['Subject', 'Founder'], status: 'Pre-trial', risk: 'Critical',
      dob: '1965-11-23', aliases: [],
      organization: 'Venkataraman Medical Group', title: 'Founder & Lead Surgeon',
      matters: ['U.S. v. Venkataraman'],
      counsel: ['Michael Kirkland, Esq. (Defense)'],
      tags: ['Medical', 'Asset Freeze', 'HHS-OIG'],
      notes: 'Subject of a sweeping HHS-OIG healthcare fraud investigation involving systematic upcoding across 3 facilities. Estimated $7.2M in fraudulent billings. High-profile local figure with strong community ties. Asset freeze granted 2026-02-14.',
      lastUpdated: '2026-04-21',
      psych: {
        ocean: { o: 55, c: 92, e: 65, a: 60, n: 62 },
        vulnerabilities: ['Reputational Harm', 'Professional License Loss', 'Family Welfare'],
        biases: ['In-group Favoritism (staff)', 'Normalcy Bias', 'Authority Bias'],
        interrogation: 'Engages through a frame of moral legitimacy. Emphasize role of billing staff and systemic gaps rather than personal intent. Responds to empathy and acknowledgment of professional achievement.',
        deception: ['Deflects to billing coordinator for specific code decisions', 'Pauses 3–4 seconds before answering questions about facility-level review meetings'],
        assessedBy: 'Dr. R. Simmons, PsyD (Forensic)', assessedDate: '2026-04-01',
      },
    },
    {
      id: 'PE-003', name: 'Sarah Jenkins', type: 'Witness',
      roles: ['Cooperator', 'VP Compliance'], status: 'Active — 5K1.1',
      risk: 'Medium', dob: '1982-01-09', aliases: ['CW-1'],
      organization: 'Sterling Financial Group', title: 'VP of Compliance',
      matters: ['U.S. v. Harrell'],
      counsel: ['David Ross, Esq. (Personal)'],
      tags: ['Giglio', 'Jencks', 'Key Witness', '5K1.1'],
      notes: 'Signed cooperation agreement 2026-02-08. Has completed 3 proffer sessions providing detailed accounts of the board-level scheme. Memory distortion noted regarding her own role in compliance sign-offs. Sentencing pending cooperation.',
      lastUpdated: '2026-04-18',
      psych: {
        ocean: { o: 60, c: 88, e: 55, a: 74, n: 65 },
        vulnerabilities: ['Loyalty Conflict (to Harrell)', 'Career Reputation', 'Need for Approval', 'Minimization of Own Role'],
        biases: ['Authority Bias', 'Halo Effect (re: former CEO)', 'Selective Memory'],
        interrogation: 'Highly cooperative but demonstrates memory compression when discussing her personal culpability in compliance sign-offs. Use Cognitive Interview techniques (mental reinstatement of context) to bypass defensive rationalization. Avoid confrontational challenges early.',
        deception: ['Frequent qualifiers ("To the best of my recollection") specifically when discussing November 14th sign-off', 'Gaze aversion when asked about direct emails from Harrell'],
        assessedBy: 'Dr. K. Whitmore, PsyD', assessedDate: '2026-03-10',
      },
    },
    {
      id: 'PE-004', name: 'Hon. Katherine Matsumoto', type: 'Judge',
      roles: ['Presiding'], status: 'Active', risk: 'Low',
      dob: '1955-08-30', aliases: [],
      organization: 'U.S. District Court — E.D.N.Y.', title: 'U.S. District Judge',
      matters: ['U.S. v. Miller'],
      counsel: [],
      tags: ['EDNY', 'Textualist', 'Strict Scheduler'],
      notes: 'Appointed 2008. Yale Law. Prior career: SDNY AUSA (1985–1994), then private practice. Known for strict adherence to scheduling orders. Statistically skeptical of suppression motions (19% grant rate vs. 34% EDNY average). Leans textualist on statutory interpretation.',
      lastUpdated: '2026-01-10',
      psych: {
        ocean: { o: 42, c: 98, e: 58, a: 44, n: 18 },
        vulnerabilities: ['Procedural Irregularity (triggers strong adverse reaction)', 'Ambiguity Aversion'],
        biases: ['Anchoring on initial briefing quality', 'Status Quo Bias', 'Recency Effect (recent circuit authority)'],
        interrogation: 'Advocacy requires ironclad structural precedent. Emotional appeals consistently backfire. Frame novel arguments as logical extensions of settled law. Submit earliest possible filings. Never waive pages.',
        deception: [],
        assessedBy: 'Case Team Analysis (non-forensic)', assessedDate: '2026-01-08',
      },
    },
    {
      id: 'PE-005', name: 'Chen Wei-Long', type: 'Defendant',
      roles: ['Target', 'CEO'], status: 'Detained', risk: 'Critical',
      dob: '1972-05-18', aliases: ['David Chen'],
      organization: 'Sino-Global Logistics', title: 'Chief Executive Officer',
      matters: ['U.S. v. Wei-Long'],
      counsel: ['Michael Kirkland, Esq. (Defense)'],
      tags: ['FCPA', 'Detained', 'Foreign National', 'D.C. Circuit Appeal'],
      notes: 'FCPA bribery case involving $3.1M in payments to West African customs officials. Currently detained pending outcome of D.C. Circuit bail appeal (3-judge panel). Psychological decompensation observed post-detention. Former PLA officer (1991–1998).',
      lastUpdated: '2026-04-21',
      psych: {
        ocean: { o: 70, c: 85, e: 92, a: 32, n: 48 },
        vulnerabilities: ['Legacy Preservation', 'Familial Shame (cultural)', 'Control Deprivation (post-detention)', 'Loss of Authority'],
        biases: ['Illusion of Control', 'Optimism Bias (re: acquittal)', 'Collectivist Frame Conflict'],
        interrogation: 'Accustomed to absolute authority — detention has caused significant psychological decompensation. Leverage desire to regain narrative control. Highly responsive to face-saving frameworks and long-term legacy arguments. Requires translator for emotional nuance.',
        deception: ['Feigned misunderstanding of translation during questions about wire transfers', 'Consistent deflection to subordinate Jin Park for documentary decisions'],
        assessedBy: 'Dr. R. Simmons, PsyD (Forensic)', assessedDate: '2026-04-10',
      },
    },
    {
      id: 'PE-006', name: 'Special Agent John Carter', type: 'Agent',
      roles: ['Case Agent', 'Lead Investigator'], status: 'Active', risk: 'Low',
      dob: '1980-07-22', aliases: ['SA Carter'],
      organization: 'Federal Bureau of Investigation', title: 'Special Agent — White Collar Squad',
      matters: ['U.S. v. Harrell', 'U.S. v. Wei-Long'],
      counsel: [],
      tags: ['Law Enforcement', 'Testifying', 'FBI 302 Author'],
      notes: 'Lead case agent on the Sterling matter. Authored 34 of 41 FBI 302 interview reports. 14 years with FBI. Credible and consistent witness. Prior testimony in 6 jury trials without impeachment.',
      lastUpdated: '2026-04-15',
      psych: null,
    },
    {
      id: 'PE-007', name: 'David Ross', type: 'Attorney',
      roles: ['Opposing Counsel', 'Defense Counsel (Jenkins)'], status: 'Active', risk: 'Low',
      dob: '1960-02-14', aliases: [],
      organization: 'Ross & Partners LLP', title: 'Managing Partner',
      matters: ['U.S. v. Harrell', 'State v. Gomez'],
      counsel: [],
      tags: ['White Collar', 'Former AUSA', 'SDNY Alumni'],
      notes: 'Representing cooperating witness Jenkins. Former SDNY AUSA (1988–1996). Strong working relationships with current SDNY bench. Pragmatic negotiator — generally accepts reasonable cooperation terms. Known for protecting clients\' sentencing exposure aggressively.',
      lastUpdated: '2026-03-01',
      psych: null,
    },
  ],

  associations: [
    { source: 'PE-001', target: 'PE-003', type: 'Supervised',    detail: 'Harrell was Jenkins\' direct supervisor and approving authority for compliance sign-offs.' },
    { source: 'PE-003', target: 'PE-007', type: 'Represented By', detail: 'Ross represents Jenkins personally in the cooperation agreement.' },
    { source: 'PE-001', target: 'PE-006', type: 'Investigated By', detail: 'SA Carter is the lead case agent on the Harrell matter.' },
    { source: 'PE-002', target: 'PE-005', type: 'Co-investor',    detail: 'Both invested in a series of offshore Cayman shell companies (2019–2022).' },
  ],

  documents: [
    { id: 'D-001', personId: 'PE-003', title: 'Cooperation Agreement — Jenkins', date: '2026-02-08', type: 'Legal' },
    { id: 'D-002', personId: 'PE-003', title: 'FBI 302 — Jenkins Proffer Session 1', date: '2026-02-15', type: 'Investigative' },
    { id: 'D-003', personId: 'PE-003', title: 'FBI 302 — Jenkins Proffer Session 2', date: '2026-03-05', type: 'Investigative' },
    { id: 'D-004', personId: 'PE-001', title: 'Grand Jury Testimony — Harrell (excerpts)', date: '2025-12-10', type: 'Grand Jury' },
    { id: 'D-005', personId: 'PE-001', title: 'Psychometric Assessment — Prep Session', date: '2026-03-22', type: 'Intelligence' },
    { id: 'D-006', personId: 'PE-005', title: 'Detention Order — Wei-Long', date: '2026-03-18', type: 'Court Order' },
    { id: 'D-007', personId: 'PE-005', title: 'D.C. Circuit Brief — Bail Appeal', date: '2026-04-02', type: 'Pleading' },
  ],

  // ── CRM CONTACT-PERSPECTIVE LAYER ───────────────────────────────────────
  // Tracks each person as a firm relationship asset: pipeline stage, outreach
  // cadence, comms log, open tasks, engagement score, and account rollup.

  crmKpis: {
    openPipeline:    4,                      // active cultivation/negotiation
    mtdTouches:      42,                     // total calls/emails/meetings this month
    avgEngagement:   68,                     // 0–100
    dueFollowUps:    6,                      // overdue + due-this-week tasks
    referralsYtd:    11,
    activeAccounts:  5,
  },

  // Pipeline stages — CRM deal/relationship funnel for legal-services
  crmPipeline: [
    { key: 'new',         label: 'New',            color: '#475569' },
    { key: 'qualified',   label: 'Qualified',      color: '#4F46E5' },
    { key: 'cultivating', label: 'Cultivating',    color: '#7C3AED' },
    { key: 'proposal',    label: 'Proposal',       color: '#B45309' },
    { key: 'engaged',     label: 'Engaged',        color: '#059669' },
    { key: 'dormant',     label: 'Dormant',        color: '#94A3B8' },
  ],

  // Per-person CRM records (keyed by person id; entries can be sparse)
  crm: {
    'PE-001': { stage: 'engaged',     owner: 'M. Kirkland',  lastContact: '2026-04-18', nextTouch: '2026-04-24', cadenceDays: 14, engagement: 72, valueEstimate: 450000, source: 'Referral — Judge Matsumoto chambers', preferredChannel: 'Email', timezone: 'America/New_York' },
    'PE-002': { stage: 'engaged',     owner: 'M. Kirkland',  lastContact: '2026-04-21', nextTouch: '2026-04-25', cadenceDays: 7,  engagement: 88, valueEstimate: 820000, source: 'Direct inbound',                    preferredChannel: 'Phone', timezone: 'America/Los_Angeles' },
    'PE-003': { stage: 'cultivating', owner: 'D. Ross',      lastContact: '2026-04-16', nextTouch: '2026-04-23', cadenceDays: 7,  engagement: 54, valueEstimate: 65000,  source: 'Cooperator referral',               preferredChannel: 'Email', timezone: 'America/New_York' },
    'PE-004': { stage: 'qualified',   owner: 'M. Kirkland',  lastContact: '2026-03-30', nextTouch: '2026-05-05', cadenceDays: 30, engagement: 42, valueEstimate: 0,      source: 'Bench relationship (EDNY)',         preferredChannel: 'Chambers conference', timezone: 'America/New_York' },
    'PE-005': { stage: 'engaged',     owner: 'M. Kirkland',  lastContact: '2026-04-20', nextTouch: '2026-04-23', cadenceDays: 3,  engagement: 91, valueEstimate: 1250000, source: 'International referral — Lee & Partners', preferredChannel: 'In-person (detained)', timezone: 'America/New_York' },
    'PE-006': { stage: 'new',         owner: 'E. Bowman',    lastContact: '2026-04-05', nextTouch: '2026-05-01', cadenceDays: 30, engagement: 38, valueEstimate: 0,      source: 'Opposing agent',                    preferredChannel: 'Email', timezone: 'America/New_York' },
    'PE-007': { stage: 'dormant',     owner: 'M. Kirkland',  lastContact: '2026-01-15', nextTouch: '2026-05-15', cadenceDays: 90, engagement: 61, valueEstimate: 0,      source: 'SDNY alumni network',               preferredChannel: 'Dinner/golf', timezone: 'America/New_York' },
  },

  // Accounts — rollup of people under a shared organization
  crmAccounts: [
    { id: 'ACC-001', name: 'Sterling Financial Group',   industry: 'Financial Services', tier: 'Key',      peopleIds: ['PE-001','PE-003'], matters: 2, openArMoney: 125000, ytdBilled: 640000, owner: 'M. Kirkland', status: 'Active' },
    { id: 'ACC-002', name: 'Venkataraman Medical Group', industry: 'Healthcare',         tier: 'Strategic', peopleIds: ['PE-002'],          matters: 1, openArMoney:  80000, ytdBilled: 285000, owner: 'M. Kirkland', status: 'Active' },
    { id: 'ACC-003', name: 'Sino-Global Logistics',      industry: 'Logistics',          tier: 'Strategic', peopleIds: ['PE-005'],          matters: 1, openArMoney: 310000, ytdBilled: 910000, owner: 'M. Kirkland', status: 'Active' },
    { id: 'ACC-004', name: 'Ross & Partners LLP',        industry: 'Legal — Co-counsel',  tier: 'Referral', peopleIds: ['PE-007'],          matters: 3, openArMoney:      0, ytdBilled:      0, owner: 'M. Kirkland', status: 'Referral' },
    { id: 'ACC-005', name: 'U.S. District Court — EDNY', industry: 'Judiciary',           tier: 'Bench',    peopleIds: ['PE-004'],          matters: 4, openArMoney:      0, ytdBilled:      0, owner: 'M. Kirkland', status: 'Bench' },
  ],

  // Communication log
  crmComms: [
    { id: 'C-0001', personId: 'PE-005', channel: 'In-person', direction: 'Outbound', when: '2026-04-20 14:30', subject: 'Detention facility visit — bail appeal prep', owner: 'M. Kirkland', summary: 'Reviewed D.C. Circuit oral-argument outline. Client cleared on translation of wire-transfer evidence. Next visit scheduled 2026-04-23.', duration: '55m', sentiment: 'Neutral' },
    { id: 'C-0002', personId: 'PE-002', channel: 'Phone',     direction: 'Inbound',  when: '2026-04-21 09:05', subject: 'HHS-OIG update — voluntary compliance posture', owner: 'M. Kirkland', summary: 'Client requested status update on compliance consultant engagement letter. Pushed for pre-indictment mitigation meeting with AUSA.', duration: '32m', sentiment: 'Concerned' },
    { id: 'C-0003', personId: 'PE-001', channel: 'Email',     direction: 'Outbound', when: '2026-04-18 16:45', subject: 'Proffer session prep — draft talking points',  owner: 'M. Kirkland', summary: 'Sent proffer outline covering Q3 2024 board meetings. Requested client review by Monday COB.', duration: null, sentiment: 'Neutral' },
    { id: 'C-0004', personId: 'PE-003', channel: 'Meeting',   direction: 'Outbound', when: '2026-04-16 10:00', subject: 'Cooperation session debrief — Jenkins',         owner: 'D. Ross',      summary: 'Debriefed after third proffer session. Client processing memory conflicts re: November 14 compliance sign-off. Scheduled follow-up for this Friday.', duration: '1h 20m', sentiment: 'Stressed' },
    { id: 'C-0005', personId: 'PE-007', channel: 'Event',     direction: 'Outbound', when: '2026-01-15 19:00', subject: 'SDNY Alumni Winter Dinner',                     owner: 'M. Kirkland', summary: 'Casual check-in at annual alumni event. Discussed Giglio issues in current cooperator matter. Low follow-up pressure.', duration: '2h',     sentiment: 'Positive' },
    { id: 'C-0006', personId: 'PE-004', channel: 'Chambers',  direction: 'Outbound', when: '2026-03-30 11:00', subject: 'Chambers conference — scheduling order',        owner: 'M. Kirkland', summary: 'Routine scheduling order conference. Judge re-confirmed zero-tolerance stance on filing deadlines. No substantive rulings.', duration: '25m',   sentiment: 'Neutral' },
    { id: 'C-0007', personId: 'PE-002', channel: 'Email',     direction: 'Inbound',  when: '2026-04-15 07:32', subject: 'Media statement — pending inquiry from WSJ',    owner: 'M. Kirkland', summary: 'Forwarded WSJ reporter inquiry. Coordinated "no comment" posture with PR consultant.', duration: null, sentiment: 'Concerned' },
    { id: 'C-0008', personId: 'PE-005', channel: 'Phone',     direction: 'Inbound',  when: '2026-04-19 22:15', subject: 'Urgent — family welfare concern',               owner: 'M. Kirkland', summary: 'After-hours call from client\'s spouse re: asset-freeze hardship. Referred to forensic accountant for petition support.', duration: '40m', sentiment: 'Stressed' },
    { id: 'C-0009', personId: 'PE-001', channel: 'Meeting',   direction: 'Outbound', when: '2026-04-10 13:00', subject: 'Sentencing mitigation strategy session',        owner: 'E. Bowman',    summary: 'Reviewed character-letter plan and community-impact narrative. Client agreed to voluntary drug-screening program enrollment.', duration: '2h',   sentiment: 'Positive' },
    { id: 'C-0010', personId: 'PE-003', channel: 'Email',     direction: 'Outbound', when: '2026-04-19 08:20', subject: 'Jencks material — updated binder',              owner: 'D. Ross',      summary: 'Sent updated Jencks production index. Flagged 4 new 302s from SA Carter\'s latest supplementals.', duration: null, sentiment: 'Neutral' },
  ],

  // Follow-up tasks / reminders
  crmTasks: [
    { id: 'T-0001', personId: 'PE-005', title: 'File D.C. Circuit reply brief',         due: '2026-04-23', priority: 'Critical', owner: 'M. Kirkland', status: 'Open',        type: 'Filing'     },
    { id: 'T-0002', personId: 'PE-002', title: 'Pre-indictment mitigation meeting',      due: '2026-04-25', priority: 'High',     owner: 'M. Kirkland', status: 'Open',        type: 'Meeting'    },
    { id: 'T-0003', personId: 'PE-003', title: 'Proffer Session 4 — prep call',          due: '2026-04-24', priority: 'High',     owner: 'D. Ross',     status: 'Open',        type: 'Prep'       },
    { id: 'T-0004', personId: 'PE-001', title: 'Review sentencing mitigation packet',    due: '2026-04-22', priority: 'High',     owner: 'E. Bowman',   status: 'Overdue',     type: 'Review'     },
    { id: 'T-0005', personId: 'PE-007', title: 'SDNY alumni Q2 lunch — schedule',        due: '2026-05-15', priority: 'Low',      owner: 'M. Kirkland', status: 'Open',        type: 'Relationship' },
    { id: 'T-0006', personId: 'PE-004', title: 'Submit amended scheduling motion',        due: '2026-04-22', priority: 'Critical', owner: 'M. Kirkland', status: 'Overdue',     type: 'Filing'     },
    { id: 'T-0007', personId: 'PE-005', title: 'Facility visit — post-argument debrief',  due: '2026-04-28', priority: 'High',     owner: 'M. Kirkland', status: 'Open',        type: 'Meeting'    },
    { id: 'T-0008', personId: 'PE-002', title: 'Confirm engagement-letter addendum',      due: '2026-04-30', priority: 'Medium',   owner: 'M. Kirkland', status: 'Open',        type: 'Admin'      },
    { id: 'T-0009', personId: 'PE-006', title: 'Giglio disclosure letter review',         due: '2026-05-01', priority: 'Medium',   owner: 'E. Bowman',   status: 'Open',        type: 'Review'     },
    { id: 'T-0010', personId: 'PE-003', title: 'Send updated Jencks index to AUSA',       due: '2026-04-20', priority: 'High',     owner: 'D. Ross',     status: 'Completed',   type: 'Filing'     },
  ],
};

window.PERSONA_DATA = PERSONA_DATA;
