# Story 12.5: PDF Template Color and Logo Update

## Story

**As a** developer
**I want to** update PDF export templates to use the new olive green colors and square logo
**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 charcoal colors
**When** I update the template
**Then** the following changes are applied:
- Header background: Charcoal → Olive Green (`#8AB357`)
- Header text: Off-White (`#E8E4DC`)
- Accent elements: Warm Gray → Light Olive (`#A5C87A`)
- Table headers: Charcoal → Olive Green
- Borders: Updated to olive palette
- Logo: Square format

### AC2: Consultations Export PDF Updated

**Given** `resources/views/pdf/consultations-export.blade.php` uses charcoal colors
**When** I update the template
**Then** colors match the new olive green palette:
- Headers: Olive Green background
- Status badges: Appropriate contrast colors
- Table styling: Olive accents

### AC3: Timelines Export PDF Updated

**Given** `resources/views/pdf/timelines-export.blade.php` uses charcoal colors
**When** I update the template
**Then** colors match the new olive green palette:
- Timeline markers: Olive Green
- Section headers: Olive Green
- Borders and accents: Light Olive

### AC4: Monthly Report PDF Updated

**Given** `resources/views/pdf/monthly-report.blade.php` uses charcoal colors
**When** I update the template
**Then** the following changes are applied:
- Header/footer: Olive Green background
- Accent colors: Light Olive
- Charts/graphs: Updated olive color scheme
- Text: Deep Black for readability
- Logo: Square format

### AC5: Monthly Report Service Updated

**Given** `app/Services/MonthlyReportService.php` contains color references for charts
**When** I update the service
**Then** chart colors use olive palette:
- Pie chart colors: Olive Green, Light Olive, Pale Olive
- Line chart border: Olive Green
- Bar chart fills: Olive variations

### AC6: PDF Logo Updated to Square Format

**Given** PDF templates include the logo
**When** PDFs are generated
**Then**:
- Logo uses square format
- Logo sized appropriately for PDF context
- Alt text/title reads "LIBRA for Rights"

### AC7: Print-Friendly Colors

**Given** PDFs are often printed
**When** colors are updated
**Then** they remain legible when printed:
- Olive Green (`#8AB357`) prints well
- Light Olive (`#A5C87A`) used for accents only (may appear light in grayscale)
- Sufficient contrast for all text
- Consider adding subtle borders for light-colored sections

### 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:
- Users export
- Consultations export
- Timelines export
- Monthly report

## 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:**
- `app/Services/MonthlyReportService.php` (chart colors)

**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 | `#4A4A42` | `#8AB357` |
| Accent/Highlight | `#C9C4BA` | `#A5C87A` |
| Light Background | `#E8E4DC` | `#E8E4DC` (unchanged) |
| Text | `#1A1A1A` | `#1A1A1A` (unchanged) |
| Table Header BG | `#4A4A42` | `#8AB357` |
| Table Header Text | `#E8E4DC` | `#E8E4DC` |
| Borders | `#C9C4BA` | `#A5C87A` |

### PDF Styling Notes

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

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

### Chart Color Palette for Reports

```php
// Monthly Report Service chart colors
$chartColors = [
    'primary' => '#8AB357',    // Olive Green
    'secondary' => '#A5C87A',  // Light Olive
    'tertiary' => '#C5D9A5',   // Pale Olive
    'quaternary' => '#6A9337', // Dark Olive
    'background' => '#E8E4DC', // Off-White
];
```

### Print Considerations

- Olive Green (`#8AB357`) prints as medium gray - good contrast
- Light Olive (`#A5C87A`) prints as light gray - use for accents only
- Ensure table borders are visible in grayscale
- Test print preview in browser

### PDF Logo Implementation

```html
<!-- Square logo for PDF -->
<img src="{{ public_path('images/logo.png') }}" style="height: 50px; width: 50px;" alt="LIBRA for Rights">
```

## Dev Checklist

- [x] Update `users-export.blade.php` colors
- [x] Update `users-export.blade.php` logo
- [x] Update `consultations-export.blade.php` colors
- [x] Update `consultations-export.blade.php` logo
- [x] Update `timelines-export.blade.php` colors
- [x] Update `timelines-export.blade.php` logo
- [x] Update `monthly-report.blade.php` colors
- [x] Update `monthly-report.blade.php` logo
- [x] Update `MonthlyReportService.php` chart colors
- [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
- [x] Verify logo displays correctly in all PDFs
- [ ] Test print preview for readability
- [ ] Test grayscale printing

## Estimation

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

## Dependencies

- Story 12.1 (Logo Deployment) must be completed for logo files
- Story 12.2 (Core CSS) should be completed for color reference consistency

---

## Dev Agent Record

### Status
Ready for Review

### Agent Model Used
Claude Opus 4.5

### File List

**Modified:**
- `resources/views/pdf/users-export.blade.php` - Updated colors from charcoal to olive green, added square logo
- `resources/views/pdf/consultations-export.blade.php` - Updated colors from charcoal to olive green, added square logo
- `resources/views/pdf/timelines-export.blade.php` - Updated colors from charcoal to olive green, added square logo
- `resources/views/pdf/monthly-report.blade.php` - Updated colors from charcoal to olive green, added square logo (header + cover page)
- `app/Services/MonthlyReportService.php` - Updated chart colors for pie and line charts
- `resources/views/livewire/admin/reports/monthly-report.blade.php` - Updated inline color styles for TOC badges
- `tests/Feature/Admin/PdfBrandColorsTest.php` - Updated tests to check for new olive green colors instead of old charcoal

### Change Log

| Date | Change | Reason |
|------|--------|--------|
| 2026-01-04 | Updated all PDF templates with olive green colors | Story 12.5 requirement |
| 2026-01-04 | Added square logo to all PDF headers | Story 12.5 requirement |
| 2026-01-04 | Updated chart colors in MonthlyReportService | Story 12.5 AC5 |
| 2026-01-04 | Updated Livewire component inline colors | Consistency with PDF changes |
| 2026-01-04 | Updated PdfBrandColorsTest to verify new colors | Tests should validate current state |

### Debug Log References
None - Implementation completed without issues

### Completion Notes
- All PDF templates updated with olive green palette (`#8AB357` primary, `#A5C87A` accent)
- Square logo (50x50px) added to all PDF headers using `public_path('images/logo.png')`
- Monthly report cover page uses larger logo (100x100px)
- Chart colors in MonthlyReportService updated for pie and line charts
- All 76 related tests pass (6 PDF color tests + 70 export tests)
- Print preview and grayscale testing should be done manually by QA
