THE LABS GADGET CRM — OWNER DELETE REPAIR PATCH (AFTER PREMIUM REPAIR UI)
============================================================================
WHAT IT DOES
- Adds an Owner-only 'Delete Repair' button on Repair Details (repair-view.php).
- Deletion requires CSRF, a written reason (10-500 characters), typing exact repair
  reference, checkbox, and browser confirmation.
- Permanently removes eligible repair records, associated timer/events, QC photos
  and checks, followup records and customer QR links, atomically in one transaction.
- Keeps customer profiles intact.
- Records the deleted repair ID/device/status/owner/reason/time in a separate audit.
- Owner can review repair-delete-history.php.
- NO payment, invoice, warranty or inventory records are deleted or changed.
- Jobs with ANY invoice, payment (paid OR void), price audit, inventory movement,
  warranty (issued OR void), or RUNNING timer are blocked for safety.
- Unknown newer modules with repair_jobs foreign keys also block deletion.

FILES
REPLACE ONLY: repair-view.php (based on the latest Repair Details Premium UI)
NEW FILES: repair-delete.php, crm-repair-delete.php, repair-delete-history.php,
           assets/repair-delete.css, upgrade-repair-delete.php

INSTALL
1. BACK UP FULL PUBLIC CRM FOLDER AND MYSQL/MARIADB DATABASE SQL FIRST.
2. Verify your live repair-view.php is still from the Premium UI patch before replacing.
   If it has been customized, merge only the new CSS link and Owner Delete link.
3. Upload zip to SAME folder as app.php; Extract; overwrite ONLY repair-view.php.
4. Login OWNER and visit https://crm.thelabsgadget.com/upgrade-repair-delete.php
   Activate database audit table. Delete upgrade-repair-delete.php afterwards.
5. Open Repairs > an UNSOLD TEST repair > Repair Details > Delete Repair.
   Check the warning/confirmation before proceeding. No production data should be
   deleted to test this feature. Use staging if you plan a destructive test.

IMPORTANT
- Deletion is PERMANENT. Recovery requires a database backup.
- Running timers must be stopped.
- Invoiced/paid, inventory-used and warrantied repairs are PROTECTED. Use your
  existing void/cancellation and record retention workflows instead.
- A delete removes active Customer QR tracking for that repair; old URLs fail.
- Do not grant Delete permission to other roles; the endpoint independently
  enforces Owner access.
- No file changes to POS, Inventory, Finance or HR. No existing records are
  deleted by installing or activating the patch.
- Backup retention and business record retention obligations remain the
  business owner's responsibility.
