--- id: 6-7 title: 6-7 Monthly Statistics Report status: Done date: 2026-09-27 parent: 6 --- ## Description As an admin, I want to generate comprehensive monthly PDF reports from the admin dashboard, So that I can archive business performance records, share summaries with stakeholders, and track month-over-month trends. Full implementation history: docs/stories/story-6.7-monthly-statistics-report.md ## Acceptance Criteria - [ ] "Generate Monthly Report" button in admin dashboard (below metrics cards or in a Reports section) - [ ] Month/year selector dropdown (default: previous month) - [ ] Selectable range: last 12 months only (no future months) - [ ] Libra logo and branding - [ ] Report title: "Monthly Statistics Report" - [ ] Period: Month and Year (e.g., "December 2025") - [ ] Generated date and time - [ ] List of sections with page numbers - [ ] Non-clickable (simple text list for print compatibility) - [ ] Key highlights (2-3 bullet points) - [ ] Month-over-month comparison if prior month data exists - [ ] New clients registered this month - [ ] Total active clients (end of month) - [ ] Individual vs company breakdown - [ ] Client growth trend (compared to previous month) - [ ] Total consultations this month - [ ] Approved/Completed/Cancelled/No-show breakdown - [ ] Free vs paid ratio - [ ] No-show rate percentage - [ ] Pie chart: Consultation types (rendered as image) - [ ] Active timelines (end of month) - [ ] New timelines created this month - [ ] Timeline updates added this month - [ ] Archived timelines this month - [ ] Posts published this month - [ ] Total published posts (cumulative) - [ ] Line chart showing monthly consultations trend (last 6 months ending with selected month) - [ ] Rendered as base64 PNG image - [ ] Professional A4 portrait layout - [ ] Libra branding: Navy Blue (#0A1F44) headers, Gold (#D4AF37) accents - [ ] Consistent typography and spacing - [ ] Print-friendly (no dark backgrounds, adequate margins) - [ ] Bilingual: Arabic or English based on admin's `preferred_language` setting - [ ] Loading indicator with "Generating report..." message during PDF creation - [ ] Disable generate button while processing - [ ] Auto-download PDF on completion - [ ] Success toast notification after download starts - [ ] Error handling with user-friendly message if generation fails