---
title: "Project Status Dashboard · UI SDK — StyleX Blocks"
description: "Launch-readiness program tracker powered by TanStack Charts: release KPI sparklines, phase-filtered milestone Gantt with a Today marker, burndown vs. planned trajectory, sprint velocity, weighted scope allocation, blockers & risks callouts, and a health-filterable workstream progress table."
url: "https://stylexblocks.com/block/ui-sdk/project-status-dashboard/"
agent:
  instructions: "Use this search API to find relevant components and blocks across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://stylexblocks.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Project Status Dashboard block

Launch-readiness program tracker powered by TanStack Charts: release KPI sparklines, phase-filtered milestone Gantt with a Today marker, burndown vs. planned trajectory, sprint velocity, weighted scope allocation, blockers & risks callouts, and a health-filterable workstream progress table.

- Behavior engine: UI SDK
- Category: [Dashboards](https://stylexblocks.com/blocks/dashboards.md)
- Built with: [Alert](https://stylexblocks.com/components/ui-sdk/alert.md), [Avatar](https://stylexblocks.com/components/ui-sdk/avatar.md), [Badge](https://stylexblocks.com/components/ui-sdk/badge.md), [Button](https://stylexblocks.com/components/ui-sdk/button.md), [Card](https://stylexblocks.com/components/ui-sdk/card.md), [Chart](https://stylexblocks.com/components/ui-sdk/chart.md), [Empty State](https://stylexblocks.com/components/ui-sdk/empty-state.md), [Grid](https://stylexblocks.com/components/ui-sdk/grid.md), [Heading](https://stylexblocks.com/components/ui-sdk/heading.md), [Hover Card](https://stylexblocks.com/components/ui-sdk/hover-card.md), [Progress](https://stylexblocks.com/components/ui-sdk/progress.md), [Segment Group](https://stylexblocks.com/components/ui-sdk/segment-group.md), [Separator](https://stylexblocks.com/components/ui-sdk/separator.md), [Stack](https://stylexblocks.com/components/ui-sdk/stack.md), [Stat](https://stylexblocks.com/components/ui-sdk/stat.md), [Status](https://stylexblocks.com/components/ui-sdk/status.md), [Table](https://stylexblocks.com/components/ui-sdk/table.md), [Text](https://stylexblocks.com/components/ui-sdk/text.md), [Toast](https://stylexblocks.com/components/ui-sdk/toast.md)
- HTML page: https://stylexblocks.com/block/ui-sdk/project-status-dashboard/

## Install

Configure the project once (sets the behavior engine and import aliases):

```sh
npx stylexblocks init --style ui-sdk
```

Then add the item as source you own:

```sh
npx stylexblocks add project-status-dashboard
```

Equivalent: `npx shadcn add @stylexblocks/project-status-dashboard`. Registry item JSON: https://stylexblocks.com/r/ui-sdk/project-status-dashboard.json

## Usage

```tsx
import { ProjectStatusDashboard } from "#components/blocks/ui-sdk/project-status-dashboard.tsx";

export function Example() {
  return (
    <div style={{ height: "100dvh" }}>
      <ProjectStatusDashboard />
    </div>
  );
}
```

## Source

`components/blocks/ui-sdk/project-status-dashboard.tsx`

```tsx
import * as stylex from "@stylexjs/stylex";
import { barX, defineChart, ruleX } from "@tanstack/charts";
import { Chart } from "@tanstack/charts/react/tooltip";
import { scaleBand } from "@tanstack/charts/scales/band";
import { scaleLinear } from "@tanstack/charts/scales/linear";
import { scaleOrdinal } from "@tanstack/charts/scales/ordinal";
import { tooltip } from "@tanstack/charts/tooltip";
import { useMemo, useState } from "react";
import { Alert } from "#components/ui/ui-sdk/alert.tsx";
import { Avatar } from "#components/ui/ui-sdk/avatar.tsx";
import { Badge } from "#components/ui/ui-sdk/badge.tsx";
import { Button } from "#components/ui/ui-sdk/button.tsx";
import { Card } from "#components/ui/ui-sdk/card.tsx";
import {
  BarChart,
  CategoryBar,
  ChartLegend,
  LineChart,
  Sparkline,
  chartColors,
  type ChartColorName,
} from "#components/ui/ui-sdk/chart.tsx";
import { EmptyState } from "#components/ui/ui-sdk/empty-state.tsx";
import { Grid } from "#components/ui/ui-sdk/grid.tsx";
import { Heading } from "#components/ui/ui-sdk/heading.tsx";
import { HoverCard } from "#components/ui/ui-sdk/hover-card.tsx";
import { Progress } from "#components/ui/ui-sdk/progress.tsx";
import { SegmentGroup } from "#components/ui/ui-sdk/segment-group.tsx";
import { Separator } from "#components/ui/ui-sdk/separator.tsx";
import { HStack, VStack } from "#components/ui/ui-sdk/stack.tsx";
import { Stat } from "#components/ui/ui-sdk/stat.tsx";
import { Status } from "#components/ui/ui-sdk/status.tsx";
import { Table } from "#components/ui/ui-sdk/table.tsx";
import { Text } from "#components/ui/ui-sdk/text.tsx";
import { Toast, Toaster } from "#components/ui/ui-sdk/toast.tsx";
import { semanticColors } from "@stylexblocks/ui/semantic-tokens/colors.stylex.ts";
import { semanticRadii } from "@stylexblocks/ui/semantic-tokens/radii.stylex.ts";
import { semanticShadows } from "@stylexblocks/ui/semantic-tokens/shadows.stylex.ts";
import {
  amberPalette,
  bluePalette,
  grayPalette,
  greenPalette,
  indigoPalette,
  purplePalette,
  redPalette,
  tealPalette,
} from "@stylexblocks/ui/themes/palettes.ts";
import { fontSizes } from "@stylexblocks/ui/tokens/font-sizes.stylex.ts";
import { fontWeights } from "@stylexblocks/ui/tokens/font-weights.stylex.ts";
import { fonts } from "@stylexblocks/ui/tokens/fonts.stylex.ts";
import { radii } from "@stylexblocks/ui/tokens/radii.stylex.ts";
import { spacing } from "@stylexblocks/ui/tokens/spacing.stylex.ts";
import type { StyleOverrideProps } from "#lib/recipe-props.ts";

// ============= CONTAINER BREAKPOINTS =============

const NARROW = "@container project-status-dashboard (max-width: 1020px)";
const COMPACT = "@container project-status-dashboard (max-width: 680px)";

// ============= DOMAIN TYPES =============

type Rag = "onTrack" | "atRisk" | "blocked";
type HealthFilter = "all" | Rag;
type Phase = "all" | "build" | "beta" | "ga";
type ReleasePhase = Exclude<Phase, "all">;
type AvatarTone = "blue" | "teal" | "indigo" | "purple" | "amber" | "green";

interface ReadinessKpi {
  key: string;
  label: string;
  value: string;
  unit?: string;
  delta: string;
  deltaTone: "success" | "warning" | "error";
  helpText: string;
  sparklineColor: ChartColorName;
  sparklineData: ReadonlyArray<{ step: number; value: number }>;
}

interface Milestone {
  id: string;
  name: string;
  phase: ReleasePhase;
  start: number;
  end: number;
  status: Rag;
  dateLabel: string;
  owner: string;
  summary: string;
}

interface BacklogSegment {
  key: string;
  label: string;
  tasks: number;
  points: number;
  color: ChartColorName;
}

interface BurndownWeek {
  week: number;
  label: string;
  planned: number;
  actual: number | null;
}

interface VelocitySprint {
  sprint: string;
  label: string;
  committed: number;
  completed: number;
}

interface Workstream {
  id: string;
  name: string;
  area: string;
  owner: string;
  ownerInitials: string;
  ownerPalette: AvatarTone;
  phase: ReleasePhase;
  completedPts: number;
  totalPts: number;
  dueLabel: string;
  status: Rag;
}

interface ProgramRisk {
  id: string;
  title: string;
  workstream: string;
  phase: ReleasePhase;
  severity: Rag;
  owner: string;
  ownerInitials: string;
  ownerPalette: AvatarTone;
  eta: string;
  detail: string;
}

// ============= TONE & LABEL MAPS =============

const PHASE_LABEL: Record<ReleasePhase, string> = {
  build: "Build",
  beta: "Beta",
  ga: "GA",
};

const RAG_LABEL: Record<Rag, string> = {
  onTrack: "On track",
  atRisk: "At risk",
  blocked: "Blocked",
};

const RAG_PALETTE = {
  onTrack: greenPalette,
  atRisk: amberPalette,
  blocked: redPalette,
} as const;

const RAG_CHART_COLOR: Record<Rag, ChartColorName> = {
  onTrack: "emerald",
  atRisk: "orange",
  blocked: "rose",
};

const AVATAR_PALETTE = {
  blue: bluePalette,
  teal: tealPalette,
  indigo: indigoPalette,
  purple: purplePalette,
  amber: amberPalette,
  green: greenPalette,
} as const;

const GANTT_LEGEND_ITEMS = [
  { name: "On track", color: "emerald" },
  { name: "At risk", color: "orange" },
  { name: "Blocked", color: "rose" },
] as const;

// ============= TIMELINE SCALE =============

const TIMELINE_DAYS = 90;
const TIMELINE_TICKS = [0, 15, 30, 45, 60, 75, 90] as const;
const PROJECT_DAY = 54;

function toSparkData(values: readonly number[]) {
  return values.map((value, idx) => ({ step: idx + 1, value }));
}

// ============= HARBOR EDGE v3.0 DEMO DATA =============

// Effort breakdown by status across all 162 tasks (360 story points total):
// 246 pts shipped (68.3%) + 114 pts remaining = 360 pts.
const BACKLOG_SEGMENTS: readonly BacklogSegment[] = [
  { key: "shipped", label: "Shipped", tasks: 104, points: 246, color: "blue" },
  { key: "inProgress", label: "In progress", tasks: 24, points: 52, color: "emerald" },
  { key: "inReview", label: "In review", tasks: 14, points: 24, color: "orange" },
  { key: "blocked", label: "Blocked", tasks: 6, points: 18, color: "rose" },
  { key: "planned", label: "Planned", tasks: 14, points: 20, color: "slate" },
];

const TOTAL_POINTS = BACKLOG_SEGMENTS.reduce((sum, s) => sum + s.points, 0);
const TOTAL_TASKS = BACKLOG_SEGMENTS.reduce((sum, s) => sum + s.tasks, 0);
const SHIPPED_POINTS = BACKLOG_SEGMENTS[0]!.points;
const REMAINING_POINTS = TOTAL_POINTS - SHIPPED_POINTS;
const COMPLETION_PCT = Math.round((SHIPPED_POINTS / TOTAL_POINTS) * 100);

const READINESS_KPIS: readonly ReadinessKpi[] = [
  {
    key: "completion",
    label: "Release Completion",
    value: `${COMPLETION_PCT}%`,
    delta: "+9 pts vs last wk",
    deltaTone: "success",
    helpText: `${SHIPPED_POINTS} of ${TOTAL_POINTS} story points shipped`,
    sparklineColor: "emerald",
    sparklineData: toSparkData([8, 15, 22, 30, 36, 43, 51, 59, 68]),
  },
  {
    key: "remaining",
    label: "Remaining Scope",
    value: `${REMAINING_POINTS}`,
    unit: "pts",
    delta: "-32 pts this wk",
    deltaTone: "success",
    helpText: "16 pts above planned W9 trajectory",
    sparklineColor: "blue",
    sparklineData: toSparkData([360, 336, 314, 286, 268, 240, 212, 178, 146, 114]),
  },
  {
    key: "velocity",
    label: "Team Velocity",
    value: "42",
    unit: "pts/wk",
    delta: "+7% vs 4-wk avg",
    deltaTone: "success",
    helpText: "95% sprint commitment reliability in S6",
    sparklineColor: "teal",
    sparklineData: toSparkData([30, 34, 32, 39, 44, 42]),
  },
  {
    key: "blockers",
    label: "Open Risks",
    value: "4",
    unit: "active",
    delta: "1 blocker · Edge KV",
    deltaTone: "error",
    helpText: "3 at-risk workstreams tracking mitigation",
    sparklineColor: "rose",
    sparklineData: toSparkData([2, 3, 4, 3, 5, 4, 4, 3, 4]),
  },
];

const MILESTONES: readonly Milestone[] = [
  {
    id: "m-abi",
    name: "RFC & ABI freeze",
    phase: "build",
    start: 0,
    end: 12,
    status: "onTrack",
    dateLabel: "Jul 17 – Jul 29",
    owner: "Nadia Osei",
    summary: "Locked host-function ABI v3 and zero-copy buffer layout.",
  },
  {
    id: "m-compiler",
    name: "Compiler v3 pass",
    phase: "build",
    start: 10,
    end: 28,
    status: "onTrack",
    dateLabel: "Jul 27 – Aug 14",
    owner: "Devon Park",
    summary: "Tree-shaking IR optimizer and Wasm AOT codegen merged.",
  },
  {
    id: "m-runtime",
    name: "Runtime isolate pool",
    phase: "build",
    start: 22,
    end: 46,
    status: "atRisk",
    dateLabel: "Aug 8 – Sep 1",
    owner: "Hannah Lindholm",
    summary: "Pre-warmed isolate slabs live; p99 cold start tuning in final pass.",
  },
  {
    id: "m-kv",
    name: "Edge KV regional sync",
    phase: "beta",
    start: 38,
    end: 58,
    status: "blocked",
    dateLabel: "Aug 24 – Sep 13",
    owner: "Tariq Mansour",
    summary: "Blocked on WAL compaction stall during dual-POP EU failover.",
  },
  {
    id: "m-canary",
    name: "Canary & soak test",
    phase: "beta",
    start: 52,
    end: 70,
    status: "atRisk",
    dateLabel: "Sep 7 – Sep 25",
    owner: "Samira Patel",
    summary: "72-hour multi-region replay pending IPv6 collector rollout.",
  },
  {
    id: "m-audit",
    name: "Security audit sign-off",
    phase: "ga",
    start: 66,
    end: 80,
    status: "onTrack",
    dateLabel: "Sep 21 – Oct 5",
    owner: "Owen Gallagher",
    summary: "External sandbox escape review & SBOM verification scheduled.",
  },
  {
    id: "m-ga",
    name: "Global GA rollout",
    phase: "ga",
    start: 78,
    end: 90,
    status: "onTrack",
    dateLabel: "Oct 3 – Oct 15",
    owner: "Chloe Vermeulen",
    summary: "Staged rollout across 38 edge POPs with CLI v3.0.0 release.",
  },
];

// Ideal vs. actual remaining scope across the 12-week launch window.
// Actual spans W1–W10 (current week = Day 54); W11–W12 remain planned targets.
const BURNDOWN_WEEKS: readonly BurndownWeek[] = [
  { week: 0, label: "W1", planned: 360, actual: 360 },
  { week: 1, label: "W2", planned: 327, actual: 336 },
  { week: 2, label: "W3", planned: 295, actual: 314 },
  { week: 3, label: "W4", planned: 262, actual: 286 },
  { week: 4, label: "W5", planned: 229, actual: 268 },
  { week: 5, label: "W6", planned: 196, actual: 240 },
  { week: 6, label: "W7", planned: 164, actual: 212 },
  { week: 7, label: "W8", planned: 131, actual: 178 },
  { week: 8, label: "W9", planned: 98, actual: 146 },
  { week: 9, label: "W10", planned: 65, actual: 114 },
  { week: 10, label: "W11", planned: 33, actual: null },
  { week: 11, label: "W12", planned: 0, actual: null },
];

const BURNDOWN_CHART_DATA = BURNDOWN_WEEKS.map((w) => ({
  label: w.label,
  "Actual remaining": w.actual,
  "Planned trajectory": w.planned,
}));

const VELOCITY_SPRINTS: readonly VelocitySprint[] = [
  { sprint: "S1", label: "Sprint 1 · Jul 20", committed: 32, completed: 30 },
  { sprint: "S2", label: "Sprint 2 · Aug 3", committed: 36, completed: 34 },
  { sprint: "S3", label: "Sprint 3 · Aug 17", committed: 38, completed: 32 },
  { sprint: "S4", label: "Sprint 4 · Aug 31", committed: 40, completed: 39 },
  { sprint: "S5", label: "Sprint 5 · Sep 7", committed: 42, completed: 44 },
  { sprint: "S6", label: "Sprint 6 · Sep 14", committed: 44, completed: 42 },
];

const VELOCITY_CHART_DATA = VELOCITY_SPRINTS.map((sp) => ({
  sprint: sp.sprint,
  Committed: sp.committed,
  Completed: sp.completed,
}));

const WORKSTREAMS: readonly Workstream[] = [
  {
    id: "ws-compiler",
    name: "Compiler",
    area: "IR optimizer & Wasm AOT",
    owner: "Devon Park",
    ownerInitials: "DP",
    ownerPalette: "blue",
    phase: "build",
    completedPts: 64,
    totalPts: 64,
    dueLabel: "Aug 14, 2026",
    status: "onTrack",
  },
  {
    id: "ws-runtime",
    name: "Runtime",
    area: "Isolate slab pool & cold starts",
    owner: "Hannah Lindholm",
    ownerInitials: "HL",
    ownerPalette: "indigo",
    phase: "build",
    completedPts: 68,
    totalPts: 82,
    dueLabel: "Sep 1, 2026",
    status: "atRisk",
  },
  {
    id: "ws-edge-kv",
    name: "Edge KV",
    area: "Multi-region WAL replication",
    owner: "Tariq Mansour",
    ownerInitials: "TM",
    ownerPalette: "amber",
    phase: "beta",
    completedPts: 26,
    totalPts: 70,
    dueLabel: "Sep 13, 2026",
    status: "blocked",
  },
  {
    id: "ws-telemetry",
    name: "Telemetry SDK",
    area: "Edge trace headers & metrics",
    owner: "Nadia Osei",
    ownerInitials: "NO",
    ownerPalette: "teal",
    phase: "build",
    completedPts: 38,
    totalPts: 40,
    dueLabel: "Aug 28, 2026",
    status: "onTrack",
  },
  {
    id: "ws-canary",
    name: "Canary Rollout",
    area: "72h replay & traffic shadowing",
    owner: "Samira Patel",
    ownerInitials: "SP",
    ownerPalette: "purple",
    phase: "beta",
    completedPts: 14,
    totalPts: 27,
    dueLabel: "Sep 25, 2026",
    status: "atRisk",
  },
  {
    id: "ws-docs-cli",
    name: "Docs & CLI",
    area: "Migration guide & harbor-cli v3",
    owner: "Milo Castellanos",
    ownerInitials: "MC",
    ownerPalette: "green",
    phase: "ga",
    completedPts: 18,
    totalPts: 28,
    dueLabel: "Oct 5, 2026",
    status: "onTrack",
  },
  {
    id: "ws-security",
    name: "Security Audit",
    area: "Isolate fuzzing & SBOM attestation",
    owner: "Owen Gallagher",
    ownerInitials: "OG",
    ownerPalette: "blue",
    phase: "ga",
    completedPts: 12,
    totalPts: 27,
    dueLabel: "Oct 5, 2026",
    status: "onTrack",
  },
  {
    id: "ws-packaging",
    name: "Release Packaging",
    area: "Signed binaries & POP manifest",
    owner: "Chloe Vermeulen",
    ownerInitials: "CV",
    ownerPalette: "indigo",
    phase: "ga",
    completedPts: 6,
    totalPts: 22,
    dueLabel: "Oct 15, 2026",
    status: "atRisk",
  },
];

const RISKS: readonly ProgramRisk[] = [
  {
    id: "rk-kv",
    title: "Edge KV cross-region replication stalls under failover",
    workstream: "Edge KV",
    phase: "beta",
    severity: "blocked",
    owner: "Tariq Mansour",
    ownerInitials: "TM",
    ownerPalette: "amber",
    eta: "Fix in review · PR #4182",
    detail:
      "WAL compaction acquires a cross-shard lock when two EU POPs reconnect simultaneously. Patch PR #4182 switches to lock-free epoch checkpoints; Canary soak test waits on merge.",
  },
  {
    id: "rk-runtime",
    title: "Runtime cold-start tail exceeds 18 ms p99 budget",
    workstream: "Runtime",
    phase: "build",
    severity: "atRisk",
    owner: "Hannah Lindholm",
    ownerInitials: "HL",
    ownerPalette: "indigo",
    eta: "Tuning lands Thu",
    detail:
      "Wasm snapshot hydration spikes to 27 ms on bundles above 4 MB. Pre-warming the isolate slab pool cut p99 to 19.4 ms; lazy module page-in closes the last 1.4 ms.",
  },
  {
    id: "rk-canary",
    title: "Canary soak cluster dropping IPv6 egress trace spans",
    workstream: "Canary Rollout",
    phase: "beta",
    severity: "atRisk",
    owner: "Samira Patel",
    ownerInitials: "SP",
    ownerPalette: "purple",
    eta: "Collector v2.14 rollout",
    detail:
      "Dual-stack collectors in ap-northeast-1 truncate traceparent headers above 40k RPS. Infra is rolling collector v2.14 ahead of the 72-hour soak gate.",
  },
  {
    id: "rk-notarize",
    title: "CLI binary notarization queue exceeds 45-minute SLA",
    workstream: "Release Packaging",
    phase: "ga",
    severity: "atRisk",
    owner: "Chloe Vermeulen",
    ownerInitials: "CV",
    ownerPalette: "indigo",
    eta: "Pre-signing RC 48h early",
    detail:
      "Signing throughput backs up during peak release windows. Adding automated retry queues and pre-signing release candidates 48 hours before GA cutover.",
  },
];

// Worst status across all workstreams determines overall program status.
const PROGRAM_STATUS: Rag = WORKSTREAMS.some((w) => w.status === "blocked")
  ? "blocked"
  : WORKSTREAMS.some((w) => w.status === "atRisk")
    ? "atRisk"
    : "onTrack";

function byPhase<T extends { phase: ReleasePhase }>(items: readonly T[], phase: Phase): T[] {
  return phase === "all" ? [...items] : items.filter((item) => item.phase === phase);
}

// ============= STYLES =============

const styles = stylex.create({
  root: {
    backgroundColor: semanticColors.bg,
    color: semanticColors.fg,
    containerName: "project-status-dashboard",
    containerType: "inline-size",
    display: "flex",
    flexDirection: "column",
    fontFamily: fonts.body,
    height: "100%",
    minHeight: 0,
    overflowY: "auto",
    width: "100%",
  },
  headerBand: {
    backgroundColor: semanticColors.bgSurface,
    borderBottomColor: semanticColors.border,
    borderBottomStyle: "solid",
    borderBottomWidth: "1px",
    paddingBlock: spacing._5,
    paddingInline: spacing._6,
    width: "100%",
  },
  headerInner: {
    marginInline: "auto",
    maxWidth: "88rem",
    width: "100%",
  },
  programHeading: {
    marginBlock: 0,
  },
  content: {
    marginInline: "auto",
    maxWidth: "88rem",
    paddingBlockEnd: spacing._10,
    paddingBlockStart: spacing._6,
    paddingInline: spacing._6,
    width: "100%",
  },
  sectionHeading: {
    marginBlock: 0,
  },
  kpiGrid: {
    gridTemplateColumns: {
      default: "repeat(4, minmax(0, 1fr))",
      [NARROW]: "repeat(2, minmax(0, 1fr))",
      [COMPACT]: "minmax(0, 1fr)",
    },
  },
  kpiBody: {
    paddingBlock: spacing._4,
    paddingInline: spacing._4,
  },
  sparklineHost: {
    marginTop: spacing._1,
  },
  twoColGrid: {
    gridTemplateColumns: {
      default: "repeat(2, minmax(0, 1fr))",
      [NARROW]: "minmax(0, 1fr)",
    },
  },
  cardInner: {
    paddingBlock: spacing._5,
    paddingInline: spacing._5,
  },
  chartHost: {
    width: "100%",
    "--ts-chart-tooltip-background": "transparent",
    "--ts-chart-tooltip-border": "none",
    "--ts-chart-tooltip-border-radius": "0px",
    "--ts-chart-tooltip-padding": "0px",
    "--ts-chart-tooltip-shadow": "none",
  },
  tooltipCard: {
    backgroundColor: semanticColors.bgElevated,
    borderColor: semanticColors.border,
    borderRadius: radii.lg,
    borderStyle: "solid",
    borderWidth: "1px",
    boxShadow: semanticShadows.md,
    color: semanticColors.fg,
    fontFamily: fonts.body,
    maxWidth: "17rem",
    minWidth: "11rem",
    paddingBlock: spacing._2_5,
    paddingInline: spacing._3,
  },
  tooltipRowPrimary: {
    backgroundColor: semanticColors.interactionHover,
    borderRadius: radii.sm,
    marginInline: `calc(-1 * ${spacing._1_5})`,
    paddingBlock: "0.125rem",
    paddingInline: spacing._1_5,
  },
  tooltipFooter: {
    borderTopColor: semanticColors.border,
    borderTopStyle: "solid",
    borderTopWidth: "1px",
    marginTop: spacing._0_5,
    paddingTop: spacing._1_5,
  },
  swatch: {
    borderRadius: "2px",
    display: "inline-block",
    flexShrink: 0,
    height: "0.625rem",
    width: "0.625rem",
  },
  swatchColor: (color: string) => ({
    backgroundColor: color,
  }),
  allocationRow: {
    borderBottomColor: semanticColors.borderSubtle,
    borderBottomStyle: "solid",
    borderBottomWidth: "1px",
    paddingBlockEnd: spacing._2,
  },
  allocationRowLast: {
    borderBottomWidth: 0,
    paddingBlockEnd: 0,
  },
  allocationPct: {
    minWidth: "2.5rem",
  },
  fullWidth: {
    width: "100%",
  },
  flexOne: {
    flexBasis: 0,
    flexGrow: 1,
    flexShrink: 1,
  },
  riskTriggerLink: {
    color: semanticColors.fg,
    fontSize: fontSizes.xs,
    fontWeight: fontWeights.medium,
    textDecorationLine: "underline",
    textDecorationStyle: "dotted",
    textUnderlineOffset: "3px",
  },
  riskHoverStack: {
    maxWidth: "18rem",
  },
  riskHoverFooter: {
    paddingTop: spacing._1,
  },
  tableScroll: {
    overflowX: "auto",
    width: "100%",
  },
  progressCell: {
    minWidth: "9.5rem",
  },
  nowrap: {
    whiteSpace: "nowrap",
  },
  tableRowHover: {
    backgroundColor: {
      default: "transparent",
      ":hover": semanticColors.interactionHover,
    },
  },
  todayPill: {
    backgroundColor: semanticColors.bgMuted,
    borderColor: semanticColors.border,
    borderRadius: semanticRadii.control,
    borderStyle: "solid",
    borderWidth: "1px",
    paddingBlock: "0.125rem",
    paddingInline: spacing._2,
  },
});

// ============= INLINE SVGS =============

function ShareIcon() {
  return (
    <svg
      width="14"
      height="14"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.9"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <circle cx="18" cy="5" r="3" />
      <circle cx="6" cy="12" r="3" />
      <circle cx="18" cy="19" r="3" />
      <line x1="8.59" y1="13.51" x2="15.42" y2="17.49" />
      <line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />
    </svg>
  );
}

function DownloadIcon() {
  return (
    <svg
      width="14"
      height="14"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.9"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
      <polyline points="7 10 12 15 17 10" />
      <line x1="12" y1="15" x2="12" y2="3" />
    </svg>
  );
}

function AlertTriangleIcon() {
  return (
    <svg
      width="15"
      height="15"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth="2"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" />
      <line x1="12" y1="9" x2="12" y2="13" />
      <line x1="12" y1="17" x2="12.01" y2="17" />
    </svg>
  );
}

function OctagonAlertIcon() {
  return (
    <svg
      width="15"
      height="15"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth="2"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2" />
      <line x1="12" y1="8" x2="12" y2="12" />
      <line x1="12" y1="16" x2="12.01" y2="16" />
    </svg>
  );
}

function CheckCircleIcon() {
  return (
    <svg
      width="18"
      height="18"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth="2"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <circle cx="12" cy="12" r="10" />
      <path d="m9 12 2 2 4-4" />
    </svg>
  );
}

function FlagIcon() {
  return (
    <svg
      width="18"
      height="18"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth="2"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z" />
      <line x1="4" y1="22" x2="4" y2="15" />
    </svg>
  );
}

// ============= SPECIALIZED GANTT CHART =============

function MilestoneGanttChart({ milestones }: { milestones: readonly Milestone[] }) {
  const chartHeight = Math.max(150, milestones.length * 40 + 44);

  const definition = useMemo(() => {
    const rows = [...milestones];
    return defineChart({
      marks: [
        ruleX([PROJECT_DAY], {
          id: "gantt-today-rule",
          stroke: semanticColors.borderEmphasized,
          strokeDasharray: "4 4",
          strokeWidth: 1.5,
          strokeOpacity: 0.9,
        }),
        barX(rows, {
          id: "gantt-milestones",
          x1: "start",
          x2: "end",
          y: "name",
          color: "status",
          key: "id",
          radius: 4,
          maxThickness: 22,
          fillOpacity: 0.92,
        }),
      ],
      scales: {
        x: {
          scale: () => scaleLinear().domain([0, TIMELINE_DAYS]),
          grid: true,
          axis: {
            line: false,
            ticks: {
              size: 0,
              values: [...TIMELINE_TICKS],
              format: (value) => `D${Math.round(Number(value))}`,
            },
          },
        },
        y: {
          scale: () => scaleBand<string>().padding(0.32),
          grid: false,
          axis: {
            line: false,
            ticks: { size: 0 },
          },
        },
      },
      color: {
        scale: scaleOrdinal<string, string>()
          .domain(["onTrack", "atRisk", "blocked"])
          .range([chartColors.emerald, chartColors.orange, chartColors.rose]),
      },
      margin: { top: 8, right: 16, bottom: 26, left: 152 },
      focus: "nearest",
      focusRing: false,
      maxFocusDistance: Number.POSITIVE_INFINITY,
      tooltip: {
        use: tooltip,
        offset: 14,
      },
    });
  }, [milestones]);

  return (
    <div {...stylex.props(styles.chartHost)}>
      <Chart
        definition={definition}
        height={chartHeight}
        initialWidth={960}
        ariaLabel="Harbor Edge v3.0 milestone schedule from Day 0 to Day 90 with Today marker at Day 54"
        renderTooltipBody={({ points }) => {
          const m = points[0]?.datum;
          if (!m) return null;
          const duration = m.end - m.start;
          const swatchColor = chartColors[RAG_CHART_COLOR[m.status]];
          return (
            <VStack gap="1.5" style={styles.tooltipCard}>
              <Text size="xs" weight="semibold">
                {m.name}
              </Text>
              <Text size="xs" tone="muted">
                {m.dateLabel} · {duration}d · {PHASE_LABEL[m.phase]}
              </Text>
              <HStack justify="between" align="center" gap="3" style={styles.tooltipRowPrimary}>
                <HStack render={<span />} align="center" gap="2">
                  <span {...stylex.props(styles.swatch, styles.swatchColor(swatchColor))} />
                  <Text render={<span />} size="xs">
                    {RAG_LABEL[m.status]}
                  </Text>
                </HStack>
                <Text render={<span />} variant="mono" size="xs" weight="semibold" tabular="true">
                  D{m.start}–D{m.end}
                </Text>
              </HStack>
              <Text size="xs" tone="muted">
                {m.summary}
              </Text>
              <HStack justify="between" align="center" gap="3" style={styles.tooltipFooter}>
                <Text render={<span />} size="xs" tone="muted">
                  Lead
                </Text>
                <Text render={<span />} size="xs" tone="muted">
                  {m.owner}
                </Text>
              </HStack>
            </VStack>
          );
        }}
      />
    </div>
  );
}

// ============= SUPPORTING CARDS =============

function ScopeBurndownChart() {
  return (
    <Card.Root variant="outline">
      <VStack gap="4" style={styles.cardInner}>
        <HStack justify="between" align="start" wrap="wrap" gap="2">
          <VStack gap="0.5">
            <Heading render={<h3 />} size="md" style={styles.sectionHeading}>
              Burndown vs. planned trajectory
            </Heading>
            <Text size="xs" tone="muted">
              Remaining story points across W1–W12 · 360 pts initial scope
            </Text>
          </VStack>
          <Badge variant="subtle" size="sm" palette={amberPalette}>
            +16 pts vs plan
          </Badge>
        </HStack>

        <LineChart
          data={BURNDOWN_CHART_DATA}
          index="label"
          categories={["Actual remaining", "Planned trajectory"]}
          colors={["blue", "slate"]}
          height={230}
          curve="linear"
          connectNulls={false}
          valueFormatter={(value) => `${Math.round(value)} pts`}
          ariaLabel="Scope burndown comparing actual remaining story points against planned trajectory"
        />
      </VStack>
    </Card.Root>
  );
}

function TeamVelocityChart() {
  return (
    <Card.Root variant="outline">
      <VStack gap="4" style={styles.cardInner}>
        <HStack justify="between" align="start" wrap="wrap" gap="2">
          <VStack gap="0.5">
            <Heading render={<h3 />} size="md" style={styles.sectionHeading}>
              Team velocity
            </Heading>
            <Text size="xs" tone="muted">
              Committed vs. completed story points across Sprints 1–6
            </Text>
          </VStack>
          <Badge variant="subtle" size="sm" palette={tealPalette}>
            36.8 pts avg
          </Badge>
        </HStack>

        <BarChart
          data={VELOCITY_CHART_DATA}
          index="sprint"
          categories={["Committed", "Completed"]}
          colors={["slate", "teal"]}
          type="grouped"
          height={230}
          valueFormatter={(value) => `${Math.round(value)} pts`}
          ariaLabel="Team sprint velocity comparing committed and completed story points across sprints S1 through S6"
        />
      </VStack>
    </Card.Root>
  );
}

function ScopeAllocationCard() {
  return (
    <Card.Root variant="outline">
      <VStack gap="4" style={styles.cardInner}>
        <HStack justify="between" align="start" wrap="wrap" gap="2">
          <VStack gap="0.5">
            <Heading render={<h3 />} size="md" style={styles.sectionHeading}>
              Scope allocation
            </Heading>
            <Text size="xs" tone="muted">
              Weighted by story points · {TOTAL_TASKS} tasks across {TOTAL_POINTS} pts
            </Text>
          </VStack>
          <Badge variant="subtle" size="sm" palette={bluePalette}>
            {COMPLETION_PCT}% shipped
          </Badge>
        </HStack>

        <CategoryBar
          values={BACKLOG_SEGMENTS.map((s) => s.points)}
          labels={BACKLOG_SEGMENTS.map((s) => s.label)}
          colors={BACKLOG_SEGMENTS.map((s) => s.color)}
          showLabels={false}
          valueFormatter={(value) => `${value} pts`}
          ariaLabel="Program backlog allocation weighted by story points"
        />

        <VStack gap="2">
          {BACKLOG_SEGMENTS.map((seg, idx) => {
            const pct = Math.round((seg.points / TOTAL_POINTS) * 100);
            const isLast = idx === BACKLOG_SEGMENTS.length - 1;
            return (
              <HStack
                key={seg.key}
                justify="between"
                align="center"
                gap="3"
                style={[styles.allocationRow, isLast && styles.allocationRowLast]}
              >
                <HStack render={<span />} align="center" gap="2">
                  <span
                    {...stylex.props(styles.swatch, styles.swatchColor(chartColors[seg.color]))}
                  />
                  <Text render={<span />} size="sm" weight="medium">
                    {seg.label}
                  </Text>
                </HStack>
                <HStack render={<span />} align="center" gap="3">
                  <Text render={<span />} variant="mono" size="xs" tone="muted" tabular="true">
                    {seg.tasks} tasks
                  </Text>
                  <Text render={<span />} variant="mono" size="xs" tone="muted" tabular="true">
                    {seg.points} pts
                  </Text>
                  <Text
                    render={<span />}
                    variant="mono"
                    size="xs"
                    weight="semibold"
                    align="end"
                    tabular="true"
                    style={styles.allocationPct}
                  >
                    {pct}%
                  </Text>
                </HStack>
              </HStack>
            );
          })}
        </VStack>
      </VStack>
    </Card.Root>
  );
}

function RisksCalloutCard({
  risks,
  phase,
  onResetPhase,
}: {
  risks: readonly ProgramRisk[];
  phase: Phase;
  onResetPhase: () => void;
}) {
  return (
    <Card.Root variant="outline">
      <VStack gap="4" style={styles.cardInner}>
        <HStack justify="between" align="start" wrap="wrap" gap="2">
          <VStack gap="0.5">
            <Heading render={<h3 />} size="md" style={styles.sectionHeading}>
              Blockers &amp; risks
            </Heading>
            <Text size="xs" tone="muted">
              Hover or focus a mitigation link for full root-cause notes
            </Text>
          </VStack>
          <Badge
            variant="subtle"
            size="sm"
            palette={
              risks.some((r) => r.severity === "blocked")
                ? redPalette
                : risks.length > 0
                  ? amberPalette
                  : greenPalette
            }
          >
            {risks.length} {risks.length === 1 ? "item" : "items"}
          </Badge>
        </HStack>

        {risks.length === 0 ? (
          <EmptyState.Root size="sm">
            <EmptyState.Content>
              <EmptyState.Indicator palette={greenPalette}>
                <CheckCircleIcon />
              </EmptyState.Indicator>
              <EmptyState.Title>No active blockers or risks</EmptyState.Title>
              <EmptyState.Description>
                Nothing flagged in the {phase === "all" ? "program" : PHASE_LABEL[phase]} phase.
              </EmptyState.Description>
              {phase !== "all" && (
                <EmptyState.Actions>
                  <Button variant="surface" size="xs" onClick={onResetPhase}>
                    Show all phases
                  </Button>
                </EmptyState.Actions>
              )}
            </EmptyState.Content>
          </EmptyState.Root>
        ) : (
          <VStack gap="2.5">
            {risks.map((risk) => {
              const isBlocked = risk.severity === "blocked";
              return (
                <Alert.Root
                  key={risk.id}
                  size="sm"
                  variant="subtle"
                  status={isBlocked ? "error" : "warning"}
                  palette={isBlocked ? redPalette : amberPalette}
                >
                  <Alert.Indicator>
                    {isBlocked ? <OctagonAlertIcon /> : <AlertTriangleIcon />}
                  </Alert.Indicator>
                  <Alert.Content>
                    <HStack justify="between" align="start" gap="2.5" style={styles.fullWidth}>
                      <VStack gap="1" style={styles.flexOne}>
                        <Alert.Title>{risk.title}</Alert.Title>
                        <Alert.Description>
                          <HStack render={<span />} align="center" wrap="wrap" gap="1.5">
                            <Text render={<span />} size="xs" tone="muted">
                              {risk.workstream}
                            </Text>
                            <Text render={<span />} size="xs" tone="muted" aria-hidden="true">
                              ·
                            </Text>
                            <Text render={<span />} size="xs" tone="muted">
                              {PHASE_LABEL[risk.phase]}
                            </Text>
                            <Text render={<span />} size="xs" tone="muted" aria-hidden="true">
                              ·
                            </Text>
                            <Text render={<span />} size="xs" tone="muted">
                              {risk.eta}
                            </Text>
                            <Text render={<span />} size="xs" tone="muted" aria-hidden="true">
                              ·
                            </Text>
                            <HoverCard.Root size="sm">
                              <HoverCard.Trigger
                                href={`#${risk.id}`}
                                onClick={(e) => e.preventDefault()}
                                {...stylex.props(styles.riskTriggerLink)}
                              >
                                Mitigation notes
                              </HoverCard.Trigger>
                              <HoverCard.Content>
                                <HoverCard.Arrow />
                                <VStack gap="2" style={styles.riskHoverStack}>
                                  <Text size="sm" weight="semibold">
                                    {risk.title}
                                  </Text>
                                  <Text size="xs" tone="muted">
                                    {risk.detail}
                                  </Text>
                                  <HStack
                                    justify="between"
                                    align="center"
                                    gap="2"
                                    style={styles.riskHoverFooter}
                                  >
                                    <HStack render={<span />} align="center" gap="2">
                                      <Avatar.Root
                                        size="2xs"
                                        variant="subtle"
                                        palette={AVATAR_PALETTE[risk.ownerPalette]}
                                      >
                                        <Avatar.Fallback>{risk.ownerInitials}</Avatar.Fallback>
                                      </Avatar.Root>
                                      <Text render={<span />} size="xs" tone="muted">
                                        {risk.owner}
                                      </Text>
                                    </HStack>
                                    <Badge
                                      variant="subtle"
                                      size="xs"
                                      palette={RAG_PALETTE[risk.severity]}
                                    >
                                      {RAG_LABEL[risk.severity]}
                                    </Badge>
                                  </HStack>
                                </VStack>
                              </HoverCard.Content>
                            </HoverCard.Root>
                          </HStack>
                        </Alert.Description>
                      </VStack>
                      <Badge variant="subtle" size="xs" palette={RAG_PALETTE[risk.severity]}>
                        {RAG_LABEL[risk.severity]}
                      </Badge>
                    </HStack>
                  </Alert.Content>
                </Alert.Root>
              );
            })}
          </VStack>
        )}
      </VStack>
    </Card.Root>
  );
}

