// EVIDENCE MANAGEMENT PLATFORM — Master Data Layer
const T = window.ArbiterTokens;

const EVIDENCE_DATA = {
  'M-2024-0312': {
    // ── VAULT: All evidence items ──
    vault: [
      { id: 'EV-0001', bates: 'RS-000001', name: 'Master Services Agreement', type: 'Contract', category: 'Transactional', custodian: 'Redstone Capital', dateCollected: '2026-01-08', dateCreated: '2021-03-15', size: '1.2 MB', ext: 'PDF', pages: 34, status: 'Authenticated', privilege: 'None', relevance: 95, aiTags: ['breach', 'MSA', 'Section 4.2', 'related-party'], hotDoc: true, reviewStatus: 'Coded', reviewer: 'L. Torres', exhibitNum: 'PX-001', chainOfCustody: [{date:'Jan 8',action:'Collected from client',by:'L. Torres'},{date:'Jan 10',action:'Uploaded to Relativity',by:'J. Park'},{date:'Jan 15',action:'Authenticated by custodian',by:'M. Kirkland'}] },
      { id: 'EV-0002', bates: 'MH-000001:MH-000023', name: 'Wire Transfer Records — Apex Ventures', type: 'Financial', category: 'Banking', custodian: 'Meridian Holdings (Produced)', dateCollected: '2026-04-12', dateCreated: '2022-06-01:2024-09-15', size: '8.4 MB', ext: 'PDF', pages: 23, status: 'Authenticated', privilege: 'None', relevance: 98, aiTags: ['wire transfer', 'Apex Ventures', '$14.2M', 'shell entity', 'fraud'], hotDoc: true, reviewStatus: 'Coded', reviewer: 'J. Park', exhibitNum: 'PX-002', chainOfCustody: [{date:'Apr 12',action:'Received in production',by:'J. Park'},{date:'Apr 13',action:'Processed and OCR\'d',by:'System'},{date:'Apr 14',action:'Coded — Hot Document',by:'J. Park'}] },
      { id: 'EV-0003', bates: 'MH-004001:MH-004003', name: 'Apex Ventures LLC — Incorporation Documents', type: 'Corporate', category: 'Entity Records', custodian: 'Delaware SOS (Subpoenaed)', dateCollected: '2026-02-20', dateCreated: '2022-05-26', size: '340 KB', ext: 'PDF', pages: 3, status: 'Authenticated', privilege: 'None', relevance: 92, aiTags: ['Apex Ventures', 'Harrington sole director', 'incorporation', 'shell entity'], hotDoc: true, reviewStatus: 'Coded', reviewer: 'J. Park', exhibitNum: 'PX-003', chainOfCustody: [{date:'Feb 20',action:'Received via subpoena',by:'L. Torres'},{date:'Feb 21',action:'Uploaded + authenticated',by:'J. Park'}] },
      { id: 'EV-0004', bates: 'MH-012440:MH-012467', name: 'CEO Internal Email Chain — Revenue Shortfall', type: 'Communications', category: 'Email', custodian: 'Meridian Holdings (Produced)', dateCollected: '2026-04-12', dateCreated: '2023-09-15:2023-09-28', size: '2.1 MB', ext: 'MSG', pages: 28, status: 'Produced', privilege: 'None', relevance: 90, aiTags: ['revenue shortfall', 'Q3 2023', 'scienter', 'CEO knowledge', 'fraud'], hotDoc: true, reviewStatus: 'Coded', reviewer: 'L. Torres', exhibitNum: 'PX-004', chainOfCustody: [{date:'Apr 12',action:'Received in production',by:'J. Park'},{date:'Apr 13',action:'Processed',by:'System'},{date:'Apr 15',action:'Coded — Key Evidence for Fraud Claim',by:'L. Torres'}] },
      { id: 'EV-0005', bates: 'MH-008200:MH-008204', name: 'Board Minutes — October 2023 Meeting', type: 'Corporate', category: 'Board Records', custodian: 'Meridian Holdings (Produced)', dateCollected: '2026-03-01', dateCreated: '2023-10-18', size: '980 KB', ext: 'PDF', pages: 5, status: 'Authenticated', privilege: 'None', relevance: 85, aiTags: ['board meeting', 'revenue projection', '$48M', 'no Apex disclosure', 'misrepresentation'], hotDoc: true, reviewStatus: 'Coded', reviewer: 'M. Kirkland', exhibitNum: 'PX-005', chainOfCustody: [{date:'Mar 1',action:'Received in production',by:'J. Park'},{date:'Mar 3',action:'Coded',by:'M. Kirkland'}] },
      { id: 'EV-0006', bates: 'RS-000100:RS-000142', name: 'Harrington Deposition Transcript', type: 'Testimony', category: 'Deposition', custodian: 'Court Reporter', dateCollected: '2026-04-15', dateCreated: '2026-04-15', size: '847 KB', ext: 'PDF', pages: 142, status: 'Certified', privilege: 'None', relevance: 88, aiTags: ['Harrington', 'deposition', 'admissions pp.87-92', 'Apex denial', 'evasive'], hotDoc: true, reviewStatus: 'Coded', reviewer: 'M. Kirkland', exhibitNum: 'PX-006', chainOfCustody: [{date:'Apr 15',action:'Received from court reporter',by:'L. Torres'},{date:'Apr 15',action:'Uploaded + indexed',by:'System'},{date:'Apr 16',action:'Key passages flagged',by:'M. Kirkland'}] },
      { id: 'EV-0007', bates: 'EXP-001', name: 'Expert Report — Dr. Sarah Mitchell', type: 'Expert', category: 'Expert Report', custodian: 'Dr. S. Mitchell', dateCollected: '2026-04-02', dateCreated: '2026-03-28', size: '5.1 MB', ext: 'PDF', pages: 67, status: 'Disclosed', privilege: 'Work Product (Waived by Disclosure)', relevance: 88, aiTags: ['damages', '$14.2M-$18.7M', 'lost profits', 'economic analysis'], hotDoc: true, reviewStatus: 'Coded', reviewer: 'M. Kirkland', exhibitNum: 'PX-007', chainOfCustody: [{date:'Apr 2',action:'Received from expert',by:'M. Kirkland'},{date:'Apr 2',action:'Uploaded',by:'J. Park'},{date:'Apr 3',action:'Disclosed to opposing counsel',by:'L. Torres'}] },
      { id: 'EV-0008', bates: 'MH-020001:MH-023200', name: 'Financial Records 2020–2024 (Production Set)', type: 'Financial', category: 'Accounting', custodian: 'Meridian Holdings (Produced)', dateCollected: '2026-04-12', dateCreated: '2020-01:2024-12', size: '142 MB', ext: 'ZIP', pages: 3200, status: 'Under Review', privilege: 'None', relevance: 75, aiTags: ['financial records', 'revenue', 'expenses', 'gaps in Q3 2022'], hotDoc: false, reviewStatus: 'In Progress', reviewer: 'J. Park', exhibitNum: null, chainOfCustody: [{date:'Apr 12',action:'Received in production',by:'J. Park'},{date:'Apr 12',action:'Uploaded to Relativity — processing',by:'System'},{date:'Apr 14',action:'Review commenced — 1,847 of 3,200 reviewed',by:'J. Park'}] },
      { id: 'EV-0009', bates: 'RS-000200', name: 'Amended Complaint', type: 'Pleading', category: 'Court Filing', custodian: 'Court Docket', dateCollected: '2026-03-15', dateCreated: '2026-03-15', size: '1.1 MB', ext: 'PDF', pages: 28, status: 'Filed', privilege: 'None', relevance: 70, aiTags: ['complaint', 'breach', 'fraud', 'fiduciary duty', 'Count IV'], hotDoc: false, reviewStatus: 'Coded', reviewer: 'M. Kirkland', exhibitNum: null, chainOfCustody: [{date:'Mar 15',action:'Filed with court',by:'M. Kirkland'},{date:'Mar 15',action:'Uploaded',by:'L. Torres'}] },
      { id: 'EV-0010', bates: 'MH-030001:MH-030012', name: 'Defendant Answer & Counterclaims', type: 'Pleading', category: 'Court Filing', custodian: 'Court Docket', dateCollected: '2026-02-28', dateCreated: '2026-02-28', size: '980 KB', ext: 'PDF', pages: 12, status: 'Filed', privilege: 'None', relevance: 65, aiTags: ['answer', 'counterclaim', 'business judgment', 'defense'], hotDoc: false, reviewStatus: 'Coded', reviewer: 'L. Torres', exhibitNum: null, chainOfCustody: [{date:'Feb 28',action:'Received from defense',by:'L. Torres'},{date:'Mar 1',action:'Uploaded + coded',by:'L. Torres'}] },
      { id: 'EV-0011', bates: 'MH-040001:MH-040089', name: 'Privilege Log — Defense', type: 'Log', category: 'Discovery', custodian: 'Caldwell & Strauss', dateCollected: '2026-04-16', dateCreated: '2026-04-16', size: '420 KB', ext: 'XLSX', pages: 89, status: 'Under Challenge', privilege: 'Claimed by Defense', relevance: 72, aiTags: ['privilege', '23 withheld', '8 work product', 'challenge pending'], hotDoc: false, reviewStatus: 'In Progress', reviewer: 'J. Park', exhibitNum: null, chainOfCustody: [{date:'Apr 16',action:'Received from defense',by:'J. Park'},{date:'Apr 17',action:'Analysis commenced',by:'J. Park'}] },
      { id: 'EV-0012', bates: 'RS-000300', name: 'Motion to Compel — Order Granting', type: 'Order', category: 'Court Filing', custodian: 'Court Docket', dateCollected: '2026-04-10', dateCreated: '2026-04-10', size: '340 KB', ext: 'PDF', pages: 8, status: 'Filed', privilege: 'None', relevance: 60, aiTags: ['motion to compel', 'granted', 'financial records', 'Judge Reynolds'], hotDoc: false, reviewStatus: 'Coded', reviewer: 'M. Kirkland', exhibitNum: null, chainOfCustody: [{date:'Apr 10',action:'Entered by court',by:'Judge Reynolds'},{date:'Apr 10',action:'Uploaded',by:'L. Torres'}] },
      { id: 'EV-0013', bates: 'RS-000400', name: 'Corporate Charter — Meridian Holdings', type: 'Corporate', category: 'Entity Records', custodian: 'Meridian Holdings (Produced)', dateCollected: '2026-02-15', dateCreated: '2018-06-20', size: '890 KB', ext: 'PDF', pages: 18, status: 'Authenticated', privilege: 'None', relevance: 68, aiTags: ['charter', 'exculpation clause', 'fiduciary', 'does not cover loyalty'], hotDoc: false, reviewStatus: 'Coded', reviewer: 'J. Park', exhibitNum: 'PX-008', chainOfCustody: [{date:'Feb 15',action:'Received in initial production',by:'J. Park'},{date:'Feb 16',action:'Coded',by:'J. Park'}] },
      { id: 'EV-0014', bates: 'RS-000500:RS-000508', name: 'Interrogatory Responses — Set 2', type: 'Discovery', category: 'Discovery Response', custodian: 'Plaintiff Work Product', dateCollected: '2026-04-18', dateCreated: '2026-04-18', size: '1.8 MB', ext: 'DOCX', pages: 8, status: 'Filed', privilege: 'None', relevance: 55, aiTags: ['interrogatory', 'responses', 'insider transactions'], hotDoc: false, reviewStatus: 'Coded', reviewer: 'L. Torres', exhibitNum: null, chainOfCustody: [{date:'Apr 18',action:'Filed',by:'L. Torres'}] },
      { id: 'EV-0015', bates: 'EXP-002', name: 'Expert CV — Dr. Sarah Mitchell', type: 'Expert', category: 'Expert Materials', custodian: 'Dr. S. Mitchell', dateCollected: '2026-03-28', dateCreated: '2026-01-01', size: '120 KB', ext: 'PDF', pages: 4, status: 'Disclosed', privilege: 'None', relevance: 45, aiTags: ['expert CV', 'qualifications', 'Daubert'], hotDoc: false, reviewStatus: 'Coded', reviewer: 'L. Torres', exhibitNum: null, chainOfCustody: [{date:'Mar 28',action:'Received from expert',by:'L. Torres'}] },
    ],

    // ── PRODUCTION SETS ──
    productions: [
      { id: 'PROD-001', name: 'Initial Plaintiff Production', direction: 'Sent', date: '2026-02-01', batesRange: 'RS-000001 to RS-000089', docs: 89, pages: 412, size: '48 MB', status: 'Complete', recipient: 'Caldwell & Strauss' },
      { id: 'PROD-002', name: 'Defendant Initial Production', direction: 'Received', date: '2026-03-01', batesRange: 'MH-000001 to MH-010000', docs: 2400, pages: 8200, size: '320 MB', status: 'Complete', recipient: null },
      { id: 'PROD-003', name: 'Defendant Supplemental — Financial Records', direction: 'Received', date: '2026-04-12', batesRange: 'MH-020001 to MH-023200', docs: 3200, pages: 12400, size: '142 MB', status: 'Under Review', recipient: null },
      { id: 'PROD-004', name: 'Expert Disclosure — Mitchell Report', direction: 'Sent', date: '2026-04-03', batesRange: 'EXP-001 to EXP-002', docs: 2, pages: 71, size: '5.2 MB', status: 'Complete', recipient: 'Caldwell & Strauss' },
      { id: 'PROD-005', name: 'Defendant Privilege Log', direction: 'Received', date: '2026-04-16', batesRange: 'MH-040001 to MH-040089', docs: 89, pages: 89, size: '420 KB', status: 'Under Challenge', recipient: null },
    ],

    // ── REVIEW PIPELINE ──
    reviewPipeline: {
      total: 5780,
      stages: [
        { name: 'Pending First Pass', count: 1353, color: '#6E7D9E' },
        { name: 'First Pass Complete', count: 2894, color: '#3B82F6' },
        { name: 'Second Pass / QC', count: 847, color: '#F59E0B' },
        { name: 'Privilege Review', count: 312, color: '#A855F7' },
        { name: 'Final Coded', count: 374, color: '#22C55E' },
      ],
      reviewers: [
        { name: 'J. Park', assigned: 2100, completed: 1847, rate: 42, hoursLogged: 44 },
        { name: 'L. Torres', assigned: 1800, completed: 1620, rate: 38, hoursLogged: 43 },
        { name: 'M. Kirkland', assigned: 480, completed: 480, rate: 15, hoursLogged: 32 },
        { name: 'Contract Reviewer 1', assigned: 800, completed: 533, rate: 35, hoursLogged: 15 },
        { name: 'Contract Reviewer 2', assigned: 600, completed: 412, rate: 30, hoursLogged: 14 },
      ],
      codingDecisions: { responsive: 2341, nonResponsive: 1892, privileged: 312, needsRedaction: 148, hotDoc: 47, duplicate: 687 },
      aiAssist: { autoTagged: 4200, suggestedPrivilege: 89, suggestedHot: 62, contradictionsFound: 8, duplicatesDetected: 687 },
    },

    // ── EXHIBITS ──
    exhibits: [
      { num: 'PX-001', evId: 'EV-0001', name: 'Master Services Agreement', status: 'Pre-Marked', objection: false, admitted: false },
      { num: 'PX-002', evId: 'EV-0002', name: 'Wire Transfer Records — Apex Ventures', status: 'Pre-Marked', objection: false, admitted: false },
      { num: 'PX-003', evId: 'EV-0003', name: 'Apex Ventures Incorporation Docs', status: 'Pre-Marked', objection: false, admitted: false },
      { num: 'PX-004', evId: 'EV-0004', name: 'CEO Email Chain — Revenue Shortfall', status: 'Pre-Marked', objection: true, admitted: false },
      { num: 'PX-005', evId: 'EV-0005', name: 'Board Minutes — Oct 2023', status: 'Pre-Marked', objection: false, admitted: false },
      { num: 'PX-006', evId: 'EV-0006', name: 'Harrington Deposition Transcript', status: 'Pre-Marked', objection: false, admitted: false },
      { num: 'PX-007', evId: 'EV-0007', name: 'Expert Report — Dr. Mitchell', status: 'Pre-Marked', objection: true, admitted: false },
      { num: 'PX-008', evId: 'EV-0013', name: 'Corporate Charter — Meridian', status: 'Pre-Marked', objection: false, admitted: false },
    ],

    // ── TRANSCRIPT INDEX ──
    transcripts: [
      {
        id: 'TR-001', witness: 'James Harrington', role: 'Meridian CEO', date: '2026-04-15',
        duration: '4h 23m', pages: 142, status: 'Certified',
        keyExcerpts: [
          { page: 87, line: '14-22', topic: 'Apex Ventures involvement', flag: 'critical', text: 'Denied involvement in Apex creation — contradicted by incorporation docs.' },
          { page: 91, line: '3-8', topic: 'Related-party disclosure', flag: 'critical', text: 'Claimed all transactions disclosed — board minutes show otherwise.' },
          { page: 112, line: '18-24', topic: 'Revenue projections', flag: 'high', text: 'Claimed no personal input on Q3 projections — email chain contradicts.' },
          { page: 134, line: '6-11', topic: 'Revenue shortfall knowledge', flag: 'high', text: 'Claims no recollection of when learned — CFO email proves Sept 15.' },
          { page: 156, line: '1-9', topic: 'Apex payments purpose', flag: 'critical', text: 'Described as "consulting payments" — no consulting agreement exists.' },
          { page: 42, line: '10-18', topic: 'Board governance', flag: 'medium', text: 'Described routine board approval process — undermines his own defense.' },
          { page: 67, line: '3-14', topic: 'Redstone relationship', flag: 'medium', text: 'Acknowledged fiduciary obligations to Redstone as board member.' },
        ],
        topics: ['Apex Ventures', 'Revenue projections', 'Board governance', 'Fiduciary duties', 'Financial records', 'Related-party transactions'],
      },
    ],

    // ── ENTITY RELATIONSHIP DATA ──
    entityGraph: {
      entities: [
        { id: 'E1', name: 'Redstone Capital', type: 'Plaintiff', group: 'party' },
        { id: 'E2', name: 'Meridian Holdings', type: 'Defendant', group: 'party' },
        { id: 'E3', name: 'Apex Ventures LLC', type: 'Shell Entity', group: 'entity' },
        { id: 'E4', name: 'James Harrington', type: 'CEO / Director', group: 'person' },
        { id: 'E5', name: 'David Redstone', type: 'Plaintiff CEO', group: 'person' },
        { id: 'E6', name: 'Karen Osei', type: 'Former CFO', group: 'person' },
        { id: 'E7', name: 'Dr. Sarah Mitchell', type: 'Expert Witness', group: 'person' },
        { id: 'E8', name: 'Robert Chen', type: 'Meridian GC', group: 'person' },
        { id: 'E9', name: 'MSA (§4.2)', type: 'Key Contract', group: 'document' },
        { id: 'E10', name: '$14.2M Transfers', type: 'Financial Flow', group: 'event' },
        { id: 'E11', name: 'Oct 2023 Board Meeting', type: 'Key Event', group: 'event' },
        { id: 'E12', name: 'Q3 Revenue Shortfall', type: 'Key Fact', group: 'event' },
      ],
      connections: [
        { from: 'E4', to: 'E2', label: 'CEO of', weight: 3 },
        { from: 'E4', to: 'E3', label: 'Sole director', weight: 3 },
        { from: 'E2', to: 'E3', label: 'Transferred $14.2M to', weight: 3 },
        { from: 'E1', to: 'E2', label: 'Invested in via MSA', weight: 2 },
        { from: 'E5', to: 'E1', label: 'CEO of', weight: 2 },
        { from: 'E6', to: 'E2', label: 'Former CFO', weight: 2 },
        { from: 'E8', to: 'E2', label: 'General Counsel', weight: 1 },
        { from: 'E4', to: 'E11', label: 'Presented projections at', weight: 2 },
        { from: 'E4', to: 'E12', label: 'Knew about (email proof)', weight: 3 },
        { from: 'E10', to: 'E3', label: 'Funds sent to', weight: 3 },
        { from: 'E10', to: 'E2', label: 'Funds originated from', weight: 2 },
        { from: 'E9', to: 'E1', label: 'Governs relationship', weight: 2 },
        { from: 'E9', to: 'E2', label: 'Governs relationship', weight: 2 },
        { from: 'E7', to: 'E10', label: 'Quantified damages', weight: 1 },
        { from: 'E6', to: 'E12', label: 'Reported shortfall', weight: 2 },
      ],
    },
  },
};

window.EVIDENCE_DATA = EVIDENCE_DATA;
