const { useState } = React;
const T = window.ArbiterTokens;

// --- MOCK DATA ---
const MATTERS = [
  { id: 'M-2024-0312', name: 'Redstone Capital v. Meridian Holdings', client: 'Redstone Capital', type: 'Commercial Litigation', status: 'Discovery', priority: 'high', lead: 'M. Kirkland', team: 3, dueDate: '2026-05-14', billed: 842000, budget: 1200000, docs: 1247, lastActivity: '2h ago' },
  { id: 'M-2024-0298', name: 'In re: Pacific Shipping Antitrust', client: 'Pacific Shipping Co.', type: 'Antitrust', status: 'Active', priority: 'high', lead: 'S. Chen', team: 5, dueDate: '2026-06-30', billed: 2100000, budget: 3500000, docs: 4521, lastActivity: '45m ago' },
  { id: 'M-2024-0284', name: 'Thornton Estate Probate Contest', client: 'Thornton Family Trust', type: 'Probate Litigation', status: 'Trial Prep', priority: 'high', lead: 'R. Vasquez', team: 2, dueDate: '2026-05-02', billed: 395000, budget: 500000, docs: 632, lastActivity: '1h ago' },
  { id: 'M-2024-0271', name: 'Blackwell IP Infringement', client: 'Blackwell Technologies', type: 'Patent', status: 'Discovery', priority: 'medium', lead: 'M. Kirkland', team: 4, dueDate: '2026-07-15', billed: 567000, budget: 900000, docs: 2103, lastActivity: '3h ago' },
  { id: 'M-2024-0265', name: 'Chen v. Atlas Financial Group', client: 'D. Chen', type: 'Securities Fraud', status: 'Settlement', priority: 'medium', lead: 'A. Petrov', team: 2, dueDate: '2026-05-30', billed: 1450000, budget: 1600000, docs: 3201, lastActivity: '5h ago' },
  { id: 'M-2024-0259', name: 'Sterling Pharma FCPA Investigation', client: 'Sterling Pharma', type: 'White Collar', status: 'Active', priority: 'high', lead: 'S. Chen', team: 6, dueDate: '2026-08-15', billed: 890000, budget: 2000000, docs: 5632, lastActivity: '20m ago' },
  { id: 'M-2024-0243', name: 'Harbor District Eminent Domain', client: 'Harbor Tenants Assoc.', type: 'Real Property', status: 'Appeal', priority: 'medium', lead: 'R. Vasquez', team: 2, dueDate: '2026-09-01', billed: 234000, budget: 400000, docs: 412, lastActivity: '1d ago' },
  { id: 'M-2024-0230', name: 'NovaTech Merger Review', client: 'NovaTech Inc.', type: 'M&A Litigation', status: 'Active', priority: 'low', lead: 'A. Petrov', team: 3, dueDate: '2026-10-01', billed: 178000, budget: 600000, docs: 298, lastActivity: '6h ago' },
  { id: 'M-2024-0218', name: 'Greenfield Environmental Class Action', client: 'Greenfield Residents', type: 'Environmental', status: 'Discovery', priority: 'high', lead: 'M. Kirkland', team: 7, dueDate: '2026-12-15', billed: 1340000, budget: 4000000, docs: 8921, lastActivity: '30m ago' },
  { id: 'M-2024-0201', name: 'Marshall Employment Dispute', client: 'T. Marshall', type: 'Employment', status: 'Settlement', priority: 'low', lead: 'R. Vasquez', team: 1, dueDate: '2026-05-10', billed: 87000, budget: 120000, docs: 156, lastActivity: '2d ago' },
  // ── Criminal Defense portfolio ──
  { id: 'M-2025-0384', name: 'United States v. Harrell', client: 'Marcus Harrell Jr.', type: 'Criminal Defense — Wire Fraud', status: 'Plea Negotiations', priority: 'high', lead: 'M. Kirkland', team: 4, dueDate: '2026-06-17', billed: 684000, budget: 1200000, docs: 2841, lastActivity: '35m ago' },
  { id: 'M-2025-0218', name: 'United States v. Venkataraman et al.', client: 'Venkataraman Health Svcs', type: 'Criminal Defense — Health Care Fraud', status: 'Pretrial', priority: 'high', lead: 'L. Torres', team: 5, dueDate: '2026-06-10', billed: 512000, budget: 950000, docs: 1892, lastActivity: '2h ago' },
  { id: 'M-2026-0042', name: 'United States v. Chen', client: 'Sterling Pharma (Chen Wei-Long)', type: 'Criminal Defense — FCPA', status: 'Pretrial — Detained', priority: 'high', lead: 'M. Kirkland', team: 6, dueDate: '2026-07-08', billed: 428000, budget: 1800000, docs: 3201, lastActivity: '1h ago' },
  { id: 'M-2025-0721', name: 'United States v. Barnwell et al.', client: 'Olivia Barnwell', type: 'Criminal Defense — Securities Fraud', status: 'Sentencing', priority: 'high', lead: 'L. Torres', team: 3, dueDate: '2026-06-04', billed: 724000, budget: 900000, docs: 1623, lastActivity: '3h ago' },
  { id: 'M-2025-0302', name: 'United States v. Miller', client: 'Deshawn Miller (CJA)', type: 'Criminal Defense — Narcotics + § 924(c)', status: 'Pretrial — Franks', priority: 'high', lead: 'J. Park', team: 2, dueDate: '2026-05-30', billed: 184000, budget: 350000, docs: 482, lastActivity: '20m ago' },
];

const DEADLINES = [
  { date: 'Apr 21', label: 'Discovery response — Set 3', matter: 'Redstone v. Meridian', urgent: true },
  { date: 'Apr 23', label: 'Expert report due', matter: 'Thornton Estate', urgent: true },
  { date: 'Apr 25', label: 'Deposition — J. Harmon', matter: 'Pacific Shipping', urgent: false },
  { date: 'Apr 28', label: 'Motion to compel response', matter: 'Blackwell IP', urgent: false },
  { date: 'May 02', label: 'Trial date', matter: 'Thornton Estate', urgent: true },
  { date: 'May 05', label: 'Mediation session', matter: 'Chen v. Atlas', urgent: false },
  { date: 'May 10', label: 'Settlement conference', matter: 'Marshall Employment', urgent: false },
  { date: 'May 14', label: 'Opposition to MSJ deadline', matter: 'Redstone v. Meridian', urgent: true },
];

const RECENT_ACTIVITY = [
  { time: '20m', action: 'Document uploaded', detail: 'Financial audit report Q3 2025', matter: 'Sterling Pharma', user: 'S. Chen' },
  { time: '45m', action: 'Brief filed', detail: 'Opposition to MSJ', matter: 'Pacific Shipping', user: 'L. Torres' },
  { time: '1h', action: 'Deposition scheduled', detail: 'Witness: R. Thornton Jr.', matter: 'Thornton Estate', user: 'R. Vasquez' },
  { time: '2h', action: 'Status changed', detail: 'Moved to Discovery phase', matter: 'Redstone v. Meridian', user: 'M. Kirkland' },
  { time: '3h', action: 'Research memo', detail: 'Patent prior art analysis', matter: 'Blackwell IP', user: 'J. Park' },
  { time: '5h', action: 'Settlement offer received', detail: '$4.2M proposed', matter: 'Chen v. Atlas', user: 'A. Petrov' },
];

window.MATTERS = MATTERS;
window.DEADLINES = DEADLINES;
window.RECENT_ACTIVITY = RECENT_ACTIVITY;
