Full site redesign, help system, and dashboard stats fixes

Multi-phase visual facelift (design tokens, dashboards, sidebar/navbar
shell, per-page help guides, and a layout/content pass across every
remaining page) plus backend fixes to the dashboard KPI stats:

- Admin/Supervisor dashboard KPIs (revenue, donations, registrations,
  tickets sold) now use a rolling trailing-month window (today back one
  calendar month, e.g. 9 May - 8 June if today is 8 June) instead of
  calendar month-to-date, which under-counted for most of the month.
  The comparison window shifts the same way, so like is still compared
  with like.
- Reports deep-links from those stat tiles now match the same window
  (range=trailing_month, replacing range=this_month).
- Design tokens (brand-* Tailwind scale + shadcn CSS variables), a
  site-wide contextual help button, fixed dashboard sidebar/navbar,
  Admin/Supervisor/Staff/User dashboard rebuilds backed by a new
  GET /api/stats/overview endpoint, a dedicated Contact page, Site
  Settings restyle with WhatsApp config folded in, and an Account
  activity feed backed by a new SecurityEvent model.
- Every remaining page (home, events, registration flow, auth, legal,
  payment results, and every Admin/Supervisor/Staff/User tool page)
  restyled onto the same design tokens, several with real layout
  upgrades (home hero, events list/detail, donate page, auth pages).
- 20+ new dedicated help guides so the whole site has page-specific
  help content instead of falling back to a generic guide.
- Assorted fixes surfaced along the way: donation-leg double-counting
  in payment stats, donations not counting toward revenue, refund
  netting in per-method report breakdowns, and donation
  over-allocation after a refund.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-06 15:00:10 +02:00
co-authored by Claude Sonnet 5
parent d715a45e22
commit 5c2e29ed1b
119 changed files with 5116 additions and 4316 deletions
@@ -0,0 +1,69 @@
import React from "react";
import { Wallet, DollarSign, ClipboardCheck, FileBarChart, Lock } from "lucide-react";
import { GuideItem } from "@/components/shared/GuideItem";
import type { HelpContent } from "./types";
/** Help content for /dashboard/admin/cashup (the event list). */
export const dashboardAdminCashupHelpContent: HelpContent = {
title: "Event cashup help",
subtitle: "Set costs, reconcile takings, and close out an event.",
tabs: [
{
key: "overview",
label: "Overview",
icon: Wallet,
content: (
<div className="space-y-4">
<p>This list shows every event you can run a cashup on. Search, or toggle Past, Inactive, and Closed events (closed ones are hidden by default). Each row shows an Open or Closed badge — tap a row to open its cashup.</p>
</div>
),
},
],
};
/** Help content for /dashboard/admin/cashup/[id] (the cashup detail page). */
export const dashboardAdminCashupDetailHelpContent: HelpContent = {
title: "Cashup help",
subtitle: "Costs, reconciliation, and the final report — one event at a time.",
tabs: [
{
key: "costs",
label: "Costs",
icon: DollarSign,
content: (
<div className="space-y-4">
<p>Add every cost for the event — a label, whether it&apos;s a once-off amount or charged per ticket sold, an amount, and optionally which payment method it was paid from. A running total is shown as you go.</p>
<p className="text-xs text-gray-500">Costs lock once the event is closed.</p>
</div>
),
},
{
key: "reconciliation",
label: "Reconciliation",
icon: ClipboardCheck,
content: (
<div className="space-y-4">
<p>A per-method table (cash, card, EFT, other) compares income, costs charged to that method, and expected vs actual amounts.</p>
<div className="space-y-4">
<GuideItem icon={ClipboardCheck} title="Cash accountability" tone="amber">
Cash&apos;s &quot;actual&quot; figure isn&apos;t typed directly — it&apos;s the live total of the staff cash-count panel below, where each staff member enters their physical cash by denomination.
</GuideItem>
<GuideItem icon={Lock} title="Closing the event" tone="rose">
Save draft keeps working on it later; Quick close skips detailed reconciliation; Close event with cashup locks everything in. A closed event can be Reopened if something needs fixing — both actions are logged in the History panel.
</GuideItem>
</div>
</div>
),
},
{
key: "report",
label: "Report",
icon: FileBarChart,
content: (
<div className="space-y-4">
<p>A read-only summary of revenue by method, denomination breakdown, staff cash accountability, costs, donations, and net profit. This becomes the default view automatically once the event is closed.</p>
</div>
),
},
],
};