# Story 10.4: PDF Template Color Update

## Story

**As a** developer
**I want to** update PDF export templates to use the new brand colors
**So that** all exported documents reflect the new LIBRA for Rights branding

## Acceptance Criteria

### AC1: Users Export PDF Updated

**Given** `resources/views/pdf/users-export.blade.php` uses old colors
**When** I update the template
**Then** the following changes are applied:
- Header background: Navy → Charcoal (`#4A4A42`)
- Header text: appropriate contrast color
- Accent elements: Gold → Warm Gray (`#C9C4BA`)
- Table headers: Navy → Charcoal
- Borders: updated to new palette

### AC2: Consultations Export PDF Updated

**Given** `resources/views/pdf/consultations-export.blade.php` uses old colors
**When** I update the template
**Then** colors match the new brand palette

### AC3: Timelines Export PDF Updated

**Given** `resources/views/pdf/timelines-export.blade.php` uses old colors
**When** I update the template
**Then** colors match the new brand palette

### AC4: Monthly Report PDF Updated

**Given** `resources/views/pdf/monthly-report.blade.php` uses old colors
**When** I update the template
**Then** the following changes are applied:
- Header/footer: Charcoal background
- Accent colors: Warm Gray
- Charts/graphs: updated color scheme
- Text: Deep Black for readability

### AC5: Monthly Report Service Updated

**Given** `app/Services/MonthlyReportService.php` may contain color references
**When** I review the service
**Then** any hardcoded colors are updated to new palette

### AC6: PDF Logo Updated

**Given** PDF templates include the logo
**When** PDFs are generated
**Then** the logo matches the new brand identity

### AC7: Print-Friendly Colors

**Given** PDFs are often printed
**When** colors are updated
**Then** they remain legible when printed in grayscale

### AC8: All PDF Exports Tested

**Given** the admin can export various data types
**When** I test each PDF export
**Then** colors display correctly and documents are professional

## Technical Notes

### Files to Modify

**PDF Templates:**
- `resources/views/pdf/users-export.blade.php`
- `resources/views/pdf/consultations-export.blade.php`
- `resources/views/pdf/timelines-export.blade.php`
- `resources/views/pdf/monthly-report.blade.php`

**Services (review for color references):**
- `app/Services/MonthlyReportService.php`

**Livewire Components (review for inline PDF styles):**
- `resources/views/livewire/admin/reports/monthly-report.blade.php`

### Color Mapping for PDFs

| Element | Old Color | New Color |
|---------|-----------|-----------|
| Primary Background | `#0A1F44` | `#4A4A42` |
| Accent/Highlight | `#D4AF37` | `#C9C4BA` |
| Light Background | `#F9F7F4` | `#E8E4DC` |
| Text | `#2C3E50` | `#1A1A1A` |

### PDF Styling Notes

PDF templates use inline CSS. Common patterns to update:
```html
<!-- Old -->
<div style="background-color: #0A1F44; color: #D4AF37;">

<!-- New -->
<div style="background-color: #4A4A42; color: #E8E4DC;">
```

### Print Considerations

- Charcoal (`#4A4A42`) prints well in grayscale
- Warm Gray (`#C9C4BA`) may appear light when printed - consider using for accents only
- Ensure sufficient contrast for all text

## Dev Checklist

- [x] Update `users-export.blade.php` colors
- [x] Update `consultations-export.blade.php` colors
- [x] Update `timelines-export.blade.php` colors
- [x] Update `monthly-report.blade.php` colors
- [x] Review `MonthlyReportService.php` for color references
- [x] Review `monthly-report.blade.php` Livewire component
- [x] Test Users PDF export
- [x] Test Consultations PDF export
- [x] Test Timelines PDF export
- [x] Test Monthly Report PDF generation
- [ ] Verify logo displays correctly in PDFs
- [x] Test print preview for readability

## Estimation

**Complexity:** Low
**Risk:** Low - PDF templates are isolated

## Dependencies

- Story 10.5 (Logo Update) should be completed for PDF logo consistency

---

## Dev Agent Record

### Status
Ready for Review

### Agent Model Used
Claude Opus 4.5 (claude-opus-4-5-20251101)

### File List

**Modified:**
- `resources/views/pdf/users-export.blade.php` - Updated colors to new brand palette
- `resources/views/pdf/consultations-export.blade.php` - Updated colors to new brand palette
- `resources/views/pdf/timelines-export.blade.php` - Updated colors to new brand palette
- `resources/views/pdf/monthly-report.blade.php` - Updated colors to new brand palette
- `app/Services/MonthlyReportService.php` - Updated chart colors to new brand palette
- `resources/views/livewire/admin/reports/monthly-report.blade.php` - Updated TOC preview colors

**Created:**
- `tests/Feature/Admin/PdfBrandColorsTest.php` - Tests verifying new brand colors are applied

### Change Log

1. Updated all PDF template colors from old palette to new brand colors:
   - `#0A1F44` (Navy) → `#4A4A42` (Charcoal)
   - `#D4AF37` (Gold) → `#C9C4BA` (Warm Gray)
   - `#f8f9fa` → `#E8E4DC` (Light Background)
   - `#333` → `#1A1A1A` (Deep Black text)
   - `#e9ecef` → `#C9C4BA` (border colors)

2. Updated MonthlyReportService.php chart colors:
   - Pie chart: Navy/Gold → Charcoal/Warm Gray
   - Line chart: Gold border → Charcoal border

3. Updated monthly-report Livewire component:
   - Table of contents preview badges updated to new colors

4. Created comprehensive test suite to verify colors

### Completion Notes

- All PDF templates now use the new LIBRA for Rights brand colors
- Colors are print-friendly with good grayscale contrast
- New test suite ensures colors won't regress
- Logo update (AC6) depends on Story 10.5 completion
- One pre-existing failing test (TimelineExportTest::client search) is unrelated to this story

### Debug Log References
N/A - No debugging issues encountered
