{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "training-compliance-tracker",
  "title": "Training Compliance Tracker",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-react/blocks/training-compliance-tracker/TrainingComplianceTracker.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport {\n  AlertCircle,\n  Award,\n  BadgeCheck,\n  Building2,\n  CalendarClock,\n  Check,\n  CheckCircle2,\n  Clock,\n  Copy,\n  Download,\n  FileCheck,\n  FileDown,\n  PlayCircle,\n  RefreshCw,\n  RotateCcw,\n  Search,\n  Share2,\n  Shield,\n  ShieldCheck,\n  Users,\n  X,\n} from 'lucide-react'\nimport { cn } from '@/lib/utils'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'\nimport { Progress } from '@/components/ui/progress'\nimport { Separator } from '@/components/ui/separator'\nimport { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'\n\nexport interface ComplianceCourse {\n  id: string\n  code: string\n  title: string\n  category: string\n  categoryKey: 'security' | 'ethics' | 'governance' | 'privacy' | 'finance'\n  standard: string\n  duration: string\n  durationHours: number\n  score: number\n  scoreStatus: string\n  completionDate: string\n  expirationDate: string\n  validityMonths: number\n  daysUntilExpiry: number\n  credentialId: string\n  sha256Digest: string\n  verified: boolean\n  instructor: string\n  accreditationBody: string\n  description: string\n}\n\nexport interface TrainingComplianceTrackerProps {\n  className?: string\n  defaultFilter?: string\n}\n\nconst coursesData: ComplianceCourse[] = [\n  {\n    id: 'course-sec-201',\n    code: 'SEC-201',\n    title: 'Information Security & Data Protection (SOC2 / ISO 27001)',\n    category: 'Security & Privacy',\n    categoryKey: 'security',\n    standard: 'AICPA SOC 2 Type II (CC6.1–CC6.8) & ISO/IEC 27001:2022 ISMS',\n    duration: '1.5 Hours · Video + Exam',\n    durationHours: 1.5,\n    score: 100,\n    scoreStatus: '100% · Passed',\n    completionDate: 'Aug 10, 2026',\n    expirationDate: 'Aug 10, 2027',\n    validityMonths: 12,\n    daysUntilExpiry: 354,\n    credentialId: 'CERT-SEC-8921',\n    sha256Digest: '7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069',\n    verified: true,\n    instructor: 'Dr. Marcus Vance (Chief Information Security Officer)',\n    accreditationBody: 'AICPA & International Organization for Standardization (ISO)',\n    description:\n      'Covers zero-trust access, threat modeling, cryptographic key storage, cloud security postures, automated patch cycles, and incident response SLAs.',\n  },\n  {\n    id: 'course-eth-104',\n    code: 'ETH-104',\n    title: 'Workplace Harassment Prevention (California AB 1825)',\n    category: 'Ethics & Legal',\n    categoryKey: 'ethics',\n    standard: 'California Government Code § 12950.1 / AB 1825 & SB 1343',\n    duration: '2.0 Hours · Interactive Scenario',\n    durationHours: 2.0,\n    score: 100,\n    scoreStatus: '100% · Passed',\n    completionDate: 'Jul 14, 2026',\n    expirationDate: 'Jul 14, 2027',\n    validityMonths: 12,\n    daysUntilExpiry: 327,\n    credentialId: 'CERT-ETH-4412',\n    sha256Digest: '3d9e8471b0219ca66219f85c18174a10df84b1fa3d677284addd200126d83120',\n    verified: true,\n    instructor: 'Sarah Jenkins, Esq. (Director of People & Legal Compliance)',\n    accreditationBody: 'California Civil Rights Department (CRD / DFEH)',\n    description:\n      'Mandatory supervisory training on workplace culture, protected characteristics, bystander intervention techniques, retaliation prevention, and complaint escalations.',\n  },\n  {\n    id: 'course-gov-302',\n    code: 'GOV-302',\n    title: 'Anti-Bribery & Foreign Corrupt Practices Act (FCPA)',\n    category: 'Corporate Governance',\n    categoryKey: 'governance',\n    standard: 'US Foreign Corrupt Practices Act (15 U.S.C. § 78dd-1) & OECD Guidelines',\n    duration: '1.0 Hour · Case Studies + Exam',\n    durationHours: 1.0,\n    score: 96,\n    scoreStatus: '96% · Passed',\n    completionDate: 'Apr 15, 2026',\n    expirationDate: 'Apr 15, 2027',\n    validityMonths: 12,\n    daysUntilExpiry: 237,\n    credentialId: 'CERT-GOV-3108',\n    sha256Digest: '19fa4429bb56f082c18148a1d65dfc2d4b1fa3d677284addd200126d409218a1',\n    verified: true,\n    instructor: 'David K. Thorne (Global Ethics & Trade Compliance Counsel)',\n    accreditationBody: 'U.S. Department of Justice & OECD Anti-Bribery Directorate',\n    description:\n      'Anti-corruption controls, third-party intermediary vetting, prohibition of facilitation payments, gift/hospitality thresholds, and internal books and records integrity.',\n  },\n  {\n    id: 'course-reg-205',\n    code: 'REG-205',\n    title: 'HIPAA Security & Health Privacy Standards',\n    category: 'Regulatory & Privacy',\n    categoryKey: 'privacy',\n    standard: '45 CFR Part 160 & Part 164 Subparts A, C, and E (ePHI Safeguards)',\n    duration: '1.0 Hour · Video + Assessment',\n    durationHours: 1.0,\n    score: 98,\n    scoreStatus: '98% · Passed',\n    completionDate: 'Jun 02, 2026',\n    expirationDate: 'Jun 02, 2027',\n    validityMonths: 12,\n    daysUntilExpiry: 285,\n    credentialId: 'CERT-HPA-7729',\n    sha256Digest: '55ca0982df43b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200',\n    verified: true,\n    instructor: 'Rachel Sterling (Healthcare Privacy & HIPAA Compliance Officer)',\n    accreditationBody: 'U.S. Department of Health & Human Services (HHS OCR)',\n    description:\n      'Handling of Protected Health Information (PHI/ePHI), minimum necessary standard, physical and technical safeguards, Business Associate Agreements, and breach notifications.',\n  },\n  {\n    id: 'course-fin-401',\n    code: 'FIN-401',\n    title: 'Insider Trading & Fair Disclosure (SEC)',\n    category: 'Financial Compliance',\n    categoryKey: 'finance',\n    standard: 'Securities Exchange Act Rule 10b-5 & SEC Regulation Fair Disclosure (Reg FD)',\n    duration: '1.0 Hour · Video + Exam',\n    durationHours: 1.0,\n    score: 100,\n    scoreStatus: '100% · Passed',\n    completionDate: 'May 19, 2026',\n    expirationDate: 'May 19, 2027',\n    validityMonths: 12,\n    daysUntilExpiry: 271,\n    credentialId: 'CERT-SEC-6043',\n    sha256Digest: '91ea2d4719fa4429bb56f082c18148a1d65dfc2d4b1fa3d677284addd200126d',\n    verified: true,\n    instructor: 'Jonathan Meyer (Chief Legal Officer & General Counsel)',\n    accreditationBody: 'U.S. Securities and Exchange Commission (SEC)',\n    description:\n      'Material Non-Public Information (MNPI) boundaries, pre-clearance procedures, quarterly trading blackouts, Rule 10b5-1 executive trading plans, and non-selective disclosure protocols.',\n  },\n]\n\nconst filterCategories = [\n  { id: 'all', label: 'All Modules', count: 5 },\n  { id: 'security', label: 'Security & Privacy', count: 2 },\n  { id: 'ethics', label: 'Ethics & Legal', count: 1 },\n  { id: 'governance', label: 'Corporate Governance', count: 1 },\n  { id: 'finance', label: 'Financial Compliance', count: 1 },\n]\n\nexport function TrainingComplianceTracker({ className, defaultFilter = 'all' }: TrainingComplianceTrackerProps) {\n  const [activeFilter, setActiveFilter] = React.useState<string>(defaultFilter)\n  const [searchQuery, setSearchQuery] = React.useState<string>('')\n  const [selectedCertificate, setSelectedCertificate] = React.useState<ComplianceCourse | null>(null)\n  const [retakeModalCourse, setRetakeModalCourse] = React.useState<ComplianceCourse | null>(null)\n  const [isDownloadingAll, setIsDownloadingAll] = React.useState(false)\n  const [downloadBannerMessage, setDownloadBannerMessage] = React.useState<string | null>(null)\n  const [copiedCertId, setCopiedCertId] = React.useState(false)\n  const [copiedDigest, setCopiedDigest] = React.useState(false)\n  const [copiedVerifyUrl, setCopiedVerifyUrl] = React.useState(false)\n  const [retakeSuccessMessage, setRetakeSuccessMessage] = React.useState<string | null>(null)\n\n  const filteredCourses = React.useMemo(() => {\n    return coursesData.filter((course) => {\n      let matchesCategory = true\n      if (activeFilter === 'security') {\n        matchesCategory = course.categoryKey === 'security' || course.categoryKey === 'privacy'\n      } else if (activeFilter === 'ethics') {\n        matchesCategory = course.categoryKey === 'ethics'\n      } else if (activeFilter === 'governance') {\n        matchesCategory = course.categoryKey === 'governance' || course.categoryKey === 'finance'\n      } else if (activeFilter === 'finance') {\n        matchesCategory = course.categoryKey === 'finance'\n      }\n\n      const query = searchQuery.trim().toLowerCase()\n      if (!query) return matchesCategory\n\n      const matchesSearch =\n        course.title.toLowerCase().includes(query) ||\n        course.code.toLowerCase().includes(query) ||\n        course.category.toLowerCase().includes(query) ||\n        course.standard.toLowerCase().includes(query) ||\n        course.credentialId.toLowerCase().includes(query) ||\n        course.instructor.toLowerCase().includes(query)\n\n      return matchesCategory && matchesSearch\n    })\n  }, [activeFilter, searchQuery])\n\n  function handleDownloadAllPdf() {\n    if (isDownloadingAll) return\n    setIsDownloadingAll(true)\n    setDownloadBannerMessage('Compiling 5 verified compliance certificates into archival PDF...')\n\n    setTimeout(() => {\n      setIsDownloadingAll(false)\n      setDownloadBannerMessage('✓ Download complete: Elena_Rostova_Annual_Compliance_Certificates_2026.pdf (1.8 MB)')\n      setTimeout(() => {\n        setDownloadBannerMessage(null)\n      }, 4500)\n    }, 1600)\n  }\n\n  function openCertificateModal(course: ComplianceCourse) {\n    setSelectedCertificate(course)\n    setCopiedCertId(false)\n    setCopiedDigest(false)\n    setCopiedVerifyUrl(false)\n  }\n\n  function closeCertificateModal() {\n    setSelectedCertificate(null)\n  }\n\n  function openRetakeModal(course: ComplianceCourse) {\n    setRetakeModalCourse(course)\n  }\n\n  function closeRetakeModal() {\n    setRetakeModalCourse(null)\n  }\n\n  function handleConfirmRetake() {\n    if (!retakeModalCourse) return\n    const title = retakeModalCourse.title\n    closeRetakeModal()\n    setRetakeSuccessMessage(\n      `Interactive refresher environment launched for \"${title}\". Your existing credential remains valid.`,\n    )\n    setTimeout(() => {\n      setRetakeSuccessMessage(null)\n    }, 4500)\n  }\n\n  function copyToClipboard(text: string, type: 'certId' | 'digest' | 'url') {\n    navigator.clipboard?.writeText(text)\n    if (type === 'certId') {\n      setCopiedCertId(true)\n      setTimeout(() => setCopiedCertId(false), 2000)\n    } else if (type === 'digest') {\n      setCopiedDigest(true)\n      setTimeout(() => setCopiedDigest(false), 2000)\n    } else if (type === 'url') {\n      setCopiedVerifyUrl(true)\n      setTimeout(() => setCopiedVerifyUrl(false), 2000)\n    }\n  }\n\n  React.useEffect(() => {\n    function handleKeyDown(e: KeyboardEvent) {\n      if (e.key === 'Escape') {\n        if (selectedCertificate) closeCertificateModal()\n        if (retakeModalCourse) closeRetakeModal()\n      }\n    }\n    window.addEventListener('keydown', handleKeyDown)\n    return () => window.removeEventListener('keydown', handleKeyDown)\n  }, [selectedCertificate, retakeModalCourse])\n\n  return (\n    <div className={cn('w-full space-y-6', className)}>\n      {/* Header Card */}\n      <Card className=\"border-border bg-card shadow-xs\">\n        <CardContent className=\"p-5 sm:p-6\">\n          <div className=\"flex flex-col gap-6 lg:flex-row lg:items-center lg:justify-between\">\n            {/* Left: Title, Employee Persona, and Department Details */}\n            <div className=\"space-y-3\">\n              <div className=\"flex flex-wrap items-center gap-2\">\n                <span className=\"text-muted-foreground text-xs font-medium\">\n                  Enterprise HRMS & Regulatory Assurance\n                </span>\n                <Badge\n                  wrap\n                  variant=\"outline\"\n                  className=\"border-success/30 bg-success/10 text-success text-xs font-medium\"\n                >\n                  FY 2026–2027 Annual Cycle\n                </Badge>\n              </div>\n\n              <div>\n                <h2 className=\"text-foreground text-xl font-bold tracking-tight sm:text-2xl\">\n                  Mandatory Compliance Training & Certifications\n                </h2>\n                <p className=\"text-muted-foreground mt-1 text-sm\">\n                  Official employee regulatory transcripts, verified digital credentials, and annual recertification\n                  schedules.\n                </p>\n              </div>\n\n              {/* Employee Persona Tag */}\n              <div className=\"text-muted-foreground flex flex-wrap items-center gap-3 pt-1 text-xs\">\n                <div className=\"border-border bg-muted/40 text-foreground flex items-center gap-2 rounded-md border px-2.5 py-1.5 font-medium\">\n                  <div className=\"bg-primary/10 text-primary flex size-5 items-center justify-center rounded-full text-xs font-bold\">\n                    ER\n                  </div>\n                  <span>Elena Rostova · Senior Staff Engineer</span>\n                </div>\n                <div className=\"flex items-center gap-1.5 font-mono tabular-nums\">\n                  <span className=\"text-muted-foreground\">ID:</span>\n                  <span className=\"text-foreground font-medium\">EMP-4092</span>\n                </div>\n                <Separator orientation=\"vertical\" className=\"h-3.5\" />\n                <div className=\"flex items-center gap-1\">\n                  <Building2 className=\"text-muted-foreground size-3.5\" />\n                  <span>Core Platform Infrastructure</span>\n                </div>\n                <Separator orientation=\"vertical\" className=\"h-3.5\" />\n                <div className=\"flex items-center gap-1\">\n                  <span>San Francisco, CA (HQ)</span>\n                </div>\n              </div>\n            </div>\n\n            {/* Right: 100% Compliant Status Pill + Download Action Button */}\n            <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center lg:flex-col lg:items-end\">\n              <div className=\"border-success/30 bg-success/10 text-success dark:bg-success/10 text-success inline-flex items-center gap-2.5 rounded-lg border px-3.5 py-2 text-xs font-semibold shadow-xs\">\n                <ShieldCheck className=\"text-success size-4.5 shrink-0\" />\n                <div className=\"flex flex-col\">\n                  <span>100% Compliant · All 5 Annual Certifications Valid</span>\n                  <span className=\"text-success/90 text-xs font-normal\">\n                    Zero overdue requirements · Audit attested\n                  </span>\n                </div>\n              </div>\n\n              <Button\n                aria-label=\"Download attachment\"\n                variant=\"outline\"\n                size=\"sm\"\n                className=\"hover:bg-accent gap-2 shadow-xs\"\n                disabled={isDownloadingAll}\n                onClick={handleDownloadAllPdf}\n              >\n                {isDownloadingAll ? (\n                  <RefreshCw className=\"size-3.5 animate-spin\" />\n                ) : (\n                  <FileDown className=\"text-foreground size-3.5\" />\n                )}\n                <span>{isDownloadingAll ? 'Generating PDF Bundle...' : 'Download All Certificates PDF'}</span>\n              </Button>\n            </div>\n          </div>\n\n          {/* Dynamic download notification banner */}\n          {downloadBannerMessage && (\n            <div className=\"border-success/30 bg-success/10 text-success dark:bg-success/10 dark:text-foreground mt-4 flex items-center gap-2 rounded-md border p-2.5 text-xs transition-colors\">\n              <CheckCircle2 className=\"text-success size-4 shrink-0\" />\n              <span>{downloadBannerMessage}</span>\n            </div>\n          )}\n\n          {/* Retake success toast notification */}\n          {retakeSuccessMessage && (\n            <div className=\"border-info/30 bg-info/10 text-info dark:bg-info/10 dark:text-foreground mt-4 flex items-center gap-2 rounded-md border p-2.5 text-xs transition-colors\">\n              <RotateCcw className=\"text-info size-4 shrink-0\" />\n              <span>{retakeSuccessMessage}</span>\n            </div>\n          )}\n        </CardContent>\n      </Card>\n\n      {/* 4 Training Overview KPI Cards */}\n      <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n        {/* Card 1: Completed Certifications */}\n        <Card className=\"border-border bg-card shadow-xs transition-[color,background-color,border-color,box-shadow] hover:shadow-sm\">\n          <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n            <CardTitle className=\"text-muted-foreground text-xs font-medium\">Completed Certifications</CardTitle>\n            <div className=\"bg-success/10 text-success flex size-8 items-center justify-center rounded-md\">\n              <Award className=\"size-4.5\" />\n            </div>\n          </CardHeader>\n          <CardContent className=\"space-y-3\">\n            <div>\n              <div className=\"text-foreground flex items-baseline gap-1.5 font-mono text-2xl font-bold tracking-tight tabular-nums\">\n                5 / 5\n              </div>\n              <p className=\"text-muted-foreground text-xs\">Modules Completed · 100% Finished</p>\n            </div>\n            <div className=\"space-y-1\">\n              <Progress value={100} className=\"bg-success/20 h-1.5\" />\n              <div className=\"text-muted-foreground flex items-center justify-between text-xs\">\n                <span className=\"text-success font-medium\">SOC2 & ISO Ready</span>\n                <span className=\"font-mono tabular-nums\">5/5 passed</span>\n              </div>\n            </div>\n          </CardContent>\n        </Card>\n\n        {/* Card 2: Total Training Hours */}\n        <Card className=\"border-border bg-card shadow-xs transition-[color,background-color,border-color,box-shadow] hover:shadow-sm\">\n          <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n            <CardTitle className=\"text-muted-foreground text-xs font-medium\">Total Training Hours</CardTitle>\n            <div className=\"bg-info/10 text-info flex size-8 items-center justify-center rounded-md\">\n              <Clock className=\"size-4.5\" />\n            </div>\n          </CardHeader>\n          <CardContent className=\"space-y-3\">\n            <div>\n              <div className=\"text-foreground flex items-baseline gap-1.5 font-mono text-2xl font-bold tracking-tight tabular-nums\">\n                6.5\n                <span className=\"text-muted-foreground text-sm font-normal\">Hours</span>\n              </div>\n              <p className=\"text-muted-foreground text-xs\">6.5 Hours Logged in 2026</p>\n            </div>\n            <div className=\"space-y-1\">\n              <Progress value={100} className=\"bg-info/20 h-1.5\" />\n              <div className=\"text-muted-foreground flex items-center justify-between text-xs\">\n                <span className=\"text-info font-medium\">Quota: 6.0h Target</span>\n                <span className=\"font-mono tabular-nums\">108% logged</span>\n              </div>\n            </div>\n          </CardContent>\n        </Card>\n\n        {/* Card 3: Next Renewal Due */}\n        <Card className=\"border-border bg-card shadow-xs transition-[color,background-color,border-color,box-shadow] hover:shadow-sm\">\n          <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n            <CardTitle className=\"text-muted-foreground text-xs font-medium\">Next Renewal Due</CardTitle>\n            <div className=\"bg-warning/10 text-warning flex size-8 items-center justify-center rounded-md\">\n              <CalendarClock className=\"size-4.5\" />\n            </div>\n          </CardHeader>\n          <CardContent className=\"space-y-3\">\n            <div>\n              <div className=\"text-foreground font-mono text-lg font-bold tracking-tight tabular-nums sm:text-xl\">\n                April 15, 2027\n              </div>\n              <p className=\"text-warning text-xs font-medium\">In 8 months · Earliest Renewal</p>\n            </div>\n            <div className=\"border-border bg-muted/40 flex items-center justify-between rounded border px-2 py-1 text-xs\">\n              <span className=\"text-muted-foreground truncate\">FCPA Anti-Bribery</span>\n              <Badge wrap variant=\"outline\" className=\"border-warning/30 text-warning font-mono text-xs\">\n                237 days\n              </Badge>\n            </div>\n          </CardContent>\n        </Card>\n\n        {/* Card 4: Company-Wide Compliance */}\n        <Card className=\"border-border bg-card shadow-xs transition-[color,background-color,border-color,box-shadow] hover:shadow-sm\">\n          <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n            <CardTitle className=\"text-muted-foreground text-xs font-medium\">Company-Wide Compliance</CardTitle>\n            <div className=\"bg-chart-1/10 text-chart-1 flex size-8 items-center justify-center rounded-md\">\n              <Users className=\"size-4.5\" />\n            </div>\n          </CardHeader>\n          <CardContent className=\"space-y-3\">\n            <div>\n              <div className=\"text-foreground flex items-baseline gap-1.5 font-mono text-2xl font-bold tracking-tight tabular-nums\">\n                98.4%\n              </div>\n              <p className=\"text-muted-foreground text-xs\">98.4% Staff Certified (1,420/1,443)</p>\n            </div>\n            <div className=\"space-y-1\">\n              <Progress value={98.4} className=\"bg-chart-1/20 h-1.5\" />\n              <div className=\"text-muted-foreground flex items-center justify-between text-xs\">\n                <span className=\"text-chart-1 font-medium\">+1.2% this quarter</span>\n                <span className=\"font-mono tabular-nums\">23 pending</span>\n              </div>\n            </div>\n          </CardContent>\n        </Card>\n      </div>\n\n      {/* Filter Toolbar & Search */}\n      <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n        {/* Category Filter Pills */}\n        <div className=\"flex flex-wrap items-center gap-1.5\">\n          {filterCategories.map((cat) => {\n            const isActive = activeFilter === cat.id\n            return (\n              <button\n                key={cat.id}\n                type=\"button\"\n                className={cn(\n                  'focus-visible:ring-ring inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none',\n                  isActive\n                    ? 'bg-primary text-primary-foreground shadow-xs'\n                    : 'border-border bg-card text-muted-foreground hover:bg-accent hover:text-accent-foreground border',\n                )}\n                onClick={() => setActiveFilter(cat.id)}\n              >\n                <span>{cat.label}</span>\n                <span\n                  className={cn(\n                    'py-0.2 rounded-full px-1.5 font-mono text-xs tabular-nums',\n                    isActive ? 'bg-primary-foreground/20 text-primary-foreground' : 'bg-muted text-muted-foreground',\n                  )}\n                >\n                  {cat.count}\n                </span>\n              </button>\n            )\n          })}\n        </div>\n\n        {/* Search Input */}\n        <div className=\"relative w-full sm:w-64\">\n          <Search className=\"text-muted-foreground absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2\" />\n          <input\n            value={searchQuery}\n            onChange={(e) => setSearchQuery(e.target.value)}\n            type=\"text\"\n            placeholder=\"Filter courses...\"\n            className=\"border-input bg-background text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 h-8 w-full min-w-0 rounded-md border pr-3 pl-8 text-xs focus-visible:ring-2 focus-visible:outline-none\"\n          />\n          {searchQuery && (\n            <button\n              type=\"button\"\n              className=\"text-muted-foreground hover:text-foreground absolute top-1/2 right-2 -translate-y-1/2\"\n              aria-label=\"Clear search\"\n              onClick={() => setSearchQuery('')}\n            >\n              <X className=\"size-3.5\" />\n            </button>\n          )}\n        </div>\n      </div>\n\n      {/* Mandatory Compliance Modules Table Card */}\n      <Card className=\"border-border bg-card shadow-xs\">\n        <CardHeader className=\"p-5 pb-3\">\n          <div className=\"flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between\">\n            <div>\n              <CardTitle className=\"text-foreground text-base font-semibold tracking-tight\">\n                Mandatory Compliance Modules\n              </CardTitle>\n              <CardDescription className=\"text-muted-foreground text-xs\">\n                Annual regulatory curriculum required under corporate governance and SOC 2 / ISO 27001 audit controls.\n              </CardDescription>\n            </div>\n            <div className=\"flex items-center gap-2 pt-2 sm:pt-0\">\n              <span className=\"text-muted-foreground text-xs\">\n                Showing{' '}\n                <span className=\"text-foreground font-mono font-medium tabular-nums\">{filteredCourses.length}</span> of{' '}\n                <span className=\"text-foreground font-mono font-medium tabular-nums\">5</span> modules\n              </span>\n            </div>\n          </div>\n        </CardHeader>\n\n        <CardContent className=\"p-0\">\n          <div className=\"overflow-x-auto\">\n            <Table>\n              <TableHeader className=\"bg-muted/40\">\n                <TableRow className=\"hover:bg-transparent\">\n                  <TableHead className=\"text-muted-foreground min-w-[280px] py-3 text-xs font-semibold tracking-wider uppercase\">\n                    Course Title & Category\n                  </TableHead>\n                  <TableHead className=\"text-muted-foreground min-w-[140px] py-3 text-xs font-semibold tracking-wider uppercase\">\n                    Duration\n                  </TableHead>\n                  <TableHead className=\"text-muted-foreground min-w-[140px] py-3 text-xs font-semibold tracking-wider uppercase\">\n                    Score on Final Assessment\n                  </TableHead>\n                  <TableHead className=\"text-muted-foreground min-w-[120px] py-3 text-xs font-semibold tracking-wider uppercase\">\n                    Completion Date\n                  </TableHead>\n                  <TableHead className=\"text-muted-foreground min-w-[120px] py-3 text-xs font-semibold tracking-wider uppercase\">\n                    Expiration Date\n                  </TableHead>\n                  <TableHead className=\"text-muted-foreground min-w-[160px] py-3 text-xs font-semibold tracking-wider uppercase\">\n                    Certificate Badge\n                  </TableHead>\n                  <TableHead className=\"text-muted-foreground min-w-[180px] py-3 text-right text-xs font-semibold tracking-wider uppercase\">\n                    Actions\n                  </TableHead>\n                </TableRow>\n              </TableHeader>\n\n              <TableBody>\n                {filteredCourses.map((course) => (\n                  <TableRow key={course.id} className=\"hover:bg-muted/30 transition-colors\">\n                    {/* Course Title & Category */}\n                    <TableCell className=\"py-3.5 align-middle\">\n                      <div className=\"space-y-1\">\n                        <div className=\"flex items-center gap-2\">\n                          <span className=\"text-foreground text-sm font-medium\">{{ ...course }.title}</span>\n                        </div>\n                        <div className=\"flex flex-wrap items-center gap-2\">\n                          <Badge wrap variant=\"secondary\" className=\"text-xs font-medium\">\n                            {course.category}\n                          </Badge>\n                          <span className=\"text-muted-foreground font-mono text-xs tabular-nums\">\n                            Code: {course.code}\n                          </span>\n                          <span\n                            className=\"text-muted-foreground max-w-[200px] truncate text-xs\"\n                            title={course.standard}\n                          >\n                            {course.standard}\n                          </span>\n                        </div>\n                      </div>\n                    </TableCell>\n\n                    {/* Duration */}\n                    <TableCell className=\"py-3.5 align-middle\">\n                      <div className=\"text-foreground flex items-center gap-1.5 font-mono text-xs tabular-nums\">\n                        <Clock className=\"text-muted-foreground size-3.5\" />\n                        <span>{course.duration}</span>\n                      </div>\n                    </TableCell>\n\n                    {/* Score on Final Assessment */}\n                    <TableCell className=\"py-3.5 align-middle\">\n                      <div className=\"space-y-1\">\n                        <div className=\"text-success text-success flex items-center gap-1.5 font-mono text-sm font-semibold tabular-nums\">\n                          <CheckCircle2 className=\"size-3.5 shrink-0\" />\n                          <span>{course.scoreStatus}</span>\n                        </div>\n                        <div className=\"text-muted-foreground flex items-center gap-1 text-xs\">\n                          <span>Pass threshold: 80%</span>\n                        </div>\n                      </div>\n                    </TableCell>\n\n                    {/* Completion Date */}\n                    <TableCell className=\"py-3.5 align-middle\">\n                      <div className=\"text-muted-foreground font-mono text-xs tabular-nums\">\n                        {course.completionDate}\n                      </div>\n                    </TableCell>\n\n                    {/* Expiration Date */}\n                    <TableCell className=\"py-3.5 align-middle\">\n                      <div className=\"space-y-0.5\">\n                        <div className=\"text-foreground font-mono text-xs font-medium tabular-nums\">\n                          {course.expirationDate}\n                        </div>\n                        <div className=\"text-success text-success font-mono text-xs tabular-nums\">\n                          Valid ({course.daysUntilExpiry}d remaining)\n                        </div>\n                      </div>\n                    </TableCell>\n\n                    {/* Certificate Badge */}\n                    <TableCell className=\"py-3.5 align-middle\">\n                      <div className=\"space-y-1\">\n                        <div className=\"border-success/30 bg-success/10 text-success inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-semibold\">\n                          <BadgeCheck className=\"text-success size-3.5\" />\n                          <span>Verified Credential</span>\n                        </div>\n                        <div className=\"text-muted-foreground font-mono text-xs tabular-nums\">\n                          {course.credentialId}\n                        </div>\n                      </div>\n                    </TableCell>\n\n                    {/* Actions */}\n                    <TableCell className=\"py-3.5 text-right align-middle\">\n                      <div className=\"flex items-center justify-end gap-1.5\">\n                        <Button\n                          variant=\"outline\"\n                          size=\"xs\"\n                          className=\"hover:bg-accent h-7 gap-1 px-2.5 text-xs font-medium shadow-2xs\"\n                          onClick={() => openCertificateModal(course)}\n                        >\n                          <FileCheck className=\"text-muted-foreground size-3\" />\n                          <span>View Certificate</span>\n                        </Button>\n\n                        <Button\n                          variant=\"ghost\"\n                          size=\"xs\"\n                          className=\"text-muted-foreground hover:text-foreground h-7 gap-1 px-2 text-xs font-medium\"\n                          onClick={() => openRetakeModal(course)}\n                        >\n                          <RotateCcw className=\"size-3\" />\n                          <span>Retake</span>\n                        </Button>\n                      </div>\n                    </TableCell>\n                  </TableRow>\n                ))}\n\n                {filteredCourses.length === 0 && (\n                  <TableRow>\n                    <TableCell colSpan={7} className=\"text-muted-foreground py-8 text-center text-xs\">\n                      No compliance modules match your search or filter criteria.\n                    </TableCell>\n                  </TableRow>\n                )}\n              </TableBody>\n            </Table>\n          </div>\n        </CardContent>\n\n        {/* Trust & Accreditation Sub-Footer */}\n        <CardFooter className=\"border-border bg-muted/20 text-muted-foreground flex flex-col gap-2 border-t p-4 text-xs sm:flex-row sm:items-center sm:justify-between\">\n          <div className=\"flex items-center gap-2\">\n            <Shield className=\"text-success size-4 shrink-0\" />\n            <span>Audited & Attested by Schellman & Co., LLC for SOC 2 Type II & AICPA Security Trust Criteria.</span>\n          </div>\n          <div className=\"flex items-center gap-2 font-mono tabular-nums\">\n            <span>Ledger Sync: Aug 21, 2026 09:42 UTC</span>\n            <span className=\"text-success font-medium\">100% In-Policy</span>\n          </div>\n        </CardFooter>\n      </Card>\n\n      {/* Certificate Inspection Modal */}\n      {selectedCertificate && (\n        <div\n          className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-xs transition-opacity\"\n          onClick={(e) => {\n            if (e.target === e.currentTarget) closeCertificateModal()\n          }}\n        >\n          <div className=\"border-border bg-card text-card-foreground animate-in fade-in zoom-in-95 relative w-full max-w-2xl overflow-hidden rounded-xl border shadow-sm duration-200\">\n            {/* Modal Top Bar */}\n            <div className=\"border-border bg-muted/40 flex items-center justify-between border-b px-5 py-3.5\">\n              <div className=\"flex items-center gap-2\">\n                <div className=\"bg-success/10 text-success flex size-6 items-center justify-center rounded-full\">\n                  <BadgeCheck className=\"size-4\" />\n                </div>\n                <div>\n                  <h3 className=\"text-foreground text-xs font-semibold\">Verified Compliance Credential</h3>\n                  <p className=\"text-muted-foreground font-mono text-xs tabular-nums\">\n                    Credential ID: {selectedCertificate.credentialId}\n                  </p>\n                </div>\n              </div>\n\n              <button\n                type=\"button\"\n                className=\"text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:ring-ring rounded-md p-1 transition-colors focus-visible:ring-2 focus-visible:outline-none\"\n                aria-label=\"Close modal\"\n                onClick={closeCertificateModal}\n              >\n                <X className=\"size-4\" />\n              </button>\n            </div>\n\n            {/* Certificate Body */}\n            <div className=\"space-y-5 p-6\">\n              {/* Certificate Card Frame */}\n              <div className=\"border-success/30 bg-success/5 dark:bg-success/10 relative rounded-lg border-2 border-dashed p-6 text-center\">\n                <div className=\"border-success/40 bg-success/10 text-success text-success mx-auto flex size-12 items-center justify-center rounded-full border shadow-xs\">\n                  <Award className=\"size-6\" />\n                </div>\n\n                <div className=\"mt-3 space-y-1\">\n                  <span className=\"text-success text-xs font-semibold tracking-wide\">\n                    Official Certificate of Mastery & Regulatory Compliance\n                  </span>\n                  <h4 className=\"text-foreground text-lg font-bold\">{selectedCertificate.title}</h4>\n                  <p className=\"text-muted-foreground text-xs\">{selectedCertificate.standard}</p>\n                </div>\n\n                <Separator className=\"my-4\" />\n\n                <div className=\"space-y-1.5\">\n                  <p className=\"text-muted-foreground text-xs\">This certifies that</p>\n                  <p className=\"text-foreground text-base font-bold\">Elena Rostova</p>\n                  <p className=\"text-muted-foreground text-xs\">Senior Staff Engineer · EMP-4092</p>\n                  <p className=\"text-muted-foreground/90 mx-auto max-w-lg pt-1 text-xs leading-relaxed\">\n                    {selectedCertificate.description}\n                  </p>\n                </div>\n\n                {/* Verification Metadata Matrix */}\n                <div className=\"border-border/60 mt-5 grid grid-cols-2 gap-3 border-t pt-4 text-left sm:grid-cols-4\">\n                  <div className=\"space-y-0.5\">\n                    <span className=\"text-muted-foreground text-xs\">Exam Score</span>\n                    <p className=\"text-success text-success font-mono text-xs font-bold tabular-nums\">\n                      {selectedCertificate.scoreStatus}\n                    </p>\n                  </div>\n                  <div className=\"space-y-0.5\">\n                    <span className=\"text-muted-foreground text-xs\">Duration</span>\n                    <p className=\"text-foreground font-mono text-xs font-semibold tabular-nums\">\n                      {selectedCertificate.durationHours} Hours\n                    </p>\n                  </div>\n                  <div className=\"space-y-0.5\">\n                    <span className=\"text-muted-foreground text-xs\">Issued Date</span>\n                    <p className=\"text-foreground font-mono text-xs tabular-nums\">\n                      {selectedCertificate.completionDate}\n                    </p>\n                  </div>\n                  <div className=\"space-y-0.5\">\n                    <span className=\"text-muted-foreground text-xs\">Valid Until</span>\n                    <p className=\"text-foreground font-mono text-xs font-medium tabular-nums\">\n                      {selectedCertificate.expirationDate}\n                    </p>\n                  </div>\n                </div>\n              </div>\n\n              {/* Cryptographic Verification Details */}\n              <div className=\"border-border bg-muted/40 space-y-2 rounded-lg border p-3.5 text-xs\">\n                <div className=\"flex items-center justify-between\">\n                  <div className=\"text-foreground flex items-center gap-1.5 font-medium\">\n                    <ShieldCheck className=\"text-success size-3.5\" />\n                    <span>Cryptographic Digest (SHA-256)</span>\n                  </div>\n                  <button\n                    type=\"button\"\n                    className=\"text-primary flex items-center gap-1 text-xs hover:underline\"\n                    onClick={() => copyToClipboard(selectedCertificate.sha256Digest, 'digest')}\n                  >\n                    {copiedDigest ? <Check className=\"text-success size-3\" /> : <Copy className=\"size-3\" />}\n                    <span>{copiedDigest ? 'Copied' : 'Copy Hash'}</span>\n                  </button>\n                </div>\n                <p className=\"text-muted-foreground font-mono text-xs break-all\">{selectedCertificate.sha256Digest}</p>\n                <div className=\"border-border/50 text-muted-foreground flex flex-wrap items-center justify-between gap-2 border-t pt-1\">\n                  <span>Accreditation: {selectedCertificate.accreditationBody}</span>\n                  <span className=\"font-mono tabular-nums\">Ledger: OpenAttestation v3</span>\n                </div>\n              </div>\n            </div>\n\n            {/* Modal Actions Footer */}\n            <div className=\"border-border bg-muted/40 flex flex-col-reverse gap-2 border-t p-4 sm:flex-row sm:items-center sm:justify-between\">\n              <Button\n                variant=\"ghost\"\n                size=\"sm\"\n                className=\"text-xs\"\n                onClick={() => copyToClipboard(`https://uipkge.dev/verify/${selectedCertificate.credentialId}`, 'url')}\n              >\n                {copiedVerifyUrl ? <Check className=\"text-success size-3.5\" /> : <Share2 className=\"size-3.5\" />}\n                <span>{copiedVerifyUrl ? 'Link Copied!' : 'Copy Verification Link'}</span>\n              </Button>\n\n              <div className=\"flex items-center gap-2\">\n                <Button variant=\"outline\" size=\"sm\" className=\"text-xs\" onClick={closeCertificateModal}>\n                  Close\n                </Button>\n                <Button\n                  aria-label=\"Download attachment\"\n                  variant=\"default\"\n                  size=\"sm\"\n                  className=\"gap-1.5 text-xs shadow-xs\"\n                  onClick={() => {\n                    handleDownloadAllPdf()\n                    closeCertificateModal()\n                  }}\n                >\n                  <Download className=\"size-3.5\" />\n                  <span>Download PDF Certificate</span>\n                </Button>\n              </div>\n            </div>\n          </div>\n        </div>\n      )}\n\n      {/* Retake Course Confirmation Modal */}\n      {retakeModalCourse && (\n        <div\n          className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-xs transition-opacity\"\n          onClick={(e) => {\n            if (e.target === e.currentTarget) closeRetakeModal()\n          }}\n        >\n          <div className=\"border-border bg-card text-card-foreground animate-in fade-in zoom-in-95 relative w-full max-w-lg overflow-hidden rounded-xl border shadow-sm duration-200\">\n            <div className=\"border-border bg-muted/40 flex items-center justify-between border-b px-5 py-3.5\">\n              <div className=\"flex items-center gap-2\">\n                <div className=\"bg-primary/10 text-primary flex size-6 items-center justify-center rounded-full\">\n                  <RotateCcw className=\"size-3.5\" />\n                </div>\n                <h3 className=\"text-foreground text-sm font-bold\">Launch Refresher Assessment</h3>\n              </div>\n              <button\n                aria-label=\"Close retake modal\"\n                type=\"button\"\n                className=\"text-muted-foreground hover:bg-accent hover:text-foreground rounded-md p-1\"\n                onClick={closeRetakeModal}\n              >\n                <X className=\"size-4\" />\n              </button>\n            </div>\n\n            <div className=\"space-y-4 p-5 text-xs\">\n              <div className=\"space-y-1\">\n                <span className=\"text-muted-foreground font-mono text-xs font-medium\">\n                  Module: {retakeModalCourse.code}\n                </span>\n                <h4 className=\"text-foreground text-sm font-semibold\">{retakeModalCourse.title}</h4>\n              </div>\n\n              <div className=\"border-warning/30 bg-warning/10 text-warning rounded-md border p-3\">\n                <div className=\"flex gap-2\">\n                  <AlertCircle className=\"text-warning size-4 shrink-0\" />\n                  <div className=\"space-y-1 leading-relaxed\">\n                    <p className=\"font-semibold\">Notice regarding existing valid credential:</p>\n                    <p>\n                      Your current passing score ({retakeModalCourse.score}%) and verified credential (\n                      {retakeModalCourse.credentialId}) will remain active and valid in company compliance audits until\n                      the new assessment is submitted.\n                    </p>\n                  </div>\n                </div>\n              </div>\n\n              <div className=\"border-border bg-muted/30 grid grid-cols-2 gap-2 rounded-md border p-3 font-mono\">\n                <div>\n                  <span className=\"text-muted-foreground\">Estimated Time:</span>\n                  <p className=\"text-foreground font-semibold\">{retakeModalCourse.duration}</p>\n                </div>\n                <div>\n                  <span className=\"text-muted-foreground\">Passing Threshold:</span>\n                  <p className=\"text-success font-semibold\">80% or Higher</p>\n                </div>\n              </div>\n            </div>\n\n            <div className=\"border-border bg-muted/40 flex items-center justify-end gap-2 border-t p-4\">\n              <Button\n                aria-label=\"Close retake modal\"\n                variant=\"outline\"\n                size=\"sm\"\n                className=\"text-xs\"\n                onClick={closeRetakeModal}\n              >\n                Cancel\n              </Button>\n              <Button variant=\"default\" size=\"sm\" className=\"gap-1.5 text-xs shadow-xs\" onClick={handleConfirmRetake}>\n                <PlayCircle className=\"size-3.5\" />\n                <span>Launch Course Environment</span>\n              </Button>\n            </div>\n          </div>\n        </div>\n      )}\n    </div>\n  )\n}\n\nexport default TrainingComplianceTracker\n",
      "type": "registry:block",
      "target": "~/components/blocks/TrainingComplianceTracker.tsx"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/badge.json",
    "https://uipkge.dev/r/react/button.json",
    "https://uipkge.dev/r/react/card.json",
    "https://uipkge.dev/r/react/progress.json",
    "https://uipkge.dev/r/react/separator.json",
    "https://uipkge.dev/r/react/table.json"
  ],
  "description": "Annual mandatory employee compliance training dashboard with certification badges, renewal deadlines, assessment scorecards, verified credential preview modal, and certificate export controls.",
  "categories": [
    "hr",
    "app",
    "security"
  ]
}