/* ═══════════════════════════════════════════════════════════════════
   ReportsData.jsx — sample data for the Client Reports surface. v1.0.0
   Ported verbatim from the Claude Design v2 package
   (_CLAUDE-DESIGN/_2026-06-12-v2-SaaS-Redesign/reports-data.jsx).
   Sample data only; no persistence — the surface runs on this design
   sample dataset until the reports API lands; the SA-only launch gate
   covers that window. Brand dots use --viz-* tokens to stay on-palette
   and theme-flip automatically. Client names are design placeholders
   (generic, per panel standard #7).
   Load order: FIRST of the four Reports modules (data → charts → page
   → surface — matches the design package's index.html order).
   Registers: window.WPSB.ReportsData = { DELIVERY, REPORTS,
   REPORT_STATS, REPORT_SECTIONS, COVER }.
   ═══════════════════════════════════════════════════════════════════ */
(function () {

/* delivery status meta — color + icon + label (color never the sole signal) */
const DELIVERY = {
  delivered: { c: 'var(--v-good)', cf: 'var(--v-good-fill)', icon: 'check-circle', label: 'Delivered' },
  scheduled: { c: 'var(--beam)',   cf: 'var(--beam)',        icon: 'clock',        label: 'Scheduled' },
  draft:     { c: 'var(--muted)',  cf: 'var(--muted)',       icon: 'file-text',    label: 'Draft' },
  attention: { c: 'var(--v-poor)', cf: 'var(--v-poor-fill)', icon: 'alert-triangle', label: 'Needs attention' },
};

/* saved / scheduled reports — one row per client report template */
const REPORTS = [
  { id: 'r1', name: 'May Performance Recap', client: 'Northwind Studio',   dot: 'var(--viz-1)',
    schedule: 'Monthly',   recipients: ['AM', 'JT'],             last: 'Jun 1',  status: 'delivered',  range: 'May 1 – 31' },
  { id: 'r2', name: 'SEO & Visibility Brief', client: 'Harbor & Co.',      dot: 'var(--viz-2)',
    schedule: 'Monthly',   recipients: ['RP', 'DL', 'KS'],       last: 'Jun 1',  status: 'delivered',  range: 'May 1 – 31' },
  { id: 'r3', name: 'Weekly Uptime Digest',   client: 'Bloomhaus',         dot: 'var(--viz-3)',
    schedule: 'Weekly',    recipients: ['MF'],                   last: 'Jun 9',  status: 'delivered',  range: 'Jun 2 – 8' },
  { id: 'r4', name: 'Q2 Executive Summary',   client: 'Atlas Freight',     dot: 'var(--viz-4)',
    schedule: 'Quarterly', recipients: ['CN', 'PV', 'RB', 'TE'], last: '—',      status: 'scheduled',  range: 'Apr – Jun' },
  { id: 'r5', name: 'June Performance Recap',  client: 'Northwind Studio',  dot: 'var(--viz-1)',
    schedule: 'Monthly',   recipients: ['AM', 'JT'],             last: '—',      status: 'scheduled',  range: 'Jun 1 – 30' },
  { id: 'r6', name: 'Launch Health Report',    client: 'Meridian Labs',    dot: 'var(--viz-5)',
    schedule: 'One-off',   recipients: ['SO', 'GH'],             last: 'May 28', status: 'attention',  range: 'May 20 – 27' },
  { id: 'r7', name: 'Content & Changes Log',   client: 'Harbor & Co.',     dot: 'var(--viz-2)',
    schedule: 'Monthly',   recipients: ['RP'],                   last: '—',      status: 'draft',      range: 'Jun 1 – 30' },
];

/* headline stats for the stat row */
const REPORT_STATS = {
  sent:      { value: '18',     delta: 5,  spark: [9, 11, 10, 13, 12, 15, 18] },
  scheduled: { value: '12',     spark: [10, 11, 11, 12, 12, 12, 12] },
  openRate:  { value: '84%',    delta: 6,  spark: [71, 74, 73, 78, 80, 82, 84] },
  next:      { value: '2 days', sub: 'Mon, Jun 12 · Atlas Freight' },
};

/* report-contents composition — drives the ToggleCard list (reuses §5 primitive).
   `addon` marks the add-on-gated section. */
const REPORT_SECTIONS = [
  { key: 'seo',     icon: 'search',   title: 'SEO Tracker summary',
    benefit: 'Top keywords, rank movement, and visibility trend for the period.', enabled: true, recommended: true },
  { key: 'cwv',     icon: 'activity', title: 'Core Web Vitals & speed',
    benefit: 'LCP / INP / CLS verdicts with the slowest pages flagged.', enabled: true },
  { key: 'uptime',  icon: 'shield-check', title: 'Uptime & availability',
    benefit: '30-day uptime strip and any incidents during the period.', enabled: true },
  { key: 'content', icon: 'file-text', title: 'Content & changes log',
    benefit: 'Published posts, edits, and plugin updates worth surfacing.', enabled: false },
  { key: 'ai',      icon: 'sparkles', title: 'AI visibility insights',
    benefit: 'How the site surfaces in AI answers — share of voice and cited pages.',
    addon: true },
];

/* cover-preview content (the branded report cover mock) */
const COVER = {
  client: 'Northwind Studio',
  site: 'northwind.studio',
  range: 'May 1 – 31, 2026',
  metrics: [
    { label: 'Avg. position', value: '6.4', delta: 2 },
    { label: 'CWV verdict',   value: 'Good' },
    { label: 'Uptime',        value: '99.98%' },
    { label: 'Top-10 terms',  value: '23', delta: 4 },
  ],
};

window.WPSB = window.WPSB || {};
window.WPSB.ReportsData = { DELIVERY, REPORTS, REPORT_STATS, REPORT_SECTIONS, COVER };
console.log('[WPSB] ReportsData v1.0.0 loaded (sample dataset)');
})();