// ============= MAIN BLOCK =============

export interface ProjectStatusDashboardProps extends StyleOverrideProps {}

/**
 * ProjectStatusDashboard — Harbor Edge v3.0 launch-readiness program tracker:
 * release KPI sparklines, phase-filtered milestone Gantt with a Today marker,
 * burndown vs. planned trajectory, team sprint velocity, weighted scope
 * allocation category bar, blockers & risks callouts, and a health-filterable
 * workstream progress table.
 */
export function ProjectStatusDashboard({ palette, style }: ProjectStatusDashboardProps) {
  const [phase, setPhase] = useState<Phase>("all");
  const [healthFilter, setHealthFilter] = useState<HealthFilter>("all");
  const queue = useMemo(() => Toast.createToaster(), []);

  const milestones = useMemo(() => byPhase(MILESTONES, phase), [phase]);
  const risks = useMemo(() => byPhase(RISKS, phase), [phase]);
  const workstreams = useMemo(() => {
    const phaseFiltered = byPhase(WORKSTREAMS, phase);
    return healthFilter === "all"
      ? phaseFiltered
      : phaseFiltered.filter((w) => w.status === healthFilter);
  }, [phase, healthFilter]);

  return (
    <div {...stylex.props(styles.root, palette, style)}>
      {/* Program Header */}
      <header {...stylex.props(styles.headerBand)}>
        <HStack justify="between" align="center" wrap="wrap" gap="4" style={styles.headerInner}>
          <VStack gap="1.5">
            <HStack align="center" wrap="wrap" gap="2.5">
              <Heading render={<h1 />} size="xl" style={styles.programHeading}>
                Harbor Edge v3.0 · Launch Readiness
              </Heading>
              <Badge variant="subtle" size="sm" palette={RAG_PALETTE[PROGRAM_STATUS]}>
                <Status.Root size="sm" palette={RAG_PALETTE[PROGRAM_STATUS]}>
                  <Status.Indicator />
                  <span>{RAG_LABEL[PROGRAM_STATUS]}</span>
                </Status.Root>
              </Badge>
            </HStack>
            <HStack align="center" wrap="wrap" gap="2">
              <Text render={<span />} size="sm" tone="muted">
                Target GA: Oct 15, 2026
              </Text>
              <Text render={<span />} size="sm" tone="subtle" aria-hidden="true">
                ·
              </Text>
              <Text render={<span />} size="sm" tone="muted">
                Day {PROJECT_DAY} of {TIMELINE_DAYS}
              </Text>
              <Text render={<span />} size="sm" tone="subtle" aria-hidden="true">
                ·
              </Text>
              <Text render={<span />} size="sm" tone="muted">
                38 Edge POPs · Release Captain: Nadia Osei
              </Text>
            </HStack>
          </VStack>

          <HStack align="center" wrap="wrap" gap="2">
            <SegmentGroup.Root
              size="sm"
              aria-label="Filter by release phase"
              value={phase}
              onValueChange={(next) => setPhase(next as Phase)}
            >
              <SegmentGroup.Item value="all">All</SegmentGroup.Item>
              <SegmentGroup.Item value="build">Build</SegmentGroup.Item>
              <SegmentGroup.Item value="beta">Beta</SegmentGroup.Item>
              <SegmentGroup.Item value="ga">GA</SegmentGroup.Item>
            </SegmentGroup.Root>

            <Button
              variant="surface"
              size="sm"
              onClick={() =>
                queue.info("Shareable snapshot link copied for Harbor Edge v3.0")
              }
            >
              <ShareIcon />
              Share
            </Button>

            <Button
              variant="surface"
              size="sm"
              onClick={() =>
                queue.success("Exported Harbor Edge v3.0 launch status report (PDF & CSV)")
              }
            >
              <DownloadIcon />
              Export status
            </Button>
          </HStack>
        </HStack>
      </header>

      <VStack render={<main />} gap="6" style={styles.content}>
        {/* Band 1: Release Readiness KPI Cards */}
        <Grid
          render={<section aria-label="Release readiness summary" />}
          gap="4"
          style={styles.kpiGrid}
        >
          {READINESS_KPIS.map((kpi) => (
            <Card.Root key={kpi.key} variant="outline">
              <VStack gap="2" style={styles.kpiBody}>
                <Stat.Root size="md">
                  <Stat.Label>{kpi.label}</Stat.Label>
                  <HStack justify="between" align="baseline" wrap="wrap" gap="2">
                    <Stat.ValueText>
                      {kpi.value}
                      {kpi.unit ? <Stat.ValueUnit>{kpi.unit}</Stat.ValueUnit> : null}
                    </Stat.ValueText>
                    <Text render={<span />} size="xs" weight="medium" tone={kpi.deltaTone}>
                      {kpi.delta}
                    </Text>
                  </HStack>
                  <Stat.HelpText>{kpi.helpText}</Stat.HelpText>
                </Stat.Root>
                <Sparkline
                  data={kpi.sparklineData}
                  categories={["value"]}
                  colors={[kpi.sparklineColor]}
                  height={36}
                  curve="linear"
                  ariaLabel={`${kpi.label} trend sparkline`}
                  style={styles.sparklineHost}
                />
              </VStack>
            </Card.Root>
          ))}
        </Grid>

        {/* Band 2: Milestone Timeline Gantt */}
        <section aria-label="Milestone timeline">
          <Card.Root variant="outline">
            <VStack gap="4" style={styles.cardInner}>
              <HStack justify="between" align="start" wrap="wrap" gap="2">
                <VStack gap="0.5">
                  <Heading render={<h2 />} size="md" style={styles.sectionHeading}>
                    Milestone timeline
                  </Heading>
                  <Text size="xs" tone="muted">
                    Project days 0–{TIMELINE_DAYS} · dashed rule marks Today (Day {PROJECT_DAY})
                  </Text>
                </VStack>
                <HStack render={<span />} align="center" gap="1.5" style={styles.todayPill}>
                  <Text render={<span />} variant="mono" size="xs" tone="muted">
                    Today
                  </Text>
                  <Text render={<span />} variant="mono" size="xs" tone="muted" aria-hidden="true">
                    ·
                  </Text>
                  <Text render={<span />} variant="mono" size="xs" tone="muted">
                    D{PROJECT_DAY} (Sep 9)
                  </Text>
                </HStack>
              </HStack>

              {milestones.length === 0 ? (
                <EmptyState.Root size="sm">
                  <EmptyState.Content>
                    <EmptyState.Indicator palette={grayPalette}>
                      <FlagIcon />
                    </EmptyState.Indicator>
                    <EmptyState.Title>No milestones in this phase</EmptyState.Title>
                    <EmptyState.Description>
                      Switch phases to inspect other release milestones.
                    </EmptyState.Description>
                    <EmptyState.Actions>
                      <Button variant="surface" size="xs" onClick={() => setPhase("all")}>
                        Show all phases
                      </Button>
                    </EmptyState.Actions>
                  </EmptyState.Content>
                </EmptyState.Root>
              ) : (
                <>
                  <MilestoneGanttChart milestones={milestones} />
                  <HStack justify="between" align="center" wrap="wrap" gap="4">
                    <ChartLegend
                      items={GANTT_LEGEND_ITEMS}
                      ariaLabel="Milestone status legend"
                    />
                    <Text render={<span />} size="xs" tone="muted">
                      Showing {milestones.length} of {MILESTONES.length} milestones
                    </Text>
                  </HStack>
                </>
              )}
            </VStack>
          </Card.Root>
        </section>

        {/* Band 3: Burndown & Velocity */}
        <Grid
          render={<section aria-label="Burndown and velocity" />}
          gap="4"
          style={styles.twoColGrid}
        >
          <ScopeBurndownChart />
          <TeamVelocityChart />
        </Grid>

        {/* Band 4: Scope Allocation & Blockers */}
        <Grid
          render={<section aria-label="Scope allocation and risks" />}
          gap="4"
          style={styles.twoColGrid}
        >
          <ScopeAllocationCard />
          <RisksCalloutCard
            risks={risks}
            phase={phase}
            onResetPhase={() => setPhase("all")}
          />
        </Grid>

        <Separator />

        {/* Band 5: Workstream Progress Table */}
        <section aria-label="Workstream progress">
          <Card.Root variant="outline">
            <VStack gap="4" style={styles.cardInner}>
              <HStack justify="between" align="center" wrap="wrap" gap="3">
                <VStack gap="0.5">
                  <Heading render={<h2 />} size="md" style={styles.sectionHeading}>
                    Workstreams
                  </Heading>
                  <Text size="xs" tone="muted">
                    Showing {workstreams.length} of {WORKSTREAMS.length} engineering workstreams
                  </Text>
                </VStack>

                <SegmentGroup.Root
                  size="xs"
                  aria-label="Filter workstreams by health status"
                  value={healthFilter}
                  onValueChange={(next) => setHealthFilter(next as HealthFilter)}
                >
                  <SegmentGroup.Item value="all">All</SegmentGroup.Item>
                  <SegmentGroup.Item value="onTrack">On track</SegmentGroup.Item>
                  <SegmentGroup.Item value="atRisk">At risk</SegmentGroup.Item>
                  <SegmentGroup.Item value="blocked">Blocked</SegmentGroup.Item>
                </SegmentGroup.Root>
              </HStack>

              {workstreams.length === 0 ? (
                <EmptyState.Root size="sm">
                  <EmptyState.Content>
                    <EmptyState.Indicator palette={grayPalette}>
                      <FlagIcon />
                    </EmptyState.Indicator>
                    <EmptyState.Title>No matching workstreams</EmptyState.Title>
                    <EmptyState.Description>
                      Try clearing the phase or health status filter to see all workstreams.
                    </EmptyState.Description>
                    <EmptyState.Actions>
                      <Button
                        variant="surface"
                        size="xs"
                        onClick={() => {
                          setPhase("all");
                          setHealthFilter("all");
                        }}
                      >
                        Reset filters
                      </Button>
                    </EmptyState.Actions>
                  </EmptyState.Content>
                </EmptyState.Root>
              ) : (
                <div {...stylex.props(styles.tableScroll)}>
                  <Table.Root size="md" variant="line">
                    <Table.Header>
                      <Table.Row>
                        <Table.ColumnHeader>Workstream</Table.ColumnHeader>
                        <Table.ColumnHeader>Phase</Table.ColumnHeader>
                        <Table.ColumnHeader>Owner</Table.ColumnHeader>
                        <Table.ColumnHeader>Progress</Table.ColumnHeader>
                        <Table.ColumnHeader>Target date</Table.ColumnHeader>
                        <Table.ColumnHeader>Health</Table.ColumnHeader>
                      </Table.Row>
                    </Table.Header>
                    <Table.Body>
                      {workstreams.map((ws) => {
                        const pct = Math.round((ws.completedPts / ws.totalPts) * 100);
                        return (
                          <Table.Row key={ws.id} style={styles.tableRowHover}>
                            <Table.Cell>
                              <VStack gap="0.5">
                                <Text render={<span />} size="sm" weight="medium">
                                  {ws.name}
                                </Text>
                                <Text render={<span />} size="xs" tone="muted">
                                  {ws.area}
                                </Text>
                              </VStack>
                            </Table.Cell>
                            <Table.Cell>
                              <Badge variant="outline" size="xs" palette={grayPalette}>
                                {PHASE_LABEL[ws.phase]}
                              </Badge>
                            </Table.Cell>
                            <Table.Cell>
                              <HStack render={<span />} align="center" gap="2">
                                <Avatar.Root
                                  size="xs"
                                  variant="subtle"
                                  palette={AVATAR_PALETTE[ws.ownerPalette]}
                                >
                                  <Avatar.Fallback>{ws.ownerInitials}</Avatar.Fallback>
                                </Avatar.Root>
                                <Text render={<span />} size="sm">
                                  {ws.owner}
                                </Text>
                              </HStack>
                            </Table.Cell>
                            <Table.Cell>
                              <VStack gap="1" style={styles.progressCell}>
                                <Progress.Root
                                  value={ws.completedPts}
                                  max={ws.totalPts}
                                  size="xs"
                                  palette={RAG_PALETTE[ws.status]}
                                  aria-label={`${ws.name} completion`}
                                >
                                  <Progress.Track>
                                    <Progress.Range />
                                  </Progress.Track>
                                </Progress.Root>
                                <HStack justify="between" align="center">
                                  <Text
                                    render={<span />}
                                    variant="mono"
                                    size="xs"
                                    weight="medium"
                                    tabular="true"
                                  >
                                    {pct}%
                                  </Text>
                                  <Text
                                    render={<span />}
                                    variant="mono"
                                    size="xs"
                                    tone="muted"
                                    tabular="true"
                                  >
                                    {ws.completedPts}/{ws.totalPts} pts
                                  </Text>
                                </HStack>
                              </VStack>
                            </Table.Cell>
                            <Table.Cell style={styles.nowrap}>
                              <Text
                                render={<span />}
                                variant="mono"
                                size="xs"
                                tone="muted"
                                tabular="true"
                              >
                                {ws.dueLabel}
                              </Text>
                            </Table.Cell>
                            <Table.Cell>
                              <Badge variant="subtle" size="sm" palette={RAG_PALETTE[ws.status]}>
                                <Status.Root size="sm" palette={RAG_PALETTE[ws.status]}>
                                  <Status.Indicator />
                                  <span>{RAG_LABEL[ws.status]}</span>
                                </Status.Root>
                              </Badge>
                            </Table.Cell>
                          </Table.Row>
                        );
                      })}
                    </Table.Body>
                  </Table.Root>
                </div>
              )}
            </VStack>
          </Card.Root>
        </section>
      </VStack>

      <Toaster toaster={queue} />
    </div>
  );
}
```

Credit: Inspired by [Project Status Dashboard](https://astryx.atmeta.com/playground?template=dashboard-progress) from Astryx (MIT License · Copyright (c) 2026 Meta Platforms, Inc.)
