// FOLIO — Tier-1 PDF lifecycle platform (Adobe-competing).
// Where Studio composition meets Document Management lifecycle:
// authoring → annotation → redaction → Bates → signature → production → archive.
//
// Brand: deep indigo. Loaded BEFORE FolioPlatform.jsx.

const FOLIO_DATA = (() => {

  // ── Active document: what's loaded in the Workbench ──────────────────────
  const activeDoc = {
    id: 'F-DOC-001',
    name: 'Opposition to MSJ — Draft v3.pdf',
    matter: 'Redstone v. Meridian',
    matterId: 'M-2024-0312',
    author: 'M. Kirkland',
    coAuthors: ['L. Torres', 'J. Park'],
    pages: 28,
    size: '3.4 MB',
    sizeBytes: 3563520,
    ext: 'PDF',
    status: 'In Review',
    privilege: 'work-product',
    confidentiality: 'AEO',
    locked: true,
    lockedBy: 'M. Kirkland',
    lockExpires: '2026-04-22T17:00:00Z',
    created: '2026-04-08T09:14:00Z',
    modified: '2026-04-19T16:42:00Z',
    fingerprint: 'sha256:9b4e7c1a3d8f6e2b5a0c9d8e7f6a5b4c3d2e1f0a',
    versions: [
      { v: 3, label: 'Draft v3 — partner pass',  author: 'M. Kirkland', at: '2026-04-19T16:42:00Z', size: '3.4 MB', diff: '+12 / −4 / ~7' },
      { v: 2, label: 'Draft v2 — peer review',   author: 'L. Torres',   at: '2026-04-15T11:08:00Z', size: '3.2 MB', diff: '+38 / −6 / ~14' },
      { v: 1, label: 'Draft v1 — initial',       author: 'M. Kirkland', at: '2026-04-08T09:14:00Z', size: '2.8 MB', diff: 'baseline' },
    ],
  };

  // ── Page list (thumbnails) ───────────────────────────────────────────────
  const pages = Array.from({ length: 28 }, (_, i) => {
    const n = i + 1;
    const types = ['caption', 'toc', 'body', 'body', 'body', 'cite', 'body', 'body', 'exhibit', 'cert'];
    const t = i < 1 ? 'caption' : i < 2 ? 'toc' : i === 5 ? 'cite' : i === 26 ? 'cert' : i >= 22 ? 'exhibit' : 'body';
    return {
      n, type: t,
      annotations: i === 8 ? 3 : i === 14 ? 2 : i === 19 ? 5 : i === 21 ? 1 : 0,
      redactions: i === 16 ? 2 : i === 20 ? 4 : 0,
      hasIssue: i === 11 || i === 17,
      heading: t === 'caption' ? 'Caption page'
        : t === 'toc' ? 'Table of contents'
        : t === 'cite' ? 'Authorities §'
        : t === 'exhibit' ? `Exhibit ${i - 21}`
        : t === 'cert' ? 'Certificate of service'
        : `Argument §${(i - 1)}`,
    };
  });

  // ── Annotation tools (palette) ───────────────────────────────────────────
  const annotationTools = [
    { id: 'select',    label: 'Select',     icon: '↗',  hint: 'V' },
    { id: 'text',      label: 'Text edit',  icon: 'T',  hint: 'E' },
    { id: 'highlight', label: 'Highlight',  icon: '▬',  color: '#FFD60A', hint: 'H' },
    { id: 'underline', label: 'Underline',  icon: '⌐',  color: '#0EA5E9', hint: 'U' },
    { id: 'strike',    label: 'Strikethrough', icon: '⌐̶', color: '#C23030', hint: 'S' },
    { id: 'comment',   label: 'Comment',    icon: '◍',  hint: 'C' },
    { id: 'sticky',    label: 'Sticky note', icon: '◾', hint: 'N' },
    { id: 'stamp',     label: 'Stamp',      icon: '◆',  hint: 'M' },
    { id: 'pen',       label: 'Free pen',   icon: '✎',  hint: 'P' },
    { id: 'shape',     label: 'Shape',      icon: '▢',  hint: 'R' },
    { id: 'redact',    label: 'Redact',     icon: '▮',  color: '#000000', danger: true, hint: 'X' },
  ];

  // ── Comment thread ───────────────────────────────────────────────────────
  const comments = [
    { id: 'C-1', page: 9, author: 'M. Kirkland', at: '2026-04-19T15:12:00Z', resolved: false,
      text: 'Strengthen the third element here — defense will hammer this. Add the McCarthy reasoning.',
      replies: [
        { author: 'L. Torres', at: '2026-04-19T15:48:00Z', text: 'Drafted insertion. See p.10 ¶2.' },
      ] },
    { id: 'C-2', page: 9, author: 'L. Torres', at: '2026-04-19T15:51:00Z', resolved: false,
      text: 'Pin cite missing on Hawthorne v. Aurora. Will fix.', replies: [] },
    { id: 'C-3', page: 14, author: 'J. Park', at: '2026-04-18T10:33:00Z', resolved: true,
      text: 'Discovery cite outdated — replace with the May ruling.',
      replies: [{ author: 'M. Kirkland', at: '2026-04-18T11:02:00Z', text: 'Done.' }] },
    { id: 'C-4', page: 19, author: 'M. Kirkland', at: '2026-04-19T16:18:00Z', resolved: false,
      text: 'Move this paragraph above the damages section.', replies: [] },
    { id: 'C-5', page: 19, author: 'L. Torres', at: '2026-04-19T16:30:00Z', resolved: false,
      text: 'Agree. Also tighten 19¶3 — too discursive.', replies: [] },
    { id: 'C-6', page: 21, author: 'J. Park', at: '2026-04-19T09:14:00Z', resolved: false,
      text: 'Exhibit reference broken — should be Ex. 4 not Ex. 6.', replies: [] },
  ];

  // ── Redaction pattern library ────────────────────────────────────────────
  const redactionPatterns = [
    { id: 'PAT-SSN',    label: 'SSN',                       regex: '\\b\\d{3}-\\d{2}-\\d{4}\\b',                hits: 4,  category: 'PII', built: true },
    { id: 'PAT-PHONE',  label: 'Phone (US)',                regex: '\\(?\\d{3}\\)?[\\s.-]?\\d{3}[\\s.-]?\\d{4}', hits: 12, category: 'PII', built: true },
    { id: 'PAT-EMAIL',  label: 'Email address',             regex: '\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b', hits: 18, category: 'PII', built: true },
    { id: 'PAT-CC',     label: 'Credit card',               regex: '\\b(?:\\d[ -]*?){13,16}\\b',                hits: 0,  category: 'PII', built: true },
    { id: 'PAT-DOB',    label: 'Date of birth',             regex: '\\b(0[1-9]|1[0-2])/(0[1-9]|[12]\\d|3[01])/(19|20)\\d{2}\\b', hits: 2, category: 'PII', built: true },
    { id: 'PAT-ACCT',   label: 'Account numbers',           regex: '\\bAcct\\.?\\s?#?\\s?\\d{4,}\\b',           hits: 6,  category: 'Financial', built: true },
    { id: 'PAT-ADDR',   label: 'Street address',            regex: '\\d+\\s+[A-Z][a-z]+\\s+(St|Ave|Rd|Blvd|Ln|Dr)\\b', hits: 5, category: 'PII', built: true },
    { id: 'PAT-MED',    label: 'Medical record #',          regex: '\\bMRN[:\\s]?\\d+\\b',                       hits: 3,  category: 'HIPAA', built: true },
    { id: 'PAT-NAME',   label: 'Custodian names (custom)',  regex: '\\b(Davis|Osei|Reyes|Whitman)\\b',           hits: 27, category: 'Custom', built: false },
    { id: 'PAT-PRIV',   label: 'Privileged communication',  regex: 'Subject to ACP|attorney-client|work product', hits: 9,  category: 'Privilege', built: false },
    { id: 'PAT-NDA',    label: 'NDA terms',                 regex: 'CONFIDENTIAL|TRADE SECRET',                  hits: 14, category: 'Custom', built: false },
  ];

  // ── Form field catalog ───────────────────────────────────────────────────
  const formFieldTypes = [
    { id: 'text',      label: 'Text field',     w: 180, h: 28, kind: 'input' },
    { id: 'multitext', label: 'Multi-line',     w: 240, h: 80, kind: 'input' },
    { id: 'date',      label: 'Date',           w: 120, h: 28, kind: 'input' },
    { id: 'currency',  label: 'Currency',       w: 120, h: 28, kind: 'input' },
    { id: 'number',    label: 'Number',         w: 100, h: 28, kind: 'input' },
    { id: 'check',     label: 'Checkbox',       w: 18,  h: 18, kind: 'choice' },
    { id: 'radio',     label: 'Radio group',    w: 18,  h: 18, kind: 'choice' },
    { id: 'select',    label: 'Dropdown',       w: 160, h: 28, kind: 'choice' },
    { id: 'sig',       label: 'Signature',      w: 200, h: 44, kind: 'sig' },
    { id: 'init',      label: 'Initials',       w: 56,  h: 28, kind: 'sig' },
    { id: 'attach',    label: 'File attachment', w: 140, h: 36, kind: 'sig' },
    { id: 'calc',      label: 'Calculation',    w: 120, h: 28, kind: 'calc' },
  ];

  const formTemplates = [
    { id: 'FRM-001', name: 'Engagement letter (FRCP-compliant)', fields: 23, status: 'published',  uses: 142, lastEdit: '2026-03-22' },
    { id: 'FRM-002', name: 'Conflict-of-interest waiver',         fields: 11, status: 'published',  uses: 86,  lastEdit: '2026-03-08' },
    { id: 'FRM-003', name: 'Trial witness disclosure',            fields: 18, status: 'published',  uses: 31,  lastEdit: '2026-04-12' },
    { id: 'FRM-004', name: 'Document hold acknowledgement',       fields: 7,  status: 'published',  uses: 412, lastEdit: '2026-02-14' },
    { id: 'FRM-005', name: 'Settlement agreement',                fields: 38, status: 'published',  uses: 19,  lastEdit: '2026-04-15' },
    { id: 'FRM-006', name: 'NDA — mutual',                        fields: 14, status: 'published',  uses: 287, lastEdit: '2026-01-20' },
    { id: 'FRM-007', name: 'Vendor onboarding (Q2 2026 revision)', fields: 32, status: 'draft',     uses: 0,   lastEdit: '2026-04-18' },
    { id: 'FRM-008', name: 'Court-appointed counsel CJA-23',       fields: 16, status: 'published', uses: 24,  lastEdit: '2026-03-30' },
  ];

  // ── Compare runs ─────────────────────────────────────────────────────────
  const compareRuns = [
    { id: 'CMP-101', a: 'Opposition to MSJ — Draft v2', b: 'Opposition to MSJ — Draft v3', at: '2026-04-19T16:48:00Z',
      additions: 412, deletions: 188, modifications: 67, pagesChanged: 11, by: 'M. Kirkland', status: 'complete' },
    { id: 'CMP-102', a: 'Settlement Agreement — Pacific v1', b: 'Settlement Agreement — Pacific v2', at: '2026-04-18T11:02:00Z',
      additions: 8, deletions: 24, modifications: 19, pagesChanged: 3, by: 'S. Chen', status: 'complete' },
    { id: 'CMP-103', a: 'Engagement letter — TPL', b: 'Engagement letter — TPL revised', at: '2026-04-17T14:30:00Z',
      additions: 32, deletions: 4, modifications: 11, pagesChanged: 2, by: 'A. Petrov', status: 'complete' },
    { id: 'CMP-104', a: 'Discovery responses Set 2', b: 'Discovery responses Set 3', at: '2026-04-19T17:11:00Z',
      additions: 0, deletions: 0, modifications: 0, pagesChanged: 0, by: 'L. Torres', status: 'running' },
  ];

  // Synthetic diff hunks for the active compare run
  const compareHunks = [
    { type: 'mod', page: 3,  preview: '"plaintiff has failed to demonstrate" → "plaintiff has not demonstrated"',  reason: 'tone' },
    { type: 'add', page: 5,  preview: 'New ¶ — supplemental authorities Hawthorne v. Aurora and McCarthy v. Trent', reason: 'authorities' },
    { type: 'del', page: 7,  preview: 'Removed ¶ — duplicate procedural recap',                                 reason: 'cleanup' },
    { type: 'mod', page: 9,  preview: '"may have been" → "was"',                                                 reason: 'precision' },
    { type: 'add', page: 11, preview: 'New section — Damages methodology (Dr. Mitchell)',                       reason: 'expert' },
    { type: 'mod', page: 14, preview: 'Pin cite added: 482 F.3d at 1117',                                       reason: 'citation' },
    { type: 'add', page: 18, preview: 'New ¶ — response to defense\'s tortious-interference counterclaim',       reason: 'counter' },
    { type: 'del', page: 19, preview: 'Removed redundant footnote 14',                                          reason: 'cleanup' },
    { type: 'mod', page: 22, preview: 'Exhibit list reordered: Ex. 4 ↔ Ex. 6',                                  reason: 'exhibits' },
    { type: 'add', page: 24, preview: 'Added Certificate of Compliance with word-count limit',                  reason: 'rule' },
    { type: 'mod', page: 26, preview: 'Service list updated — added co-counsel',                                 reason: 'service' },
  ];

  // ── OCR queue ────────────────────────────────────────────────────────────
  const ocrQueue = [
    { id: 'OCR-001', name: 'Davis deposition exhibits.pdf', pages: 142, status: 'complete',     confidence: 98.4, started: '2026-04-19T10:00:00Z', completed: '2026-04-19T10:03:00Z', matter: 'Redstone v. Meridian' },
    { id: 'OCR-002', name: 'Q3 2022 board minutes (scanned).pdf', pages: 386, status: 'running', confidence: 96.2, started: '2026-04-19T11:00:00Z', completed: null, matter: 'Redstone v. Meridian', progress: 0.62 },
    { id: 'OCR-003', name: 'Production Set 2 — incoming.pdf', pages: 1284, status: 'queued',    confidence: null, started: null, completed: null, matter: 'Pacific Shipping' },
    { id: 'OCR-004', name: 'Sterling email export.pdf',         pages: 4112, status: 'queued',    confidence: null, started: null, completed: null, matter: 'Sterling Pharma' },
    { id: 'OCR-005', name: 'Witness statements — Greenfield.pdf', pages: 28,  status: 'complete', confidence: 99.1, started: '2026-04-18T14:00:00Z', completed: '2026-04-18T14:01:00Z', matter: 'Greenfield Class' },
    { id: 'OCR-006', name: 'Hand-written intake notes.pdf',     pages: 14,  status: 'failed',    confidence: 71.3, started: '2026-04-18T16:00:00Z', completed: '2026-04-18T16:02:00Z', matter: 'Marshall Employment',
      error: 'Confidence below 80% threshold — retry with handwriting model' },
  ];

  // ── Pipelines (automated workflows) ──────────────────────────────────────
  const pipelines = [
    { id: 'PL-INTAKE', name: 'Incoming production — auto-process',
      stages: ['Ingest', 'OCR', 'Auto-redact PII', 'Bates stamp', 'Notify reviewer'],
      runs: 412, success: 0.987, avgDuration: '4m 12s',
      lastRun: '2026-04-19T17:02:00Z', enabled: true,
      description: 'Triggered when a new document lands in /Discovery/Incoming. Runs OCR, applies PII redactions, Bates-stamps next available range, and pings the assigned reviewer.' },
    { id: 'PL-FINAL', name: 'Pre-filing checklist',
      stages: ['Spell check', 'Word count', 'Citation verify', 'Privilege scan', 'Assemble exhibits', 'Generate cert. of service'],
      runs: 87, success: 1.0, avgDuration: '2m 04s',
      lastRun: '2026-04-19T15:30:00Z', enabled: true,
      description: 'Run before any court filing. Catches malformed citations, missing word-count certificates, accidental privilege leaks.' },
    { id: 'PL-DEPO', name: 'Deposition kit assembly',
      stages: ['Pull witness file', 'Pull related exhibits', 'Pull related deposition transcripts', 'Generate index', 'Bind to PDF binder'],
      runs: 36, success: 0.972, avgDuration: '1m 48s',
      lastRun: '2026-04-19T08:14:00Z', enabled: true,
      description: 'Builds a sealed PDF binder for a witness deposition with all related materials.' },
    { id: 'PL-PRODUCE', name: 'Production export — full-cycle',
      stages: ['Apply confidentiality designations', 'Apply Bates stamps', 'Generate Concordance load file', 'Encrypt', 'Notify opposing counsel portal'],
      runs: 24, success: 1.0, avgDuration: '12m 36s',
      lastRun: '2026-04-15T11:00:00Z', enabled: true,
      description: 'Full discovery production export — produces native + TIFF + load file with proper designations.' },
    { id: 'PL-NDA',    name: 'NDA fast-track',
      stages: ['Pull template', 'Fill signer fields', 'Route to SignDesk', 'File on completion'],
      runs: 287, success: 0.993, avgDuration: '30s',
      lastRun: '2026-04-19T16:55:00Z', enabled: true,
      description: 'Generate NDA from template, route through SignDesk, file in vendor folder when both sides sign.' },
    { id: 'PL-RETIRE', name: 'Quarterly retention sweep',
      stages: ['Identify expired documents', 'Hold check', 'Notify owner', 'Schedule destruction', 'Audit log'],
      runs: 4, success: 1.0, avgDuration: '8m 12s',
      lastRun: '2026-04-01T03:00:00Z', enabled: true,
      description: 'Quarterly pass that surfaces documents past their retention horizon and notifies owners before destruction.' },
    { id: 'PL-SCAN', name: 'Scan-to-searchable',
      stages: ['Detect orientation', 'OCR', 'Confidence check', 'Index to search'],
      runs: 1842, success: 0.961, avgDuration: '1m 22s',
      lastRun: '2026-04-19T17:18:00Z', enabled: true,
      description: 'Default pipeline for any incoming scanned document. Auto-runs on upload.' },
    { id: 'PL-AI', name: 'AI summary + key-fact extraction',
      stages: ['Extract text', 'Summarize', 'Tag entities', 'Suggest links'],
      runs: 124, success: 0.946, avgDuration: '38s',
      lastRun: '2026-04-19T17:00:00Z', enabled: false,
      description: 'On-demand AI pass. Disabled until model card review completes (legal review pending).' },
  ];

  // ── Stamps & watermarks library ──────────────────────────────────────────
  const stamps = [
    { id: 'ST-DRAFT',   label: 'DRAFT',                       color: '#C23030', kind: 'watermark' },
    { id: 'ST-CONF',    label: 'CONFIDENTIAL',                color: '#0A1628', kind: 'watermark' },
    { id: 'ST-AEO',     label: 'ATTORNEYS\' EYES ONLY',       color: '#0A1628', kind: 'watermark' },
    { id: 'ST-HC-AEO',  label: 'HIGHLY CONFIDENTIAL — AEO',   color: '#C23030', kind: 'watermark' },
    { id: 'ST-FILED',   label: 'FILED',                       color: '#1B7A4A', kind: 'stamp' },
    { id: 'ST-SERVED',  label: 'SERVED',                      color: '#1B7A4A', kind: 'stamp' },
    { id: 'ST-RECVD',   label: 'RECEIVED',                    color: '#2563EB', kind: 'stamp' },
    { id: 'ST-PRIV',    label: 'PRIVILEGED — DO NOT DISCLOSE', color: '#7C3AED', kind: 'watermark' },
    { id: 'ST-WIP',     label: 'ATTORNEY WORK PRODUCT',       color: '#7C3AED', kind: 'watermark' },
    { id: 'ST-COPY',    label: 'COPY',                        color: '#6E7D9E', kind: 'watermark' },
    { id: 'ST-FINAL',   label: 'EXECUTED',                    color: '#1B7A4A', kind: 'stamp' },
    { id: 'ST-SEAL',    label: 'UNDER SEAL',                  color: '#C23030', kind: 'stamp' },
  ];

  // ── Bates jobs ───────────────────────────────────────────────────────────
  const batesJobs = [
    { id: 'BT-001', prefix: 'MERIDIAN-',  start: 1,      end: 4218,   status: 'applied',  by: 'L. Torres',  at: '2026-04-15T14:00:00Z', set: 'Production Set 1' },
    { id: 'BT-002', prefix: 'MERIDIAN-',  start: 4219,   end: 7340,   status: 'applied',  by: 'L. Torres',  at: '2026-04-17T10:30:00Z', set: 'Production Set 2' },
    { id: 'BT-003', prefix: 'MERIDIAN-',  start: 7341,   end: null,   status: 'reserved', by: 'L. Torres',  at: '2026-04-19T08:00:00Z', set: 'Production Set 3 (in prep)' },
    { id: 'BT-004', prefix: 'PACIFIC-',   start: 1,      end: 8421,   status: 'applied',  by: 'S. Chen',    at: '2026-03-20T09:00:00Z', set: 'Pacific — Production Set 1' },
    { id: 'BT-005', prefix: 'STERLING-',  start: 1,      end: 12834,  status: 'applied',  by: 'S. Chen',    at: '2026-04-08T11:00:00Z', set: 'Sterling — FCPA production' },
    { id: 'BT-006', prefix: 'GF-',        start: 1,      end: 41200,  status: 'applied',  by: 'M. Kirkland',at: '2026-04-12T13:00:00Z', set: 'Greenfield class — initial' },
  ];

  // ── Audit timeline (active doc) ──────────────────────────────────────────
  const auditEvents = [
    { id: 'A-1',  ts: '2026-04-08T09:14:00Z', actor: 'M. Kirkland', event: 'Created from template "Opposition brief"' },
    { id: 'A-2',  ts: '2026-04-08T09:17:00Z', actor: 'system',     event: 'Auto-classified: work-product' },
    { id: 'A-3',  ts: '2026-04-09T14:22:00Z', actor: 'L. Torres',  event: 'Comment added (p.9)' },
    { id: 'A-4',  ts: '2026-04-12T11:02:00Z', actor: 'M. Kirkland',event: 'Version 2 saved' },
    { id: 'A-5',  ts: '2026-04-12T11:03:00Z', actor: 'L. Torres',  event: 'Routed to peer review' },
    { id: 'A-6',  ts: '2026-04-15T11:08:00Z', actor: 'L. Torres',  event: 'Peer review pass complete — 38 changes' },
    { id: 'A-7',  ts: '2026-04-17T16:30:00Z', actor: 'system',     event: 'Privilege-pattern scan: 9 hits flagged' },
    { id: 'A-8',  ts: '2026-04-18T10:33:00Z', actor: 'J. Park',    event: 'Comment resolved (p.14)' },
    { id: 'A-9',  ts: '2026-04-19T16:42:00Z', actor: 'M. Kirkland',event: 'Version 3 saved' },
    { id: 'A-10', ts: '2026-04-19T16:44:00Z', actor: 'system',     event: 'Word-count check: 7,840 / 8,000 limit' },
    { id: 'A-11', ts: '2026-04-19T16:46:00Z', actor: 'system',     event: 'Citation verify: 38/38 valid' },
    { id: 'A-12', ts: '2026-04-19T16:48:00Z', actor: 'M. Kirkland',event: 'Locked for editing (until Apr 22 5:00 PM)' },
  ];

  // ── Library — all PDFs across the firm (lifecycle status) ────────────────
  const library = [
    { id: 'F-DOC-001', name: 'Opposition to MSJ — Draft v3.pdf',     matter: 'Redstone v. Meridian', status: 'In Review', pages: 28,  size: '3.4 MB', author: 'M. Kirkland', modified: '2026-04-19T16:42:00Z', priv: 'WP', conf: 'AEO' },
    { id: 'F-DOC-002', name: 'Settlement Agreement — Pacific v2.pdf', matter: 'Pacific Shipping',     status: 'Signed',    pages: 18,  size: '1.8 MB', author: 'S. Chen',     modified: '2026-04-18T11:02:00Z', priv: '',   conf: 'CONF' },
    { id: 'F-DOC-003', name: 'Engagement letter — Sterling.pdf',     matter: 'Sterling Pharma',     status: 'Filed',     pages: 6,   size: '420 KB', author: 'A. Petrov',   modified: '2026-04-15T09:30:00Z', priv: 'AC', conf: 'CONF' },
    { id: 'F-DOC-004', name: 'Discovery responses Set 3.pdf',         matter: 'Redstone v. Meridian', status: 'Final',     pages: 142, size: '14.2 MB',author: 'L. Torres',   modified: '2026-04-19T17:11:00Z', priv: '',   conf: 'AEO' },
    { id: 'F-DOC-005', name: 'Expert report — Dr. Mitchell.pdf',      matter: 'Redstone v. Meridian', status: 'Filed',     pages: 64,  size: '5.1 MB', author: 'M. Kirkland', modified: '2026-03-28T14:00:00Z', priv: '',   conf: 'AEO' },
    { id: 'F-DOC-006', name: 'NDA — Vendor onboarding.pdf',           matter: 'Firm-wide',           status: 'Template',  pages: 4,   size: '180 KB', author: 'A. Petrov',   modified: '2026-01-20T10:00:00Z', priv: 'AC', conf: 'CONF' },
    { id: 'F-DOC-007', name: 'Pretrial brief — Thornton.pdf',         matter: 'Thornton Estate',     status: 'Draft',     pages: 22,  size: '2.1 MB', author: 'R. Vasquez',  modified: '2026-04-19T13:14:00Z', priv: 'WP', conf: 'CONF' },
    { id: 'F-DOC-008', name: 'Privilege log — Redstone Q1.pdf',        matter: 'Redstone v. Meridian', status: 'Final',     pages: 84,  size: '3.8 MB', author: 'L. Torres',   modified: '2026-04-10T16:00:00Z', priv: 'WP', conf: 'CONF' },
    { id: 'F-DOC-009', name: 'Trial witness disclosure.pdf',           matter: 'Redstone v. Meridian', status: 'Filed',     pages: 11,  size: '320 KB', author: 'M. Kirkland', modified: '2026-04-05T11:00:00Z', priv: '',   conf: 'CONF' },
    { id: 'F-DOC-010', name: 'Davis deposition transcript.pdf',        matter: 'Redstone v. Meridian', status: 'Produced',  pages: 218, size: '12.4 MB',author: 'L. Torres',   modified: '2026-04-08T18:00:00Z', priv: '',   conf: 'AEO' },
    { id: 'F-DOC-011', name: 'Settlement demand letter.pdf',           matter: 'Pacific Shipping',     status: 'Sent',      pages: 8,   size: '380 KB', author: 'S. Chen',     modified: '2026-04-12T10:00:00Z', priv: 'WP', conf: 'AEO' },
    { id: 'F-DOC-012', name: 'Court order — Discovery cutoff.pdf',     matter: 'Redstone v. Meridian', status: 'Received',  pages: 4,   size: '120 KB', author: 'Court',       modified: '2026-01-20T16:00:00Z', priv: '',   conf: '' },
    { id: 'F-DOC-013', name: 'Production Set 2 — load file index.pdf', matter: 'Redstone v. Meridian', status: 'Produced',  pages: 142, size: '6.4 MB', author: 'L. Torres',   modified: '2026-04-17T17:00:00Z', priv: '',   conf: 'AEO' },
    { id: 'F-DOC-014', name: 'Old motion (archived 2024).pdf',         matter: 'Closed: Marshall',     status: 'Archived',  pages: 14,  size: '480 KB', author: 'R. Vasquez',  modified: '2024-09-12T10:00:00Z', priv: 'WP', conf: '' },
    { id: 'F-DOC-015', name: 'Hand-written intake notes (failed OCR).pdf', matter: 'Marshall Employment', status: 'Quarantined', pages: 14, size: '8.2 MB', author: 'R. Vasquez', modified: '2026-04-18T16:02:00Z', priv: '', conf: '' },
  ];

  // Lifecycle bucket counts
  const lifecycleCounts = library.reduce((acc, d) => { acc[d.status] = (acc[d.status] || 0) + 1; return acc; }, {});

  return {
    activeDoc, pages, annotationTools, comments,
    redactionPatterns, formFieldTypes, formTemplates,
    compareRuns, compareHunks,
    ocrQueue, pipelines, stamps, batesJobs, auditEvents,
    library, lifecycleCounts,
  };
})();

window.FOLIO_DATA = FOLIO_DATA;
