{
  "$schema": "https://uipkge.dev/schema/registry-item.json",
  "name": "field-inspection-manager",
  "title": "Field Inspection Manager",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-angular/blocks/field-inspection-manager/field-inspection-manager.component.ts",
      "content": "// Mobile/Desktop commercial property & equipment site inspection audit manager:\n// GPS geostamp telemetry, 4 KPI metric cards, searchable audits table with pass/fail\n// checklist scores, photo evidence thumbnail gallery with interactive lightbox modal,\n// cryptographic sign-off badges, and work order dispatch workflows.\n// Port of the React block 1:1 — same five records, same copy, same filters.\nimport { ChangeDetectionStrategy, Component, DestroyRef, Input, computed, inject, signal } from '@angular/core'\nimport { NgTemplateOutlet } from '@angular/common'\nimport {\n  AlertCircle,\n  AlertTriangle,\n  Building2,\n  Calendar,\n  Camera,\n  Check,\n  CheckCircle2,\n  ClipboardCheck,\n  Clock,\n  Copy,\n  Download,\n  Eye,\n  LucideAngularModule,\n  MapPin,\n  MoreHorizontal,\n  Percent,\n  Plus,\n  Search,\n  ShieldAlert,\n  ShieldCheck,\n  UploadCloud,\n  Wrench,\n} from 'lucide-angular'\nimport { cn } from '@/lib/utils'\nimport { UiAvatarComponent, UiAvatarFallbackComponent } from '@/ui/avatar/avatar.component'\nimport { UiBadgeComponent } from '@/ui/badge/badge.component'\nimport { UiButtonComponent } from '@/ui/button/button.component'\nimport { UiCardComponent, UiCardContentComponent, UiCardHeaderComponent } from '@/ui/card/card.component'\nimport {\n  UiDialogComponent,\n  UiDialogContentComponent,\n  UiDialogDescriptionComponent,\n  UiDialogFooterComponent,\n  UiDialogHeaderComponent,\n  UiDialogTitleComponent,\n} from '@/ui/dialog/dialog.component'\nimport {\n  UiDropdownMenuComponent,\n  UiDropdownMenuContentComponent,\n  UiDropdownMenuItemComponent,\n  UiDropdownMenuLabelComponent,\n  UiDropdownMenuSeparatorComponent,\n  UiDropdownMenuTriggerComponent,\n} from '@/ui/dropdown-menu/dropdown-menu.component'\nimport { UiInputComponent } from '@/ui/input/input.component'\nimport {\n  UiSelectComponent,\n  UiSelectContentComponent,\n  UiSelectItemComponent,\n  UiSelectTriggerComponent,\n  UiSelectValueComponent,\n} from '@/ui/select/select.component'\nimport {\n  UiTableBodyComponent,\n  UiTableCellComponent,\n  UiTableComponent,\n  UiTableHeadComponent,\n  UiTableHeaderComponent,\n  UiTableRowComponent,\n} from '@/ui/table/table.component'\n\nexport type InspectionStatus = 'passed' | 'critical' | 'minor'\nexport type InspectionFilter = 'all' | 'passed' | 'critical' | 'minor'\n\nexport interface PhotoEvidence {\n  id: string\n  title: string\n  caption: string\n  time: string\n  previewType:\n    | 'gauge'\n    | 'coil'\n    | 'mount'\n    | 'thermal'\n    | 'box'\n    | 'conduit'\n    | 'riser'\n    | 'pump'\n    | 'switch'\n    | 'tank'\n    | 'battery'\n    | 'ats'\n    | 'spall'\n    | 'rebar'\n    | 'crack'\n}\n\nexport interface ChecklistItem {\n  id: string\n  label: string\n  status: 'pass' | 'fail' | 'minor'\n  value: string\n}\n\nexport interface InspectionRecord {\n  id: string\n  assetId: string\n  assetName: string\n  category: string\n  facility: string\n  buildingBadge: string\n  date: string\n  time: string\n  gps: string\n  gpsAccuracy: string\n  scorePassed: number\n  scoreTotal: number\n  status: InspectionStatus\n  statusLabel: string\n  duration: string\n  defectSummary?: string\n  workOrder?: string\n  photos: PhotoEvidence[]\n  inspector: {\n    name: string\n    role: string\n    initials: string\n    badge: string\n    signoffStatus: string\n    signoffHash: string\n  }\n  checklist: ChecklistItem[]\n}\n\nconst defaultRecords: InspectionRecord[] = [\n  {\n    id: 'insp-1',\n    assetId: 'AST-HVAC-4091',\n    assetName: 'Commercial HVAC Chiller Unit #4',\n    category: 'HVAC & Thermal Systems',\n    facility: 'Building A · Rooftop Mechanical Room',\n    buildingBadge: 'Bldg A',\n    date: 'Aug 21, 2026',\n    time: '09:15 AM EDT',\n    gps: '34.0522°N, 118.2437°W',\n    gpsAccuracy: '±2.4m',\n    scorePassed: 18,\n    scoreTotal: 18,\n    status: 'passed',\n    statusLabel: '18 / 18 Passed',\n    duration: '26 mins',\n    photos: [\n      {\n        id: 'p1-1',\n        title: 'Compressor Suction Manifold',\n        caption: 'Suction pressure holding steady at 68.4 PSI; temperature sensor verified within calibration spec.',\n        time: '09:18 AM',\n        previewType: 'gauge',\n      },\n      {\n        id: 'p1-2',\n        title: 'Condenser Fan Coil Assembly',\n        caption: 'Clean aluminum fin surfaces with zero debris obstruction; axial fan bearings lubricated.',\n        time: '09:24 AM',\n        previewType: 'coil',\n      },\n      {\n        id: 'p1-3',\n        title: 'Vibration Dampener Isolators',\n        caption: 'Neoprene spring isolator pads intact with zero hairline settling fractures or mounting deflection.',\n        time: '09:32 AM',\n        previewType: 'mount',\n      },\n    ],\n    inspector: {\n      name: 'Marcus Vance',\n      role: 'Senior Field Engineer',\n      initials: 'MV',\n      badge: 'PE #84920-CA',\n      signoffStatus: 'Verified Cryptographic Sign-off',\n      signoffHash: 'SHA-256: 9f8e21...41a2',\n    },\n    checklist: [\n      {\n        id: 'c1-1',\n        label: 'Refrigerant Charge & Pressures',\n        status: 'pass',\n        value: '68.4 PSI Suction / 225 PSI Discharge',\n      },\n      { id: 'c1-2', label: 'Compressor Motor Amp Draw', status: 'pass', value: '42.1A (rated 46A max)' },\n      { id: 'c1-3', label: 'Chilled Water Loop Delta-T', status: 'pass', value: '10.2°F Temperature Drop' },\n      { id: 'c1-4', label: 'Emergency High-Pressure Cutout', status: 'pass', value: 'Trips accurately at 380 PSI' },\n    ],\n  },\n  {\n    id: 'insp-2',\n    assetId: 'AST-SOLAR-1082',\n    assetName: 'Rooftop Solar Array & Inverters',\n    category: 'Renewable Energy & Power',\n    facility: 'Building C · South Wing Solar Deck',\n    buildingBadge: 'Bldg C',\n    date: 'Aug 21, 2026',\n    time: '10:45 AM EDT',\n    gps: '34.0528°N, 118.2445°W',\n    gpsAccuracy: '±1.8m',\n    scorePassed: 14,\n    scoreTotal: 18,\n    status: 'critical',\n    statusLabel: '14 / 18 - 2 Critical Fails',\n    duration: '34 mins',\n    defectSummary: 'DC string combiner box busbar overheating (84.2°C); micro-inverter #6 circuit failure.',\n    workOrder: 'WO-SOLAR-4921 (High Priority Dispatched)',\n    photos: [\n      {\n        id: 'p2-1',\n        title: 'Inverter #6 Thermal Hotspot',\n        caption: 'FLIR radiometric thermography shows 84.2°C localized hotspot at DC-AC bridge capacitor.',\n        time: '10:52 AM',\n        previewType: 'thermal',\n      },\n      {\n        id: 'p2-2',\n        title: 'Combiner Box Arc Degradation',\n        caption: 'Busbar contact surface oxidation with heat discoloration and slight terminal pitting.',\n        time: '11:04 AM',\n        previewType: 'box',\n      },\n      {\n        id: 'p2-3',\n        title: 'PV String #4 Conduit Ingress',\n        caption: 'Degraded rubber gasket on string junction conduit fitting allowing moisture penetration.',\n        time: '11:12 AM',\n        previewType: 'conduit',\n      },\n    ],\n    inspector: {\n      name: 'Marcus Vance',\n      role: 'Senior Field Engineer',\n      initials: 'MV',\n      badge: 'PE #84920-CA',\n      signoffStatus: 'Critical Defect Action Required',\n      signoffHash: 'SHA-256: 4c3d88...71ef',\n    },\n    checklist: [\n      {\n        id: 'c2-1',\n        label: 'Combiner Box Busbar Temp',\n        status: 'fail',\n        value: '84.2°C (exceeds 65°C safe operating limit)',\n      },\n      { id: 'c2-2', label: 'Micro-inverter #6 Communication', status: 'fail', value: 'Modbus timeout / Offline state' },\n      { id: 'c2-3', label: 'PV Panel Surface Clarity', status: 'pass', value: 'Soiling index < 1.8%' },\n      { id: 'c2-4', label: 'Rapid Shutdown System', status: 'pass', value: 'Voltages drop < 30V in 12s' },\n    ],\n  },\n  {\n    id: 'insp-3',\n    assetId: 'AST-FIRE-8820',\n    assetName: 'Fire Suppression & Sprinkler System',\n    category: 'Life Safety & Protection',\n    facility: 'Main Tower · Sub-Basement Pump Room B2',\n    buildingBadge: 'Tower B2',\n    date: 'Aug 21, 2026',\n    time: '11:30 AM EDT',\n    gps: '34.0515°N, 118.2420°W',\n    gpsAccuracy: '±3.1m',\n    scorePassed: 17,\n    scoreTotal: 18,\n    status: 'minor',\n    statusLabel: '17 / 18 - 1 Minor Defect',\n    duration: '22 mins',\n    defectSummary: 'Main riser pressure gauge annual NIST calibration tag expired by 21 days; pressure intact.',\n    workOrder: 'WO-FIRE-8820 (Standard Calibration Scheduled)',\n    photos: [\n      {\n        id: 'p3-1',\n        title: 'Main Riser Pressure Gauge',\n        caption: 'Static pressure 145 PSI (nominal). Calibration tag stamped 07/2025 requiring routine re-tagging.',\n        time: '11:34 AM',\n        previewType: 'riser',\n      },\n      {\n        id: 'p3-2',\n        title: 'Jockey Pump Shaft Packing',\n        caption: 'Packing gland seal dry with zero leakage; auto start/stop pressure cutoff cycle verified.',\n        time: '11:41 AM',\n        previewType: 'pump',\n      },\n      {\n        id: 'p3-3',\n        title: 'OS&Y Tamper Supervisory Switch',\n        caption: 'Zone 1 control valve open; tamper switch sends instant supervisory signal to FACP.',\n        time: '11:48 AM',\n        previewType: 'switch',\n      },\n    ],\n    inspector: {\n      name: 'Marcus Vance',\n      role: 'Senior Field Engineer',\n      initials: 'MV',\n      badge: 'PE #84920-CA',\n      signoffStatus: 'Verified Cryptographic Sign-off',\n      signoffHash: 'SHA-256: 7d1a99...33bc',\n    },\n    checklist: [\n      { id: 'c3-1', label: 'System Static Water Pressure', status: 'pass', value: '145 PSI static / 125 PSI residual' },\n      {\n        id: 'c3-2',\n        label: 'Riser Gauge Calibration Tag',\n        status: 'minor',\n        value: 'Overdue by 21 days (recalibration due)',\n      },\n      { id: 'c3-3', label: 'Diesel Fire Pump Auto-Start', status: 'pass', value: 'Cranked to 1750 RPM in 4.2s' },\n      { id: 'c3-4', label: 'Flow Alarm Switch Delay', status: 'pass', value: 'Gong chime triggered at 32s' },\n    ],\n  },\n  {\n    id: 'insp-4',\n    assetId: 'AST-GEN-3304',\n    assetName: 'Emergency Backup Generator #2',\n    category: 'Emergency Standby Power',\n    facility: 'East Campus · Utility Pad North',\n    buildingBadge: 'East Pad',\n    date: 'Aug 21, 2026',\n    time: '01:15 PM EDT',\n    gps: '34.0535°N, 118.2450°W',\n    gpsAccuracy: '±2.1m',\n    scorePassed: 18,\n    scoreTotal: 18,\n    status: 'passed',\n    statusLabel: '18 / 18 Passed',\n    duration: '29 mins',\n    photos: [\n      {\n        id: 'p4-1',\n        title: 'Diesel Sub-Base Day Tank',\n        caption:\n          'Ultra-low sulfur diesel fuel level at 98.4%; optical fuel water separator clean with zero particulate.',\n        time: '01:21 PM',\n        previewType: 'tank',\n      },\n      {\n        id: 'p4-2',\n        title: '24V Dual Starter Battery Bank',\n        caption: 'Terminal posts clean with dielectric grease coating; float charging verified at 27.6V.',\n        time: '01:28 PM',\n        previewType: 'battery',\n      },\n      {\n        id: 'p4-3',\n        title: '800A ATS Transfer Switch',\n        caption: 'Phase alignment and mechanical interlocking verified; utility power sync nominal.',\n        time: '01:38 PM',\n        previewType: 'ats',\n      },\n    ],\n    inspector: {\n      name: 'Marcus Vance',\n      role: 'Senior Field Engineer',\n      initials: 'MV',\n      badge: 'PE #84920-CA',\n      signoffStatus: 'Verified Cryptographic Sign-off',\n      signoffHash: 'SHA-256: 3a7b54...82e9',\n    },\n    checklist: [\n      { id: 'c4-1', label: 'Engine Crank & Run Test', status: 'pass', value: '60 Hz output reached in 6.8s' },\n      { id: 'c4-2', label: 'Coolant Jacket Heater Temp', status: 'pass', value: '118°F Block temperature' },\n      { id: 'c4-3', label: 'Oil Pressure & Level', status: 'pass', value: '55 PSI running oil pressure' },\n      { id: 'c4-4', label: 'Exhaust Silencer & Insulation', status: 'pass', value: 'Zero exhaust gas or soot leakage' },\n    ],\n  },\n  {\n    id: 'insp-5',\n    assetId: 'AST-STR-0019',\n    assetName: 'Structural Foundation & Load Beams',\n    category: 'Structural Integrity & Civil',\n    facility: 'Parking Structure · Level P3 Pillar Grid 4D',\n    buildingBadge: 'P3 Grid 4D',\n    date: 'Aug 21, 2026',\n    time: '02:40 PM EDT',\n    gps: '34.0510°N, 118.2412°W',\n    gpsAccuracy: '±1.9m',\n    scorePassed: 16,\n    scoreTotal: 18,\n    status: 'critical',\n    statusLabel: '16 / 18 - 2 Critical Fails',\n    duration: '31 mins',\n    defectSummary:\n      'Concrete shear spall at beam joint 4D corbel; exposed tension rebar #6 exhibiting active oxidation.',\n    workOrder: 'WO-STR-4922 (Structural Engineer On-Site)',\n    photos: [\n      {\n        id: 'p5-1',\n        title: 'Pillar 4D Beam Shear Spall',\n        caption: 'Concrete shear delamination (18cm wide x 4cm depth) near primary corbel support bracket.',\n        time: '02:46 PM',\n        previewType: 'spall',\n      },\n      {\n        id: 'p5-2',\n        title: 'Exposed Steel Rebar Oxidation',\n        caption: 'Deformed rebar #6 exposed to ambient moisture with active ferric surface oxidation.',\n        time: '02:54 PM',\n        previewType: 'rebar',\n      },\n      {\n        id: 'p5-3',\n        title: 'Optical Crack Comparator Test',\n        caption: 'Structural hairline fissure width measured at 2.2mm across tension face (spec max 0.3mm).',\n        time: '03:02 PM',\n        previewType: 'crack',\n      },\n    ],\n    inspector: {\n      name: 'Marcus Vance',\n      role: 'Senior Field Engineer',\n      initials: 'MV',\n      badge: 'PE #84920-CA',\n      signoffStatus: 'Critical Defect Action Required',\n      signoffHash: 'SHA-256: 8e5f12...04db',\n    },\n    checklist: [\n      { id: 'c5-1', label: 'Concrete Cover Spalling', status: 'fail', value: '18cm spall at corbel connection' },\n      {\n        id: 'c5-2',\n        label: 'Structural Crack Aperture',\n        status: 'fail',\n        value: '2.2mm fissure (exceeds 0.3mm tolerance)',\n      },\n      { id: 'c5-3', label: 'Expansion Joint Elastomer', status: 'pass', value: 'Sealant elasticity within spec' },\n      { id: 'c5-4', label: 'Drainage Channel Clearance', status: 'pass', value: 'Deck scuppers free of sediment' },\n    ],\n  },\n]\n\n@Component({\n  changeDetection: ChangeDetectionStrategy.Eager,\n  selector: 'ui-field-inspection-manager, [ui-field-inspection-manager]',\n  standalone: true,\n  // React renders the root <div> itself: the host stays out of layout and `class` goes to the root.\n  host: { '[attr.class]': '\"contents\"' },\n  imports: [\n    LucideAngularModule,\n    NgTemplateOutlet,\n    UiAvatarComponent,\n    UiAvatarFallbackComponent,\n    UiBadgeComponent,\n    UiButtonComponent,\n    UiCardComponent,\n    UiCardContentComponent,\n    UiCardHeaderComponent,\n    UiDialogComponent,\n    UiDialogContentComponent,\n    UiDialogDescriptionComponent,\n    UiDialogFooterComponent,\n    UiDialogHeaderComponent,\n    UiDialogTitleComponent,\n    UiDropdownMenuComponent,\n    UiDropdownMenuContentComponent,\n    UiDropdownMenuItemComponent,\n    UiDropdownMenuLabelComponent,\n    UiDropdownMenuSeparatorComponent,\n    UiDropdownMenuTriggerComponent,\n    UiInputComponent,\n    UiSelectComponent,\n    UiSelectContentComponent,\n    UiSelectItemComponent,\n    UiSelectTriggerComponent,\n    UiSelectValueComponent,\n    UiTableBodyComponent,\n    UiTableCellComponent,\n    UiTableComponent,\n    UiTableHeadComponent,\n    UiTableHeaderComponent,\n    UiTableRowComponent,\n  ],\n  template: `\n    <div data-slot=\"field-inspection-manager\" [class]=\"rootClass\">\n      <!-- TOAST NOTIFICATION BANNER -->\n      @if (toastMessage()) {\n        <div\n          class=\"border-primary/30 bg-primary/10 text-foreground fixed top-4 right-4 z-50 flex items-center gap-2 rounded-lg border px-4 py-2.5 text-xs font-medium shadow-lg backdrop-blur-md\"\n        >\n          <lucide-icon [img]=\"CheckCircle2\" class=\"text-primary size-4 shrink-0\" />\n          <span>{{ toastMessage() }}</span>\n        </div>\n      }\n\n      <!-- MAIN HEADER: TITLE, INSPECTOR BADGE, ON-TIME STATUS, ACTION CTA -->\n      <div ui-card class=\"border-border shadow-xs\">\n        <div ui-card-header class=\"flex flex-col gap-4 pb-6 lg:flex-row lg:items-start lg:justify-between\">\n          <div class=\"space-y-2\">\n            <!-- Compliance Pills & Live Status -->\n            <div class=\"flex flex-wrap items-center gap-2\">\n              <span ui-badge variant=\"outline\" class=\"gap-1.5 font-mono text-xs\">\n                <lucide-icon [img]=\"ClipboardCheck\" class=\"text-primary size-3.5\" aria-hidden=\"true\" />\n                ISO-55001 & OSHA Audit Matrix\n              </span>\n\n              <!-- Emerald Status Badge -->\n              <div\n                class=\"border-success/20 bg-success/10 text-success inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium\"\n              >\n                <span class=\"relative flex size-1.5\">\n                  <span class=\"bg-success absolute inline-flex h-full w-full rounded-full opacity-75\"></span>\n                  <span class=\"bg-success relative inline-flex size-1.5 rounded-full\"></span>\n                </span>\n                8 Audits Completed Today · 100% On-Time\n              </div>\n            </div>\n\n            <!-- Title & Inspector Subtext -->\n            <div>\n              <h1 class=\"text-foreground text-xl font-bold tracking-tight sm:text-2xl\">\n                Site & Asset Inspection Audits\n              </h1>\n              <div class=\"text-muted-foreground mt-1 flex flex-wrap items-center gap-2 text-xs sm:text-sm\">\n                <div class=\"text-foreground flex items-center gap-1.5 font-medium\">\n                  <ui-avatar class=\"border-border size-5 border\">\n                    <ui-avatar-fallback class=\"bg-primary/10 text-primary text-xs font-bold\">MV</ui-avatar-fallback>\n                  </ui-avatar>\n                  <span>Marcus Vance</span>\n                </div>\n                <span class=\"text-muted-foreground\">Senior Field Engineer (PE #84920-CA)</span>\n                <span class=\"text-muted-foreground font-mono\">Terminal: Apex Facility West</span>\n              </div>\n            </div>\n          </div>\n\n          <!-- Action CTAs -->\n          <div class=\"flex flex-wrap items-center gap-2.5 pt-1\">\n            <button\n              ui-button\n              aria-label=\"Download attachment\"\n              variant=\"outline\"\n              size=\"sm\"\n              class=\"gap-1.5 text-xs font-medium shadow-xs\"\n              (click)=\"showToast('Exporting complete site inspection audit summary CSV...')\"\n            >\n              <lucide-icon [img]=\"Download\" class=\"size-3.5\" aria-hidden=\"true\" />\n              Export Audits CSV\n            </button>\n\n            <button\n              ui-button\n              size=\"sm\"\n              class=\"gap-1.5 text-xs font-medium shadow-xs\"\n              (click)=\"handleStartNewInspection()\"\n            >\n              <lucide-icon [img]=\"Plus\" class=\"size-3.5\" aria-hidden=\"true\" />\n              Start New Inspection\n            </button>\n          </div>\n        </div>\n      </div>\n\n      <!-- 4 FIELD INSPECTION METRIC KPI CARDS -->\n      <div class=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n        <div ui-card class=\"border-border shadow-xs\">\n          <div ui-card-content class=\"p-4 sm:p-5\">\n            <div class=\"flex items-center justify-between\">\n              <span class=\"text-muted-foreground text-xs font-medium\">Completed Inspections</span>\n              <div\n                class=\"border-success/20 bg-success/10 text-success flex size-8 items-center justify-center rounded-md border\"\n              >\n                <lucide-icon [img]=\"CheckCircle2\" class=\"size-4\" aria-hidden=\"true\" />\n              </div>\n            </div>\n            <div class=\"mt-3\">\n              <div class=\"text-foreground text-2xl font-bold tracking-tight tabular-nums\">24</div>\n              <div class=\"text-muted-foreground mt-1 flex items-center gap-1.5 text-xs\">\n                <span class=\"text-success font-medium\">24 Audits This Week</span>\n                <span>·</span>\n                <span class=\"text-muted-foreground\">+14.2% vs target</span>\n              </div>\n            </div>\n          </div>\n        </div>\n\n        <div ui-card class=\"border-border shadow-xs\">\n          <div ui-card-content class=\"p-4 sm:p-5\">\n            <div class=\"flex items-center justify-between\">\n              <span class=\"text-muted-foreground text-xs font-medium\">Critical Defects Flagged</span>\n              <div\n                class=\"border-destructive/20 bg-destructive/10 text-destructive flex size-8 items-center justify-center rounded-md border\"\n              >\n                <lucide-icon [img]=\"ShieldAlert\" class=\"size-4\" aria-hidden=\"true\" />\n              </div>\n            </div>\n            <div class=\"mt-3\">\n              <div class=\"text-foreground text-2xl font-bold tracking-tight tabular-nums\">2</div>\n              <div class=\"text-muted-foreground mt-1 flex items-center gap-1.5 text-xs\">\n                <span class=\"text-destructive font-semibold\">2 Critical Deficiencies</span>\n                <span>·</span>\n                <span class=\"text-muted-foreground\">Work Orders Dispatched</span>\n              </div>\n            </div>\n          </div>\n        </div>\n\n        <div ui-card class=\"border-border shadow-xs\">\n          <div ui-card-content class=\"p-4 sm:p-5\">\n            <div class=\"flex items-center justify-between\">\n              <span class=\"text-muted-foreground text-xs font-medium\">First-Time Pass Rate</span>\n              <div\n                class=\"border-primary/20 bg-primary/10 text-primary flex size-8 items-center justify-center rounded-md border\"\n              >\n                <lucide-icon [img]=\"Percent\" class=\"size-4\" aria-hidden=\"true\" />\n              </div>\n            </div>\n            <div class=\"mt-3\">\n              <div class=\"text-foreground text-2xl font-bold tracking-tight tabular-nums\">91.6%</div>\n              <div class=\"text-muted-foreground mt-1 flex items-center gap-1.5 text-xs\">\n                <span class=\"text-success font-medium\">91.6% Pass Rate</span>\n                <span>·</span>\n                <span class=\"text-muted-foreground\">Above 90.0% SLA</span>\n              </div>\n            </div>\n          </div>\n        </div>\n\n        <div ui-card class=\"border-border shadow-xs\">\n          <div ui-card-content class=\"p-4 sm:p-5\">\n            <div class=\"flex items-center justify-between\">\n              <span class=\"text-muted-foreground text-xs font-medium\">Avg Inspection Duration</span>\n              <div\n                class=\"border-warning/20 bg-warning/10 text-warning flex size-8 items-center justify-center rounded-md border\"\n              >\n                <lucide-icon [img]=\"Clock\" class=\"size-4\" aria-hidden=\"true\" />\n              </div>\n            </div>\n            <div class=\"mt-3\">\n              <div class=\"text-foreground text-2xl font-bold tracking-tight tabular-nums\">28m</div>\n              <div class=\"text-muted-foreground mt-1 flex items-center gap-1.5 text-xs\">\n                <span class=\"text-foreground font-medium\">28 mins / audit</span>\n                <span>·</span>\n                <span class=\"text-success\">-4m vs benchmark</span>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <!-- SEARCH & FILTER TOOLBAR -->\n      <div ui-card class=\"border-border shadow-xs\">\n        <div ui-card-content class=\"p-4\">\n          <div class=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n            <!-- Filter Tabs / Pills -->\n            <div class=\"flex flex-wrap items-center gap-1.5\">\n              <button type=\"button\" [class]=\"filterPillClass('all')\" (click)=\"activeFilter.set('all')\">\n                All Audits (5)\n              </button>\n              <button type=\"button\" [class]=\"filterPillClass('passed')\" (click)=\"activeFilter.set('passed')\">\n                <lucide-icon [img]=\"CheckCircle2\" class=\"size-3.5\" />\n                Passed (2)\n              </button>\n              <button type=\"button\" [class]=\"filterPillClass('critical')\" (click)=\"activeFilter.set('critical')\">\n                <lucide-icon [img]=\"AlertTriangle\" class=\"size-3.5\" />\n                Critical Defects (2)\n              </button>\n              <button type=\"button\" [class]=\"filterPillClass('minor')\" (click)=\"activeFilter.set('minor')\">\n                <lucide-icon [img]=\"AlertCircle\" class=\"size-3.5\" />\n                Minor Issues (1)\n              </button>\n            </div>\n\n            <!-- Search Input & Facility Selector -->\n            <div class=\"flex flex-wrap items-center gap-2\">\n              <div class=\"w-full sm:w-48\">\n                <ui-select [value]=\"selectedFacility()\" (valueChange)=\"setSelectedFacility($event)\">\n                  <button ui-select-trigger class=\"h-8 text-xs\">\n                    <ui-select-value placeholder=\"All Facilities\" />\n                  </button>\n                  <ui-select-content>\n                    <ui-select-item value=\"all\">All Facilities (5)</ui-select-item>\n                    <ui-select-item value=\"Building A\">Building A (2)</ui-select-item>\n                    <ui-select-item value=\"Building B\">Building B (1)</ui-select-item>\n                    <ui-select-item value=\"Building C\">Building C (1)</ui-select-item>\n                    <ui-select-item value=\"Parking Structure\">Parking Structure (1)</ui-select-item>\n                  </ui-select-content>\n                </ui-select>\n              </div>\n\n              <div class=\"relative w-full sm:w-64\">\n                <lucide-icon\n                  [img]=\"Search\"\n                  class=\"text-muted-foreground absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2\"\n                />\n                <ui-input\n                  [value]=\"searchQuery()\"\n                  (valueChange)=\"searchQuery.set($event)\"\n                  type=\"text\"\n                  placeholder=\"Search asset, ID, category...\"\n                  class=\"h-8 pl-8 text-xs\"\n                />\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <!-- AUDIT RECORDS DATA TABLE -->\n      <div ui-card class=\"border-border overflow-hidden shadow-xs\">\n        <div class=\"overflow-x-auto\">\n          <table ui-table>\n            <thead ui-table-header>\n              <tr ui-table-row class=\"bg-muted/30\">\n                <th ui-table-head class=\"text-foreground w-[220px] text-xs font-semibold\">Asset & Facility</th>\n                <th ui-table-head class=\"text-foreground text-xs font-semibold\">Date & GPS Stamping</th>\n                <th ui-table-head class=\"text-foreground text-xs font-semibold\">Inspection Checklist</th>\n                <th ui-table-head class=\"text-foreground text-xs font-semibold\">Status & Work Order</th>\n                <th ui-table-head class=\"text-foreground text-xs font-semibold\">Photographic Evidence</th>\n                <th ui-table-head class=\"text-foreground text-xs font-semibold\">Inspector & Sign-off</th>\n                <th ui-table-head class=\"text-foreground text-right text-xs font-semibold\">Actions</th>\n              </tr>\n            </thead>\n            <tbody ui-table-body>\n              @for (record of filteredRecords(); track record.id) {\n                <tr ui-table-row class=\"border-border hover:bg-muted/20 transition-colors\">\n                  <!-- 1. Asset & Facility -->\n                  <td ui-table-cell class=\"py-3.5 align-top\">\n                    <div class=\"space-y-1\">\n                      <div class=\"flex items-center gap-1.5\">\n                        <span class=\"text-foreground text-xs font-bold\">{{ record.assetName }}</span>\n                        <span ui-badge variant=\"outline\" class=\"font-mono text-xs\">{{ record.buildingBadge }}</span>\n                      </div>\n                      <div class=\"text-muted-foreground font-mono text-xs\">{{ record.assetId }}</div>\n                      <div class=\"text-muted-foreground/90 flex items-center gap-1 text-xs\">\n                        <lucide-icon [img]=\"Building2\" class=\"size-3 shrink-0\" />\n                        <span class=\"truncate\">{{ record.facility }}</span>\n                      </div>\n                    </div>\n                  </td>\n\n                  <!-- 2. Date & GPS Stamping -->\n                  <td ui-table-cell class=\"py-3.5 align-top\">\n                    <div class=\"space-y-1\">\n                      <div class=\"text-foreground flex items-center gap-1 text-xs font-medium\">\n                        <lucide-icon [img]=\"Calendar\" class=\"text-muted-foreground size-3\" />\n                        <span>{{ record.date }}</span>\n                      </div>\n                      <div class=\"text-muted-foreground flex items-center gap-1 font-mono text-xs\">\n                        <lucide-icon [img]=\"Clock\" class=\"size-3\" />\n                        <span>{{ record.time }} ({{ record.duration }})</span>\n                      </div>\n                      <button\n                        type=\"button\"\n                        [attr.aria-label]=\"'Copy GPS coordinates for ' + record.assetId + ': ' + record.gps\"\n                        class=\"border-border hover:bg-muted focus-visible:ring-ring bg-muted/40 text-muted-foreground inline-flex cursor-pointer items-center gap-1 rounded border px-2 py-0.5 font-mono text-xs transition-colors focus-visible:ring-2 focus-visible:outline-none\"\n                        (click)=\"copyGps(record.gps, record.id)\"\n                      >\n                        <lucide-icon [img]=\"MapPin\" class=\"text-primary size-2.5\" />\n                        <span>{{ record.gps }}</span>\n                        @if (copiedGpsId() === record.id) {\n                          <lucide-icon [img]=\"Check\" class=\"text-success size-2.5\" />\n                        } @else {\n                          <lucide-icon [img]=\"Copy\" class=\"text-muted-foreground/60 size-2.5\" />\n                        }\n                      </button>\n                    </div>\n                  </td>\n\n                  <!-- 3. Inspection Checklist -->\n                  <td ui-table-cell class=\"py-3.5 align-top\">\n                    <div class=\"w-48 space-y-1.5\">\n                      <div class=\"flex items-center justify-between text-xs\">\n                        <span class=\"text-muted-foreground font-medium\">Score</span>\n                        <span [class]=\"scoreClass(record.status)\">{{ record.statusLabel }}</span>\n                      </div>\n                      <div class=\"bg-muted h-1.5 w-full overflow-hidden rounded-full\">\n                        <div\n                          [class]=\"scoreBarClass(record.status)\"\n                          [style.width]=\"(record.scorePassed / record.scoreTotal) * 100 + '%'\"\n                        ></div>\n                      </div>\n                      <div class=\"text-muted-foreground space-y-0.5 text-xs\">\n                        @for (item of record.checklist.slice(0, 2); track item.id) {\n                          <div class=\"flex items-center gap-1 truncate font-mono text-xs\">\n                            @if (item.status === 'pass') {\n                              <lucide-icon [img]=\"CheckCircle2\" class=\"text-success size-2.5 shrink-0\" />\n                            } @else if (item.status === 'fail') {\n                              <lucide-icon [img]=\"AlertTriangle\" class=\"text-destructive size-2.5 shrink-0\" />\n                            } @else {\n                              <lucide-icon [img]=\"AlertCircle\" class=\"text-warning size-2.5 shrink-0\" />\n                            }\n                            <span class=\"truncate\">{{ item.label }}: {{ item.value }}</span>\n                          </div>\n                        }\n                      </div>\n                    </div>\n                  </td>\n\n                  <!-- 4. Status & Work Order -->\n                  <td ui-table-cell class=\"py-3.5 align-top\">\n                    <div class=\"space-y-1.5\">\n                      <span\n                        ui-badge\n                        [variant]=\"record.status === 'passed' ? 'default' : 'destructive'\"\n                        [class]=\"statusBadgeClass(record.status)\"\n                      >\n                        @if (record.status === 'passed') {\n                          <lucide-icon [img]=\"CheckCircle2\" class=\"mr-1 size-3\" />\n                        } @else if (record.status === 'critical') {\n                          <lucide-icon [img]=\"AlertTriangle\" class=\"mr-1 size-3\" />\n                        } @else {\n                          <lucide-icon [img]=\"AlertCircle\" class=\"mr-1 size-3\" />\n                        }\n                        {{ record.status }}\n                      </span>\n\n                      @if (record.defectSummary) {\n                        <p class=\"text-destructive max-w-[200px] text-xs leading-tight font-medium\">\n                          {{ record.defectSummary }}\n                        </p>\n                      } @else {\n                        <p class=\"text-muted-foreground text-xs leading-tight\">\n                          All calibration points verified within tolerance.\n                        </p>\n                      }\n\n                      @if (record.workOrder) {\n                        <div class=\"pt-0.5\">\n                          <span\n                            class=\"border-border bg-muted/30 text-muted-foreground inline-flex items-center gap-1 rounded border px-1.5 py-0.5 font-mono text-xs\"\n                          >\n                            <lucide-icon [img]=\"Wrench\" class=\"text-warning size-2.5\" />\n                            <span class=\"max-w-[140px] truncate\">{{ record.workOrder }}</span>\n                          </span>\n                        </div>\n                      }\n                    </div>\n                  </td>\n\n                  <!-- 5. Photographic Evidence -->\n                  <td ui-table-cell class=\"py-3.5 align-top\">\n                    <div class=\"space-y-1.5\">\n                      <div class=\"flex items-center gap-1.5\">\n                        @for (photo of record.photos; track photo.id; let pIdx = $index) {\n                          <button\n                            type=\"button\"\n                            [attr.aria-label]=\"'View inspection photo ' + (pIdx + 1) + ': ' + photo.title\"\n                            class=\"border-border hover:border-primary focus-visible:ring-ring group/thumb relative size-11 shrink-0 cursor-pointer overflow-hidden rounded-md border bg-zinc-900 shadow-xs transition-colors focus-visible:ring-2 focus-visible:outline-none\"\n                            (click)=\"handleOpenPhoto(photo, record)\"\n                          >\n                            <ng-container *ngTemplateOutlet=\"thumbnail; context: { $implicit: photo.previewType }\" />\n                            <div\n                              class=\"absolute inset-0 flex items-center justify-center bg-black/60 opacity-0 transition-opacity group-hover/thumb:opacity-100\"\n                            >\n                              <lucide-icon [img]=\"Eye\" class=\"size-3.5 text-white\" />\n                            </div>\n                          </button>\n                        }\n                      </div>\n                      <div class=\"text-muted-foreground flex items-center gap-1 text-xs\">\n                        <lucide-icon [img]=\"Camera\" class=\"size-3\" />\n                        <span>{{ record.photos.length }} Attachments</span>\n                      </div>\n                    </div>\n                  </td>\n\n                  <!-- 6. Inspector & Sign-off -->\n                  <td ui-table-cell class=\"py-3.5 align-top\">\n                    <div class=\"space-y-1\">\n                      <div class=\"flex items-center gap-2\">\n                        <ui-avatar class=\"border-border size-6 border\">\n                          <ui-avatar-fallback class=\"bg-primary/10 text-primary text-xs font-bold\">\n                            {{ record.inspector.initials }}\n                          </ui-avatar-fallback>\n                        </ui-avatar>\n                        <span class=\"text-foreground text-xs font-semibold\">{{ record.inspector.name }}</span>\n                      </div>\n                      <div>\n                        <span [class]=\"signoffClass(record.status)\">\n                          @if (record.status !== 'critical') {\n                            <lucide-icon [img]=\"ShieldCheck\" class=\"size-3 shrink-0\" />\n                          } @else {\n                            <lucide-icon [img]=\"ShieldAlert\" class=\"size-3 shrink-0\" />\n                          }\n                          {{ record.inspector.signoffStatus }}\n                        </span>\n                      </div>\n                      <div class=\"text-muted-foreground/80 font-mono text-xs\">{{ record.inspector.signoffHash }}</div>\n                    </div>\n                  </td>\n\n                  <!-- 7. Actions Dropdown -->\n                  <td ui-table-cell class=\"py-3.5 text-right align-top\">\n                    <ui-dropdown-menu>\n                      <button ui-button ui-dropdown-menu-trigger variant=\"ghost\" size=\"sm\" class=\"size-8 p-0\">\n                        <span class=\"sr-only\">Open audit menu</span>\n                        <lucide-icon [img]=\"MoreHorizontal\" class=\"size-4\" />\n                      </button>\n                      <ui-dropdown-menu-content align=\"end\" class=\"w-48 text-xs\">\n                        <div ui-dropdown-menu-label class=\"font-mono text-xs\">{{ record.assetId }}</div>\n                        <ui-dropdown-menu-separator />\n                        <ui-dropdown-menu-item class=\"cursor-pointer gap-2\" (select)=\"handleViewReport(record)\">\n                          <lucide-icon [img]=\"Eye\" class=\"text-primary size-3.5\" />\n                          <span>View Audit Report</span>\n                        </ui-dropdown-menu-item>\n                        <ui-dropdown-menu-item class=\"cursor-pointer gap-2\" (select)=\"handleDownloadPdf(record)\">\n                          <lucide-icon [img]=\"Download\" class=\"size-3.5\" />\n                          <span>Download PDF</span>\n                        </ui-dropdown-menu-item>\n                        <ui-dropdown-menu-item class=\"cursor-pointer gap-2\" (select)=\"copyGps(record.gps, record.id)\">\n                          <lucide-icon [img]=\"Copy\" class=\"size-3.5\" />\n                          <span>Copy GPS Coordinates</span>\n                        </ui-dropdown-menu-item>\n                        <ui-dropdown-menu-separator />\n                        <ui-dropdown-menu-item\n                          class=\"cursor-pointer gap-2\"\n                          [class.text-destructive]=\"record.status === 'critical'\"\n                          [class.font-semibold]=\"record.status === 'critical'\"\n                          (select)=\"handleCreateWorkOrder(record)\"\n                        >\n                          <lucide-icon [img]=\"Wrench\" class=\"size-3.5\" />\n                          <span>{{ record.status === 'critical' ? 'Expedite Work Order' : 'Create Work Order' }}</span>\n                        </ui-dropdown-menu-item>\n                      </ui-dropdown-menu-content>\n                    </ui-dropdown-menu>\n                  </td>\n                </tr>\n              }\n            </tbody>\n          </table>\n        </div>\n      </div>\n\n      <!-- PHOTO EVIDENCE LIGHTBOX MODAL DIALOG -->\n      <ui-dialog [open]=\"!!previewPhoto()\" (openChange)=\"onPreviewOpenChange($event)\">\n        @if (previewPhoto(); as preview) {\n          <ui-dialog-content class=\"sm:max-w-2xl\">\n            <div ui-dialog-header>\n              <div class=\"flex items-center justify-between pr-4\">\n                <div class=\"flex items-center gap-2\">\n                  <lucide-icon [img]=\"Camera\" class=\"text-primary size-4\" />\n                  <h2 ui-dialog-title class=\"text-base font-bold\">{{ preview.photo.title }}</h2>\n                </div>\n                <span ui-badge variant=\"outline\" class=\"font-mono text-xs\">{{ preview.record.assetId }}</span>\n              </div>\n              <p ui-dialog-description class=\"text-xs\">\n                Captured during {{ preview.record.assetName }} site inspection audit.\n              </p>\n            </div>\n\n            <div class=\"space-y-4 py-2\">\n              <div\n                class=\"border-border relative aspect-[16/10] w-full overflow-hidden rounded-lg border bg-gradient-to-br from-zinc-800 via-zinc-900 to-black p-4 text-white shadow-inner\"\n              >\n                <div class=\"absolute inset-0 flex items-center justify-center p-6\">\n                  @if (preview.photo.previewType === 'gauge') {\n                    <svg class=\"h-full w-full\" viewBox=\"0 0 300 200\" fill=\"none\">\n                      <rect width=\"300\" height=\"200\" fill=\"#18181b\" />\n                      <circle cx=\"150\" cy=\"100\" r=\"70\" fill=\"#27272a\" stroke=\"#71717a\" stroke-width=\"4\" />\n                      <path\n                        d=\"M 100,125 A 55,55 0 1,1 200,125\"\n                        fill=\"none\"\n                        stroke=\"#22c55e\"\n                        stroke-width=\"6\"\n                        stroke-dasharray=\"4 2\"\n                      />\n                      <line\n                        x1=\"150\"\n                        y1=\"100\"\n                        x2=\"185\"\n                        y2=\"65\"\n                        stroke=\"#ef4444\"\n                        stroke-width=\"3.5\"\n                        stroke-linecap=\"round\"\n                      />\n                      <circle cx=\"150\" cy=\"100\" r=\"8\" fill=\"#f4f4f5\" />\n                      <text x=\"150\" y=\"140\" fill=\"#a1a1aa\" font-size=\"12\" text-anchor=\"middle\" font-family=\"monospace\">\n                        68.4 PSI · NOMINAL\n                      </text>\n                    </svg>\n                  } @else if (preview.photo.previewType === 'thermal') {\n                    <svg class=\"h-full w-full\" viewBox=\"0 0 300 200\" fill=\"none\">\n                      <rect width=\"300\" height=\"200\" fill=\"#3b0764\" />\n                      <circle cx=\"150\" cy=\"100\" r=\"65\" fill=\"#db2777\" fill-opacity=\"0.6\" />\n                      <circle cx=\"150\" cy=\"100\" r=\"30\" fill=\"#facc15\" />\n                      <line x1=\"80\" y1=\"100\" x2=\"220\" y2=\"100\" stroke=\"#ffffff\" stroke-width=\"1.5\" />\n                      <line x1=\"150\" y1=\"30\" x2=\"150\" y2=\"170\" stroke=\"#ffffff\" stroke-width=\"1.5\" />\n                      <circle cx=\"150\" cy=\"100\" r=\"6\" stroke=\"#ffffff\" stroke-width=\"1.5\" fill=\"none\" />\n                      <text x=\"160\" y=\"90\" fill=\"#ffffff\" font-size=\"14\" font-weight=\"bold\" font-family=\"monospace\">\n                        84.2°C CRITICAL\n                      </text>\n                    </svg>\n                  } @else if (preview.photo.previewType === 'spall') {\n                    <svg class=\"h-full w-full\" viewBox=\"0 0 300 200\" fill=\"none\">\n                      <rect width=\"300\" height=\"200\" fill=\"#27272a\" />\n                      <polygon\n                        points=\"40,30 260,30 260,170 170,170 130,110 40,100\"\n                        fill=\"#52525b\"\n                        stroke=\"#71717a\"\n                        stroke-width=\"2\"\n                      />\n                      <polygon\n                        points=\"130,110 180,90 170,170\"\n                        fill=\"#ef4444\"\n                        fill-opacity=\"0.4\"\n                        stroke=\"#ef4444\"\n                        stroke-width=\"2\"\n                      />\n                      <line\n                        x1=\"130\"\n                        y1=\"110\"\n                        x2=\"180\"\n                        y2=\"90\"\n                        stroke=\"#facc15\"\n                        stroke-width=\"2\"\n                        stroke-dasharray=\"3 3\"\n                      />\n                      <text x=\"155\" y=\"80\" fill=\"#facc15\" font-size=\"12\" font-family=\"monospace\">18cm SHEAR SPALL</text>\n                    </svg>\n                  } @else {\n                    <svg class=\"h-full w-full\" viewBox=\"0 0 300 200\" fill=\"none\">\n                      <rect width=\"300\" height=\"200\" fill=\"#18181b\" />\n                      <rect\n                        x=\"40\"\n                        y=\"30\"\n                        width=\"220\"\n                        height=\"140\"\n                        rx=\"4\"\n                        fill=\"#27272a\"\n                        stroke=\"#3f3f46\"\n                        stroke-width=\"2\"\n                      />\n                      <circle cx=\"150\" cy=\"100\" r=\"35\" fill=\"#3f3f46\" stroke=\"#38bdf8\" stroke-width=\"2\" />\n                      <line x1=\"70\" y1=\"60\" x2=\"230\" y2=\"60\" stroke=\"#38bdf8\" stroke-width=\"1.5\" />\n                      <line x1=\"70\" y1=\"140\" x2=\"230\" y2=\"140\" stroke=\"#38bdf8\" stroke-width=\"1.5\" />\n                    </svg>\n                  }\n                </div>\n\n                <div class=\"pointer-events-none absolute inset-4 border border-white/20\">\n                  <div class=\"border-success absolute -top-1 -left-1 size-3 border-t-2 border-l-2\"></div>\n                  <div class=\"border-success absolute -top-1 -right-1 size-3 border-t-2 border-r-2\"></div>\n                  <div class=\"border-success absolute -bottom-1 -left-1 size-3 border-b-2 border-l-2\"></div>\n                  <div class=\"border-success absolute -right-1 -bottom-1 size-3 border-r-2 border-b-2\"></div>\n                </div>\n\n                <div\n                  class=\"absolute top-3 left-3 flex items-center gap-1.5 rounded bg-black/70 px-2 py-1 font-mono text-xs backdrop-blur-sm\"\n                >\n                  <span class=\"bg-success size-2 animate-pulse rounded-full\"></span>\n                  <span>GEO-AUTHENTICATED FIELD PHOTO</span>\n                </div>\n\n                <div\n                  class=\"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/90 via-black/60 to-transparent p-3 pt-6 font-mono text-xs\"\n                >\n                  <div class=\"flex flex-wrap items-center justify-between gap-2\">\n                    <span class=\"text-success font-bold tabular-nums\">\n                      📍 {{ preview.record.gps }} ({{ preview.record.gpsAccuracy }})\n                    </span>\n                    <span class=\"text-zinc-300\">{{ preview.record.date }} · {{ preview.photo.time }}</span>\n                  </div>\n                </div>\n              </div>\n\n              <div class=\"border-border bg-muted/20 space-y-2 rounded-lg border p-3 text-xs\">\n                <div class=\"text-foreground font-semibold\">Inspector Field Observation:</div>\n                <p class=\"text-muted-foreground leading-relaxed\">{{ preview.photo.caption }}</p>\n              </div>\n\n              <div class=\"grid grid-cols-2 gap-2 text-xs sm:grid-cols-4\">\n                <div class=\"border-border bg-muted/30 rounded border p-2\">\n                  <span class=\"text-muted-foreground block text-xs\">Asset ID</span>\n                  <span class=\"text-foreground font-mono font-semibold\">{{ preview.record.assetId }}</span>\n                </div>\n                <div class=\"border-border bg-muted/30 rounded border p-2\">\n                  <span class=\"text-muted-foreground block text-xs\">Facility</span>\n                  <span class=\"text-foreground truncate font-medium\">{{ preview.record.buildingBadge }}</span>\n                </div>\n                <div class=\"border-border bg-muted/30 rounded border p-2\">\n                  <span class=\"text-muted-foreground block text-xs\">Capture Timestamp</span>\n                  <span class=\"text-foreground font-mono font-medium tabular-nums\">{{ preview.photo.time }}</span>\n                </div>\n                <div class=\"border-border bg-muted/30 rounded border p-2\">\n                  <span class=\"text-muted-foreground block text-xs\">Cryptographic Seal</span>\n                  <span class=\"text-success font-mono font-medium\">Valid SHA-256</span>\n                </div>\n              </div>\n            </div>\n\n            <div ui-dialog-footer class=\"flex flex-wrap items-center justify-between gap-2\">\n              <button\n                ui-button\n                aria-label=\"Download attachment\"\n                variant=\"outline\"\n                size=\"sm\"\n                class=\"text-xs font-medium\"\n                (click)=\"showToast('Exporting high-resolution raw image file...')\"\n              >\n                <lucide-icon [img]=\"Download\" class=\"mr-1.5 size-3.5\" />\n                Download Original Photo\n              </button>\n              <button ui-button size=\"sm\" class=\"text-xs\" (click)=\"previewPhoto.set(null)\">Close</button>\n            </div>\n          </ui-dialog-content>\n        }\n      </ui-dialog>\n\n      <!-- COMPREHENSIVE AUDIT REPORT MODAL DIALOG -->\n      <ui-dialog [open]=\"!!selectedAudit()\" (openChange)=\"onAuditOpenChange($event)\">\n        @if (selectedAudit(); as audit) {\n          <ui-dialog-content class=\"max-h-[90vh] overflow-y-auto sm:max-w-3xl\">\n            <div ui-dialog-header>\n              <div class=\"flex flex-wrap items-center justify-between gap-2 pr-4\">\n                <div class=\"space-y-1\">\n                  <div class=\"flex items-center gap-2\">\n                    <span ui-badge variant=\"outline\" class=\"font-mono text-xs\">{{ audit.assetId }}</span>\n                    <span\n                      ui-badge\n                      [variant]=\"\n                        audit.status === 'critical' ? 'destructive' : audit.status === 'minor' ? 'warning' : 'outline'\n                      \"\n                      [class]=\"\n                        audit.status === 'passed'\n                          ? 'border-success/30 bg-success/10 text-success font-mono text-xs font-semibold'\n                          : 'font-mono text-xs font-semibold'\n                      \"\n                    >\n                      {{ audit.statusLabel }}\n                    </span>\n                  </div>\n                  <h2 ui-dialog-title class=\"text-lg font-bold sm:text-xl\">{{ audit.assetName }}</h2>\n                </div>\n              </div>\n              <p ui-dialog-description class=\"text-xs\">\n                Commercial facility asset engineering inspection audit record · {{ audit.category }}\n              </p>\n            </div>\n\n            <div class=\"space-y-5 py-2\">\n              <div class=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-4\">\n                <div class=\"border-border bg-muted/20 rounded-lg border p-3\">\n                  <span class=\"text-muted-foreground block text-xs font-medium\">Facility Location</span>\n                  <span class=\"text-foreground mt-0.5 block text-xs font-semibold\">{{ audit.facility }}</span>\n                </div>\n                <div class=\"border-border bg-muted/20 rounded-lg border p-3\">\n                  <span class=\"text-muted-foreground block text-xs font-medium\">Inspection Time</span>\n                  <span class=\"text-foreground mt-0.5 block text-xs font-semibold tabular-nums\">\n                    {{ audit.date }} · {{ audit.time }}\n                  </span>\n                </div>\n                <div class=\"border-border bg-muted/20 rounded-lg border p-3\">\n                  <span class=\"text-muted-foreground block text-xs font-medium\">GPS Geostamp</span>\n                  <span class=\"text-foreground mt-0.5 block font-mono text-xs font-semibold tabular-nums\">\n                    {{ audit.gps }}\n                  </span>\n                  <span class=\"text-muted-foreground text-xs\">Accuracy: {{ audit.gpsAccuracy }}</span>\n                </div>\n                <div class=\"border-border bg-muted/20 rounded-lg border p-3\">\n                  <span class=\"text-muted-foreground block text-xs font-medium\">Audit Duration</span>\n                  <span class=\"text-foreground mt-0.5 block text-xs font-semibold tabular-nums\">\n                    {{ audit.duration }}\n                  </span>\n                  <span class=\"text-muted-foreground text-xs\">SLA compliant</span>\n                </div>\n              </div>\n\n              @if (audit.status === 'critical') {\n                <div\n                  class=\"border-destructive/30 bg-destructive/10 text-destructive space-y-1.5 rounded-lg border p-3.5 text-xs\"\n                >\n                  <div class=\"flex items-center gap-1.5 font-bold\">\n                    <lucide-icon [img]=\"AlertTriangle\" class=\"text-destructive size-4\" />\n                    <span>Critical Deficiencies Flagged · Action Dispatched</span>\n                  </div>\n                  <p class=\"leading-relaxed\">{{ audit.defectSummary }}</p>\n                  <div class=\"pt-1 font-mono font-semibold\">Active Work Order: {{ audit.workOrder }}</div>\n                </div>\n              }\n\n              <div class=\"space-y-2\">\n                <div class=\"flex items-center justify-between\">\n                  <span class=\"text-foreground text-xs font-semibold\">Pass / Fail Checklist Audit Items</span>\n                  <span class=\"text-muted-foreground font-mono text-xs tabular-nums\">\n                    {{ audit.scorePassed }} / {{ audit.scoreTotal }} Passed\n                  </span>\n                </div>\n                <div class=\"border-border divide-border divide-y rounded-lg border\">\n                  @for (item of audit.checklist; track item.id) {\n                    <div class=\"flex items-center justify-between p-2.5 text-xs\">\n                      <div class=\"flex items-center gap-2\">\n                        <span\n                          ui-badge\n                          [variant]=\"\n                            item.status === 'fail' ? 'destructive' : item.status === 'minor' ? 'warning' : 'outline'\n                          \"\n                          class=\"h-5 px-1.5 font-mono text-xs uppercase\"\n                        >\n                          {{ item.status }}\n                        </span>\n                        <span class=\"text-foreground font-medium\">{{ item.label }}</span>\n                      </div>\n                      <span class=\"text-muted-foreground font-mono text-xs tabular-nums\">{{ item.value }}</span>\n                    </div>\n                  }\n                </div>\n              </div>\n\n              <div class=\"space-y-2\">\n                <span class=\"text-foreground text-xs font-semibold\">Photographic Evidence Attachments</span>\n                <div class=\"grid grid-cols-3 gap-3\">\n                  @for (photo of audit.photos; track photo.id) {\n                    <button\n                      type=\"button\"\n                      class=\"border-border hover:border-primary/60 group/p cursor-pointer overflow-hidden rounded-lg border bg-zinc-900 p-2 text-left transition-colors\"\n                      (click)=\"handleOpenPhoto(photo, audit)\"\n                    >\n                      <div class=\"relative aspect-[16/10] w-full overflow-hidden rounded bg-black\">\n                        <div class=\"absolute inset-0 flex items-center justify-center\">\n                          <lucide-icon [img]=\"Camera\" class=\"text-muted-foreground size-6\" />\n                        </div>\n                      </div>\n                      <div class=\"text-foreground mt-1.5 truncate text-xs font-semibold\">{{ photo.title }}</div>\n                      <div class=\"text-muted-foreground font-mono text-xs tabular-nums\">{{ photo.time }}</div>\n                    </button>\n                  }\n                </div>\n              </div>\n\n              <div class=\"border-border bg-muted/15 space-y-2 rounded-xl border p-4\">\n                <div class=\"flex items-center justify-between\">\n                  <span class=\"text-muted-foreground flex items-center gap-1.5 text-xs font-medium\">\n                    <lucide-icon [img]=\"ShieldCheck\" class=\"text-primary size-3.5\" />\n                    Electronic Cryptographic Engineer Sign-off\n                  </span>\n                  <span class=\"text-muted-foreground font-mono text-xs\">{{ audit.inspector.badge }}</span>\n                </div>\n                <div class=\"border-border/60 border-b pt-1 pb-3\">\n                  <p class=\"text-primary text-2xl font-medium tracking-wide italic\">{{ audit.inspector.name }}</p>\n                </div>\n                <div class=\"text-muted-foreground flex flex-wrap items-center justify-between gap-2 font-mono text-xs\">\n                  <span>Signer: {{ audit.inspector.name }} · {{ audit.inspector.role }}</span>\n                  <span>{{ audit.inspector.signoffHash }}</span>\n                </div>\n              </div>\n            </div>\n\n            <div ui-dialog-footer class=\"flex flex-wrap items-center justify-between gap-2\">\n              <button\n                ui-button\n                aria-label=\"Download attachment\"\n                variant=\"outline\"\n                size=\"sm\"\n                class=\"text-xs font-medium\"\n                (click)=\"handleDownloadPdf(audit)\"\n              >\n                <lucide-icon [img]=\"Download\" class=\"mr-1.5 size-3.5\" />\n                Download PDF Report\n              </button>\n              <button ui-button size=\"sm\" class=\"text-xs\" (click)=\"selectedAudit.set(null)\">Close</button>\n            </div>\n          </ui-dialog-content>\n        }\n      </ui-dialog>\n\n      <!-- START NEW INSPECTION MODAL DIALOG -->\n      <ui-dialog [open]=\"isNewAuditOpen()\" (openChange)=\"isNewAuditOpen.set($event)\">\n        <ui-dialog-content class=\"sm:max-w-xl\">\n          <div ui-dialog-header>\n            <div class=\"flex items-center gap-2\">\n              <lucide-icon [img]=\"ClipboardCheck\" class=\"text-primary size-5\" />\n              <h2 ui-dialog-title class=\"text-base font-bold\">Start New Site & Asset Inspection Audit</h2>\n            </div>\n            <p ui-dialog-description class=\"text-xs\">\n              Initiate a field engineering inspection with automatic GPS geostamping and checklist validation.\n            </p>\n          </div>\n\n          @if (newAuditSuccess()) {\n            <div class=\"space-y-3 py-8 text-center\">\n              <div class=\"bg-success/20 text-success mx-auto flex size-12 items-center justify-center rounded-full\">\n                <lucide-icon [img]=\"CheckCircle2\" class=\"size-6\" />\n              </div>\n              <h3 class=\"text-foreground text-base font-bold\">Inspection Audit Logged Successfully</h3>\n              <p class=\"text-muted-foreground mx-auto max-w-sm text-xs\">\n                Audit has been recorded with GPS geostamp 34.0522°N, 118.2437°W and synced to cloud repository.\n              </p>\n            </div>\n          } @else {\n            <div class=\"space-y-4 py-2\">\n              <div class=\"grid gap-3 sm:grid-cols-2\">\n                <div class=\"space-y-1.5\">\n                  <label class=\"text-foreground text-xs font-semibold\">Select Target Asset *</label>\n                  <ui-select [value]=\"newAuditAsset()\" (valueChange)=\"newAuditAsset.set($event)\">\n                    <button ui-select-trigger class=\"h-8 text-xs\">\n                      <ui-select-value />\n                    </button>\n                    <ui-select-content>\n                      <ui-select-item value=\"AST-HVAC-4091\">AST-HVAC-4091 · Chiller Unit #4</ui-select-item>\n                      <ui-select-item value=\"AST-SOLAR-1082\">AST-SOLAR-1082 · Solar Array & Inverters</ui-select-item>\n                      <ui-select-item value=\"AST-FIRE-8820\">AST-FIRE-8820 · Fire Sprinkler System</ui-select-item>\n                      <ui-select-item value=\"AST-GEN-3304\">AST-GEN-3304 · Backup Generator #2</ui-select-item>\n                      <ui-select-item value=\"AST-STR-0019\">AST-STR-0019 · Foundation & Beams</ui-select-item>\n                      <ui-select-item value=\"AST-ELEV-9012\">AST-ELEV-9012 · Passenger Elevator Bank A</ui-select-item>\n                    </ui-select-content>\n                  </ui-select>\n                </div>\n\n                <div class=\"space-y-1.5\">\n                  <label class=\"text-foreground text-xs font-semibold\">Facility Location</label>\n                  <ui-input\n                    [value]=\"newAuditFacility()\"\n                    (valueChange)=\"newAuditFacility.set($event)\"\n                    class=\"h-8 text-xs\"\n                  />\n                </div>\n              </div>\n\n              <div class=\"border-border bg-muted/20 flex items-center justify-between rounded-lg border p-3 text-xs\">\n                <div class=\"flex items-center gap-2\">\n                  <lucide-icon [img]=\"MapPin\" class=\"text-success size-4 shrink-0\" />\n                  <div>\n                    <span class=\"text-foreground font-semibold\">Live GPS Telemetry Lock</span>\n                    <span class=\"text-muted-foreground block font-mono text-xs\">\n                      34.0522°N, 118.2437°W · Accuracy ±1.5m\n                    </span>\n                  </div>\n                </div>\n                <span ui-badge variant=\"outline\" class=\"border-success/30 bg-success/10 text-success font-mono text-xs\">\n                  GPS Locked\n                </span>\n              </div>\n\n              <div class=\"space-y-1.5\">\n                <label class=\"text-foreground text-xs font-semibold\">Photographic Evidence</label>\n                <div\n                  class=\"border-border/80 hover:border-primary/50 bg-card cursor-pointer rounded-lg border-2 border-dashed p-4 text-center transition-colors\"\n                  (click)=\"showToast('Mock photo uploaded: asset_evidence_live.jpg')\"\n                >\n                  <div class=\"flex flex-col items-center justify-center gap-1\">\n                    <lucide-icon [img]=\"UploadCloud\" class=\"text-primary size-5\" />\n                    <p class=\"text-foreground text-xs font-medium\">Click to upload photo evidence or drag & drop</p>\n                    <p class=\"text-muted-foreground text-xs\">Supports JPG, PNG up to 15MB with GPS EXIF retention</p>\n                  </div>\n                </div>\n              </div>\n\n              <div class=\"space-y-1.5\">\n                <label class=\"text-foreground text-xs font-semibold\">Inspector Observations & Checklist Notes</label>\n                <ui-input\n                  [value]=\"newAuditNotes()\"\n                  (valueChange)=\"newAuditNotes.set($event)\"\n                  placeholder=\"Enter notes, gauge pressures, or deficiency remarks...\"\n                  class=\"h-8 text-xs\"\n                />\n              </div>\n            </div>\n          }\n\n          @if (!newAuditSuccess()) {\n            <div ui-dialog-footer class=\"flex items-center justify-end gap-2\">\n              <button ui-button variant=\"outline\" size=\"sm\" class=\"text-xs\" (click)=\"isNewAuditOpen.set(false)\">\n                Cancel\n              </button>\n              <button ui-button size=\"sm\" class=\"gap-1.5 text-xs font-medium\" (click)=\"submitNewAudit()\">\n                <lucide-icon [img]=\"ClipboardCheck\" class=\"size-3.5\" />\n                Submit Completed Audit\n              </button>\n            </div>\n          }\n        </ui-dialog-content>\n      </ui-dialog>\n    </div>\n\n    <!-- Vector SVG thumbnail per photo preview type (themed, no baked screenshots). -->\n    <ng-template #thumbnail let-type>\n      <div class=\"h-full w-full\">\n        @if (type === 'gauge') {\n          <svg class=\"h-full w-full\" viewBox=\"0 0 44 44\" fill=\"none\">\n            <circle cx=\"22\" cy=\"22\" r=\"19\" fill=\"#18181b\" stroke=\"#3f3f46\" stroke-width=\"1.5\" />\n            <path\n              d=\"M 12,28 A 14,14 0 1,1 32,28\"\n              fill=\"none\"\n              stroke=\"#22c55e\"\n              stroke-width=\"2\"\n              stroke-dasharray=\"2 2\"\n            />\n            <line x1=\"22\" y1=\"22\" x2=\"28\" y2=\"15\" stroke=\"#ef4444\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n            <circle cx=\"22\" cy=\"22\" r=\"2.5\" fill=\"#f4f4f5\" />\n          </svg>\n        } @else if (type === 'coil') {\n          <svg class=\"h-full w-full\" viewBox=\"0 0 44 44\" fill=\"none\">\n            <rect width=\"44\" height=\"44\" fill=\"#18181b\" />\n            <line x1=\"6\" y1=\"10\" x2=\"38\" y2=\"10\" stroke=\"#38bdf8\" stroke-width=\"1.5\" />\n            <line x1=\"6\" y1=\"18\" x2=\"38\" y2=\"18\" stroke=\"#38bdf8\" stroke-width=\"1.5\" />\n            <line x1=\"6\" y1=\"26\" x2=\"38\" y2=\"26\" stroke=\"#38bdf8\" stroke-width=\"1.5\" />\n            <line x1=\"6\" y1=\"34\" x2=\"38\" y2=\"34\" stroke=\"#38bdf8\" stroke-width=\"1.5\" />\n            <circle cx=\"22\" cy=\"22\" r=\"7\" fill=\"#0284c7\" fill-opacity=\"0.3\" stroke=\"#38bdf8\" stroke-width=\"1.5\" />\n          </svg>\n        } @else if (type === 'mount') {\n          <svg class=\"h-full w-full\" viewBox=\"0 0 44 44\" fill=\"none\">\n            <rect width=\"44\" height=\"44\" fill=\"#18181b\" />\n            <rect x=\"8\" y=\"8\" width=\"28\" height=\"4\" rx=\"1\" fill=\"#71717a\" />\n            <path d=\"M 14,12 C 14,18 30,18 30,24 C 30,30 14,30 14,36\" fill=\"none\" stroke=\"#f59e0b\" stroke-width=\"2\" />\n            <rect x=\"8\" y=\"36\" width=\"28\" height=\"4\" rx=\"1\" fill=\"#71717a\" />\n          </svg>\n        } @else if (type === 'thermal') {\n          <svg class=\"h-full w-full\" viewBox=\"0 0 44 44\" fill=\"none\">\n            <rect width=\"44\" height=\"44\" fill=\"#3b0764\" />\n            <circle cx=\"22\" cy=\"22\" r=\"14\" fill=\"#db2777\" fill-opacity=\"0.6\" />\n            <circle cx=\"22\" cy=\"22\" r=\"7\" fill=\"#facc15\" />\n            <line x1=\"12\" y1=\"22\" x2=\"32\" y2=\"22\" stroke=\"#ffffff\" stroke-width=\"0.75\" />\n            <line x1=\"22\" y1=\"12\" x2=\"22\" y2=\"32\" stroke=\"#ffffff\" stroke-width=\"0.75\" />\n          </svg>\n        } @else if (type === 'box') {\n          <svg class=\"h-full w-full\" viewBox=\"0 0 44 44\" fill=\"none\">\n            <rect width=\"44\" height=\"44\" fill=\"#18181b\" />\n            <rect x=\"6\" y=\"6\" width=\"32\" height=\"32\" rx=\"2\" stroke=\"#eab308\" stroke-width=\"1.5\" />\n            <line x1=\"14\" y1=\"12\" x2=\"14\" y2=\"32\" stroke=\"#f97316\" stroke-width=\"2\" />\n            <line x1=\"22\" y1=\"12\" x2=\"22\" y2=\"32\" stroke=\"#f97316\" stroke-width=\"2\" />\n            <circle cx=\"22\" cy=\"22\" r=\"5\" fill=\"#ef4444\" />\n          </svg>\n        } @else if (type === 'conduit') {\n          <svg class=\"h-full w-full\" viewBox=\"0 0 44 44\" fill=\"none\">\n            <rect width=\"44\" height=\"44\" fill=\"#18181b\" />\n            <rect x=\"16\" y=\"4\" width=\"12\" height=\"36\" fill=\"#52525b\" />\n            <circle cx=\"22\" cy=\"22\" r=\"10\" fill=\"#a1a1aa\" fill-opacity=\"0.3\" stroke=\"#e4e4e7\" stroke-width=\"1.5\" />\n            <line x1=\"16\" y1=\"22\" x2=\"28\" y2=\"22\" stroke=\"#ef4444\" stroke-width=\"1.5\" />\n          </svg>\n        } @else if (type === 'riser') {\n          <svg class=\"h-full w-full\" viewBox=\"0 0 44 44\" fill=\"none\">\n            <rect width=\"44\" height=\"44\" fill=\"#18181b\" />\n            <rect x=\"14\" y=\"4\" width=\"16\" height=\"36\" fill=\"#dc2626\" />\n            <circle cx=\"22\" cy=\"18\" r=\"8\" fill=\"#e4e4e7\" stroke=\"#dc2626\" stroke-width=\"1.5\" />\n            <line x1=\"22\" y1=\"18\" x2=\"26\" y2=\"14\" stroke=\"#000000\" stroke-width=\"1\" />\n          </svg>\n        } @else if (type === 'pump') {\n          <svg class=\"h-full w-full\" viewBox=\"0 0 44 44\" fill=\"none\">\n            <rect width=\"44\" height=\"44\" fill=\"#18181b\" />\n            <circle cx=\"22\" cy=\"22\" r=\"13\" fill=\"#b91c1c\" stroke=\"#f87171\" stroke-width=\"1.5\" />\n            <circle cx=\"22\" cy=\"22\" r=\"5\" fill=\"#52525b\" />\n            <line x1=\"22\" y1=\"4\" x2=\"22\" y2=\"10\" stroke=\"#f87171\" stroke-width=\"2\" />\n          </svg>\n        } @else if (type === 'switch') {\n          <svg class=\"h-full w-full\" viewBox=\"0 0 44 44\" fill=\"none\">\n            <rect width=\"44\" height=\"44\" fill=\"#18181b\" />\n            <circle cx=\"22\" cy=\"16\" r=\"9\" stroke=\"#dc2626\" stroke-width=\"2\" fill=\"none\" />\n            <rect x=\"16\" y=\"24\" width=\"12\" height=\"14\" rx=\"2\" fill=\"#eab308\" />\n          </svg>\n        } @else if (type === 'tank') {\n          <svg class=\"h-full w-full\" viewBox=\"0 0 44 44\" fill=\"none\">\n            <rect width=\"44\" height=\"44\" fill=\"#18181b\" />\n            <rect x=\"10\" y=\"8\" width=\"24\" height=\"28\" rx=\"6\" fill=\"#3f3f46\" stroke=\"#71717a\" stroke-width=\"1.5\" />\n            <rect x=\"14\" y=\"14\" width=\"4\" height=\"16\" rx=\"1\" fill=\"#22c55e\" />\n          </svg>\n        } @else if (type === 'battery') {\n          <svg class=\"h-full w-full\" viewBox=\"0 0 44 44\" fill=\"none\">\n            <rect width=\"44\" height=\"44\" fill=\"#18181b\" />\n            <rect x=\"6\" y=\"12\" width=\"32\" height=\"24\" rx=\"2\" fill=\"#27272a\" stroke=\"#52525b\" stroke-width=\"1.5\" />\n            <rect x=\"11\" y=\"8\" width=\"6\" height=\"4\" fill=\"#ef4444\" />\n            <rect x=\"27\" y=\"8\" width=\"6\" height=\"4\" fill=\"#3b82f6\" />\n          </svg>\n        } @else if (type === 'ats') {\n          <svg class=\"h-full w-full\" viewBox=\"0 0 44 44\" fill=\"none\">\n            <rect width=\"44\" height=\"44\" fill=\"#18181b\" />\n            <rect x=\"6\" y=\"6\" width=\"32\" height=\"32\" rx=\"2\" fill=\"#27272a\" stroke=\"#059669\" stroke-width=\"1.5\" />\n            <circle cx=\"14\" cy=\"14\" r=\"2.5\" fill=\"#22c55e\" />\n            <circle cx=\"14\" cy=\"22\" r=\"2.5\" fill=\"#eab308\" />\n            <line x1=\"22\" y1=\"12\" x2=\"32\" y2=\"12\" stroke=\"#a1a1aa\" stroke-width=\"2\" />\n          </svg>\n        } @else if (type === 'spall') {\n          <svg class=\"h-full w-full\" viewBox=\"0 0 44 44\" fill=\"none\">\n            <rect width=\"44\" height=\"44\" fill=\"#27272a\" />\n            <polygon points=\"6,6 38,6 38,38 24,38 18,26 6,24\" fill=\"#71717a\" />\n            <polygon points=\"18,26 26,24 24,38\" fill=\"#ef4444\" fill-opacity=\"0.4\" stroke=\"#ef4444\" stroke-width=\"1\" />\n          </svg>\n        } @else if (type === 'rebar') {\n          <svg class=\"h-full w-full\" viewBox=\"0 0 44 44\" fill=\"none\">\n            <rect width=\"44\" height=\"44\" fill=\"#27272a\" />\n            <line x1=\"6\" y1=\"38\" x2=\"38\" y2=\"6\" stroke=\"#b45309\" stroke-width=\"4\" stroke-dasharray=\"2 1\" />\n            <circle cx=\"22\" cy=\"22\" r=\"6\" stroke=\"#ef4444\" stroke-width=\"1.5\" fill=\"none\" />\n          </svg>\n        } @else {\n          <svg class=\"h-full w-full\" viewBox=\"0 0 44 44\" fill=\"none\">\n            <rect width=\"44\" height=\"44\" fill=\"#18181b\" />\n            <path d=\"M 12,38 L 18,26 L 24,20 L 32,6\" stroke=\"#ef4444\" stroke-width=\"2\" fill=\"none\" />\n            <rect\n              x=\"14\"\n              y=\"14\"\n              width=\"16\"\n              height=\"12\"\n              rx=\"1\"\n              fill=\"#ffffff\"\n              fill-opacity=\"0.2\"\n              stroke=\"#ffffff\"\n              stroke-width=\"0.75\"\n            />\n          </svg>\n        }\n      </div>\n    </ng-template>\n  `,\n})\nexport class UiFieldInspectionManagerComponent {\n  protected readonly AlertCircle = AlertCircle\n  protected readonly AlertTriangle = AlertTriangle\n  protected readonly Building2 = Building2\n  protected readonly Calendar = Calendar\n  protected readonly Camera = Camera\n  protected readonly Check = Check\n  protected readonly CheckCircle2 = CheckCircle2\n  protected readonly ClipboardCheck = ClipboardCheck\n  protected readonly Clock = Clock\n  protected readonly Copy = Copy\n  protected readonly Download = Download\n  protected readonly Eye = Eye\n  protected readonly MapPin = MapPin\n  protected readonly MoreHorizontal = MoreHorizontal\n  protected readonly Percent = Percent\n  protected readonly Plus = Plus\n  protected readonly Search = Search\n  protected readonly ShieldAlert = ShieldAlert\n  protected readonly ShieldCheck = ShieldCheck\n  protected readonly UploadCloud = UploadCloud\n  protected readonly Wrench = Wrench\n\n  @Input() set initialFilter(v: InspectionFilter | undefined) {\n    this.activeFilter.set(v ?? 'all')\n  }\n  @Input() set initialRecords(v: InspectionRecord[] | undefined) {\n    this.inspectionRecords.set((v ?? defaultRecords).map((r) => ({ ...r })))\n  }\n  @Input('class') className?: string\n\n  readonly activeFilter = signal<InspectionFilter>('all')\n  readonly searchQuery = signal('')\n  readonly selectedFacility = signal('all')\n  readonly copiedGpsId = signal<string | null>(null)\n  readonly toastMessage = signal<string | null>(null)\n\n  readonly previewPhoto = signal<{ photo: PhotoEvidence; record: InspectionRecord } | null>(null)\n  readonly selectedAudit = signal<InspectionRecord | null>(null)\n  readonly isNewAuditOpen = signal(false)\n\n  readonly inspectionRecords = signal<InspectionRecord[]>(defaultRecords.map((r) => ({ ...r })))\n\n  readonly newAuditAsset = signal('AST-HVAC-4091')\n  readonly newAuditFacility = signal('Building A · Rooftop Mechanical Room')\n  readonly newAuditNotes = signal('')\n  readonly newAuditSuccess = signal(false)\n\n  private timers: ReturnType<typeof setTimeout>[] = []\n\n  constructor() {\n    inject(DestroyRef).onDestroy(() => this.timers.forEach((t) => clearTimeout(t)))\n  }\n\n  readonly filteredRecords = computed(() => {\n    const filter = this.activeFilter()\n    const facility = this.selectedFacility()\n    const q = this.searchQuery().toLowerCase().trim()\n    return this.inspectionRecords().filter((record) => {\n      if (filter === 'passed' && record.status !== 'passed') return false\n      if (filter === 'critical' && record.status !== 'critical') return false\n      if (filter === 'minor' && record.status !== 'minor') return false\n      if (facility !== 'all' && !record.facility.includes(facility)) return false\n      if (q) {\n        const hay = `${record.assetName} ${record.assetId} ${record.facility} ${record.category}`.toLowerCase()\n        if (!hay.includes(q)) return false\n      }\n      return true\n    })\n  })\n\n  get rootClass(): string {\n    return cn('text-foreground w-full space-y-6', this.className)\n  }\n\n  filterPillClass(filter: InspectionFilter): string {\n    return cn(\n      'focus-visible:ring-ring inline-flex cursor-pointer items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none',\n      this.activeFilter() !== filter && 'bg-muted/40 text-muted-foreground hover:bg-muted hover:text-foreground',\n      this.activeFilter() === filter &&\n        filter === 'all' &&\n        'bg-primary text-primary-foreground font-semibold shadow-xs',\n      this.activeFilter() === filter && filter === 'passed' && 'bg-success font-semibold text-white shadow-xs',\n      this.activeFilter() === filter && filter === 'critical' && 'bg-destructive font-semibold text-white shadow-xs',\n      this.activeFilter() === filter && filter === 'minor' && 'bg-warning font-semibold text-white shadow-xs',\n    )\n  }\n\n  scoreClass(status: InspectionStatus): string {\n    return cn(\n      'font-mono font-semibold',\n      status === 'passed' && 'text-success',\n      status === 'critical' && 'text-destructive',\n      status === 'minor' && 'text-warning',\n    )\n  }\n\n  scoreBarClass(status: InspectionStatus): string {\n    return cn(\n      'h-full rounded-full transition-[width] duration-300',\n      status === 'passed' && 'bg-success',\n      status === 'critical' && 'bg-destructive',\n      status === 'minor' && 'bg-warning',\n    )\n  }\n\n  statusBadgeClass(status: InspectionStatus): string {\n    return cn(\n      'text-xs font-semibold capitalize',\n      status === 'passed' && 'bg-success hover:bg-success/90 text-white',\n      status === 'minor' && 'bg-warning hover:bg-warning/90 text-white',\n      status === 'critical' && 'bg-destructive hover:bg-destructive/90 text-white',\n    )\n  }\n\n  signoffClass(status: InspectionStatus): string {\n    return cn(\n      'inline-flex items-center gap-1 font-mono text-xs font-medium',\n      status === 'critical' ? 'text-destructive' : 'text-success',\n    )\n  }\n\n  setSelectedFacility(value: string): void {\n    this.selectedFacility.set(value)\n  }\n\n  copyGps(gps: string, recordId: string): void {\n    try {\n      void navigator.clipboard?.writeText(gps)\n    } catch {\n      // Clipboard unavailable (jsdom) — toast still confirms the action.\n    }\n    this.copiedGpsId.set(recordId)\n    this.showToast(`GPS Coordinates ${gps} copied to clipboard`)\n    const timer = setTimeout(() => {\n      if (this.copiedGpsId() === recordId) this.copiedGpsId.set(null)\n    }, 2200)\n    this.timers.push(timer)\n  }\n\n  showToast(msg: string): void {\n    this.toastMessage.set(msg)\n    const timer = setTimeout(() => {\n      if (this.toastMessage() === msg) this.toastMessage.set(null)\n    }, 3000)\n    this.timers.push(timer)\n  }\n\n  handleOpenPhoto(photo: PhotoEvidence, record: InspectionRecord): void {\n    this.previewPhoto.set({ photo, record })\n  }\n\n  handleViewReport(record: InspectionRecord): void {\n    this.selectedAudit.set(record)\n  }\n\n  handleDownloadPdf(record: InspectionRecord): void {\n    this.showToast(`Downloading certified PDF audit report for ${record.assetId}...`)\n  }\n\n  handleCreateWorkOrder(record: InspectionRecord): void {\n    this.showToast(`Work Order generated for ${record.assetName} (Assigned to Facilities Ops)`)\n  }\n\n  handleStartNewInspection(): void {\n    this.isNewAuditOpen.set(true)\n  }\n\n  onPreviewOpenChange(open: boolean): void {\n    if (!open) this.previewPhoto.set(null)\n  }\n\n  onAuditOpenChange(open: boolean): void {\n    if (!open) this.selectedAudit.set(null)\n  }\n\n  submitNewAudit(): void {\n    this.newAuditSuccess.set(true)\n    this.showToast('New audit inspection successfully submitted and recorded!')\n    const timer = setTimeout(() => {\n      this.isNewAuditOpen.set(false)\n      this.newAuditSuccess.set(false)\n      this.newAuditNotes.set('')\n    }, 1400)\n    this.timers.push(timer)\n  }\n}\n",
      "type": "registry:block",
      "target": "~/src/app/components/blocks/field-inspection-manager/field-inspection-manager.component.ts"
    },
    {
      "path": "packages/registry-angular/blocks/field-inspection-manager/index.ts",
      "content": "export {\n  UiFieldInspectionManagerComponent,\n  type InspectionStatus,\n  type InspectionFilter,\n  type PhotoEvidence,\n  type ChecklistItem,\n  type InspectionRecord,\n} from './field-inspection-manager.component'\n",
      "type": "registry:block",
      "target": "~/src/app/components/blocks/field-inspection-manager/index.ts"
    }
  ],
  "dependencies": [
    "lucide-angular"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/angular/avatar.json",
    "https://uipkge.dev/r/angular/badge.json",
    "https://uipkge.dev/r/angular/button.json",
    "https://uipkge.dev/r/angular/card.json",
    "https://uipkge.dev/r/angular/dialog.json",
    "https://uipkge.dev/r/angular/dropdown-menu.json",
    "https://uipkge.dev/r/angular/input.json",
    "https://uipkge.dev/r/angular/select.json",
    "https://uipkge.dev/r/angular/table.json"
  ],
  "description": "Mobile/Desktop commercial property & equipment site inspection audit manager featuring GPS geostamp telemetry, 4 KPI metric cards, searchable audits table with pass/fail checklist scores, photo evidence thumbnail gallery with interactive lightbox modal, cryptographic sign-off badges, and work order dispatch workflows.",
  "categories": [
    "logistics",
    "app",
    "forms",
    "dashboard"
  ]
}