# Design-System (Mobile-First, Widmann-Branding) Implementation Plan > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. **Goal:** Apply a mobile-first, Widmann-branded visual design (Tailwind CSS v4) across every existing page of the Aushilfsfahrer app, replacing the current unstyled semantic HTML — a pure presentation-layer change with no new business logic. **Architecture:** Tailwind CSS v4 (PostCSS-only setup, no `tailwind.config.js`) with a `@theme` block defining the 5 extracted Widmann brand tokens plus 4 status-semantic colors. A small `web/components/ui/` primitives layer (`Button`, `Card`, `Alert`, `FormField`, `StatusBadge`) is built once and then wired into every existing page. Mobile navigation uses a client-side drawer (`MobileNav`), replaced by a plain horizontal header row at the `lg:` breakpoint. **Tech Stack:** Next.js 16 (App Router, already in place), Tailwind CSS v4, `next/font/google` (Inter), existing Vitest suite (no new test dependencies). ## Global Constraints - Brand color tokens (exact hex, from `docs/superpowers/specs/2026-07-06-design-system-design.md`): `performance-blue` `#0071ed`, `night-blue` `#0a185c`, `asphalt-grey` `#1a1a1a`, `aluminium-grey` `#eef2f6`, `white` `#fff`. - Status-semantic colors (not brand tokens, additive per spec section 3): `status-neutral` `#6b7280` (offen), `status-warning` `#f59e0b` (unterwegs), `status-success` `#16a34a` (abgeschlossen), `status-danger` `#dc2626` (storniert; also used for error `Alert`). - Font: Inter, loaded via `next/font/google` (no runtime request to Google Fonts — Next.js self-hosts it at build time). - Mobile-first breakpoints: Tailwind v4 defaults — unprefixed = base/mobile, `md:` ≈768px, `lg:` ≈1024px. - Touch targets: minimum 44×44px (Tailwind spacing `11` = 2.75rem = 44px) on every interactive element. - Logo asset already committed at `web/public/brand/widmann-logo.svg` (SVG wordmark, viewBox `0 0 233.65 35.31`, monochrome black fill). - No changes to Server Actions, RLS policies, the data model, or any redirect/validation logic in `actions.ts` files — visual/structural changes only. - No dark mode (spec explicitly excludes it). - No new automated test dependencies (no `@testing-library/react`, no new test runner config). Verification per task is `npm run build` + `npm test` (existing Vitest suite must stay green) plus a manual/curl-based structural check. Full cross-browser/cross-breakpoint visual verification is done by the project owner in the running Docker container after all tasks land (per spec section 6) — do not attempt to spin up a headless browser for this. --- ### Task 1: Tailwind CSS v4 setup, brand tokens, Inter font **Files:** - Modify: `web/package.json` - Create: `web/postcss.config.mjs` - Modify: `web/app/globals.css` (full rewrite) - Modify: `web/app/layout.tsx:1-8` (font wiring only — header/nav restructuring happens in Task 3) - Delete: `web/app/page.module.css` (dead code — confirmed unused by `grep -r "page.module.css" web/`, `web/app/page.tsx` only calls `redirect("/dashboard")` and never renders JSX) **Interfaces:** - Produces: Tailwind utility classes for all brand/status tokens (`bg-performance-blue`, `text-performance-blue`, `border-performance-blue`, `bg-night-blue`, `text-asphalt-grey`, `bg-aluminium-grey`, `bg-status-neutral`, `bg-status-warning`, `bg-status-success`, `bg-status-danger`, `text-status-*` equivalents, etc. — Tailwind v4 auto-generates `bg-*`/`text-*`/`border-*` utilities for every `--color-*` variable in `@theme`). Produces the `font-sans` utility resolving to Inter. All later tasks consume these classes; none of them touch `globals.css` or `postcss.config.mjs` again. - [ ] **Step 1: Install Tailwind CSS v4 and its PostCSS plugin** ```bash cd web npm install -D tailwindcss@^4 @tailwindcss/postcss@^4 postcss@^8 ``` - [ ] **Step 2: Create the PostCSS config** Create `web/postcss.config.mjs`: ```js const config = { plugins: { "@tailwindcss/postcss": {}, }, }; export default config; ``` - [ ] **Step 3: Replace `globals.css` with Tailwind import + brand theme** Replace the entire contents of `web/app/globals.css` with: ```css @import "tailwindcss"; @theme { --color-performance-blue: #0071ed; --color-night-blue: #0a185c; --color-asphalt-grey: #1a1a1a; --color-aluminium-grey: #eef2f6; --color-status-neutral: #6b7280; --color-status-warning: #f59e0b; --color-status-success: #16a34a; --color-status-danger: #dc2626; --font-sans: var(--font-inter), ui-sans-serif, system-ui, sans-serif; } html, body { height: 100%; } body { color: var(--color-asphalt-grey); background: #fff; } ``` This drops the old dark-mode `@media (prefers-color-scheme: dark)` block and the Arial font fallback (Global Constraints: no dark mode; Inter replaces Arial). Tailwind's Preflight (bundled with `@import "tailwindcss"`) already resets margins/padding/box-sizing, so the old manual `* { box-sizing: border-box; padding: 0; margin: 0; }` reset is redundant and removed. - [ ] **Step 4: Delete the unused `page.module.css`** ```bash rm web/app/page.module.css ``` - [ ] **Step 5: Wire Inter into the root layout** In `web/app/layout.tsx`, add the font import and apply it to the `` tag. Change only these parts (leave the rest of the file, including the header/`` structure, untouched — Task 3 restructures those): ```tsx import { Inter } from "next/font/google"; import "./globals.css"; import { loadProfile } from "@/lib/auth/profile"; import { NavLinks } from "@/components/NavLinks"; import { LogoutButton } from "@/components/LogoutButton"; const inter = Inter({ subsets: ["latin"], variable: "--font-inter" }); export const metadata = { title: "Aushilfsfahrer", }; ``` And add `className={inter.variable}` to both `` tags in the file (the `missing-profile` branch and the main return): ```tsx ``` Also add `font-sans` to the `` tag's existing (currently absent) className in both branches: ```tsx ``` - [ ] **Step 6: Verify the build** ```bash cd web npm run build ``` Expected: exit code 0, all routes compile (same route list as before: `/`, `/_not-found`, `/auftraege`, `/auftraege/[id]`, `/auftraege/neu`, `/dashboard`, `/login`). - [ ] **Step 7: Verify the brand tokens actually compiled into CSS** ```bash cd web grep -r "0071ed" .next/static/css/*.css ``` Expected: at least one match (confirms the `@theme` block produced real utility classes containing the brand hex value — if this greps empty, the `@theme` block was not picked up and something in Steps 1-3 is wrong). - [ ] **Step 8: Run the existing test suite** ```bash cd web npm test ``` Expected: `Test Files 4 passed (4)`, `Tests 17 passed (17)` — unchanged from before this task (this task touches no logic files, only CSS/font/build config). - [ ] **Step 9: Commit** ```bash git add web/package.json web/package-lock.json web/postcss.config.mjs web/app/globals.css web/app/layout.tsx git rm web/app/page.module.css git commit -m "feat: add Tailwind CSS v4 with Widmann brand tokens and Inter font" ``` --- ### Task 2: UI primitives (Button, Card, Alert, FormField) + Login page **Files:** - Create: `web/components/ui/Button.tsx` - Create: `web/components/ui/Card.tsx` - Create: `web/components/ui/Alert.tsx` - Create: `web/components/ui/FormField.tsx` - Modify: `web/app/login/page.tsx` (full rewrite) **Interfaces:** - Consumes: Tailwind utilities from Task 1 (`bg-performance-blue`, `bg-night-blue`, `text-asphalt-grey`, `border-aluminium-grey`, `bg-status-danger`, `font-sans`). - Produces: - `Button` (default export: none; named export `Button`) — props: `variant?: "primary" | "secondary" | "destructive"` (default `"primary"`), `fullWidth?: boolean` (default `true`), plus all standard ` ); } ``` Note: `flex flex-1` on `
` requires the parent `` to be a flex column — this is already true after Task 1's `globals.css`, and Task 3 will make it explicit on ``'s className. If you run this task before Task 3 lands, vertical centering may not visibly take effect yet (the flex context isn't wired to `` until Task 3) — that's expected and not a bug; `npm run build` will still succeed and the login page will render correctly once Task 3 is also in place. Do not add `min-h-screen` or similar workarounds here — that would conflict with Task 3's layout. - [ ] **Step 6: Verify the build and tests** ```bash cd web npm run build npm test ``` Expected: build exit code 0; `Tests 17 passed (17)` (unchanged — this task touches no Server Action or validation logic). - [ ] **Step 7: Manually verify the rendered login page** ```bash cd web npm run dev -- -p 3111 & sleep 3 curl -s http://localhost:3111/login | grep -o 'bg-performance-blue\|role="alert"\|E-Mail\|Passwort' | sort -u kill %1 ``` Expected output contains `E-Mail`, `Passwort`, and `bg-performance-blue` (confirms the primary submit button rendered with the brand color class). `role="alert"` will not appear on a fresh unauthenticated load (no `error` query param) — that's expected, not a failure. - [ ] **Step 8: Commit** ```bash git add web/components/ui/Button.tsx web/components/ui/Card.tsx web/components/ui/Alert.tsx web/components/ui/FormField.tsx web/app/login/page.tsx git commit -m "feat: add UI primitives (Button, Card, Alert, FormField) and restyle login page" ``` --- ### Task 3: Header, mobile drawer navigation, desktop header **Files:** - Create: `web/components/MobileNav.tsx` (client component) - Modify: `web/components/NavLinks.tsx` (full rewrite) - Modify: `web/components/LogoutButton.tsx` (full rewrite) - Modify: `web/app/layout.tsx` (full rewrite, building on Task 1's font wiring) **Interfaces:** - Consumes: `buttonClasses`/`Button` from Task 2 (`web/components/ui/Button.tsx`), `inter.variable` font wiring already present in `web/app/layout.tsx` from Task 1. - Produces: `NavLinks` gains a new `orientation?: "vertical" | "horizontal"` prop (default `"vertical"`) — later tasks do not consume `NavLinks` directly (only `layout.tsx` does), but the prop name/type is fixed here for anyone touching `layout.tsx` again later. `MobileNav` — named export, props: `{ children: React.ReactNode }`, manages its own open/closed state, renders a hamburger button + slide-in drawer containing `children`. - [ ] **Step 1: Create the MobileNav client component** Create `web/components/MobileNav.tsx`: ```tsx "use client"; import { useEffect, useState } from "react"; export function MobileNav({ children }: { children: React.ReactNode }) { const [open, setOpen] = useState(false); useEffect(() => { if (!open) return; function onKeyDown(event: KeyboardEvent) { if (event.key === "Escape") setOpen(false); } window.addEventListener("keydown", onKeyDown); return () => window.removeEventListener("keydown", onKeyDown); }, [open]); return (
{open && (
{children}
)} ); } ``` - [ ] **Step 2: Add an orientation prop to NavLinks** Replace the entire contents of `web/components/NavLinks.tsx` with: ```tsx import Link from "next/link"; import { canManageUsers, type Role } from "@/lib/auth/roles"; export function NavLinks({ role, orientation = "vertical", }: { role: Role; orientation?: "vertical" | "horizontal"; }) { const layoutClass = orientation === "horizontal" ? "flex flex-row items-center gap-6" : "flex flex-col gap-4"; return ( ); } ``` - [ ] **Step 3: Restyle LogoutButton using the Button primitive** Replace the entire contents of `web/components/LogoutButton.tsx` with: ```tsx import { logout } from "@/app/login/actions"; import { Button } from "@/components/ui/Button"; export function LogoutButton() { return (
); } ``` - [ ] **Step 4: Rewrite the root layout with the new header** Replace the entire contents of `web/app/layout.tsx` with: ```tsx import Image from "next/image"; import Link from "next/link"; import { Inter } from "next/font/google"; import "./globals.css"; import { loadProfile } from "@/lib/auth/profile"; import { NavLinks } from "@/components/NavLinks"; import { LogoutButton } from "@/components/LogoutButton"; import { MobileNav } from "@/components/MobileNav"; const inter = Inter({ subsets: ["latin"], variable: "--font-inter" }); export const metadata = { title: "Aushilfsfahrer", }; export default async function RootLayout({ children, }: Readonly<{ children: React.ReactNode }>) { const result = await loadProfile(); if (result.status === "missing-profile") { return (

Profil nicht gefunden

Für deinen Account existiert kein Profil. Bitte wende dich an einen Admin.

); } return ( {result.status === "ok" && (
Widmann
{result.profile.name} ({result.profile.role})
{result.profile.name} ({result.profile.role})
)}
{children}
); } ``` Note: `MobileNav` is a client component receiving already-rendered Server Component output (`NavLinks`, `LogoutButton`, the profile `
`) as `children` — this is the standard, fully-supported Next.js App Router "server output passed into a client shell" composition pattern. `MobileNav` itself never imports server-only code, so this does not violate the client/server boundary. - [ ] **Step 5: Verify the build and tests** ```bash cd web npm run build npm test ``` Expected: build exit code 0; `Tests 17 passed (17)`. - [ ] **Step 6: Manually verify the header renders for an authenticated session** Reuse the cookie-jar login technique already documented in `.superpowers/sdd/task-10-report.md` / `.superpowers/sdd/task-11-report.md` (log in as `admin@aushilfsfahrer.local`, save cookies, then curl subsequent pages with `-b`): ```bash cd web npm run dev -- -p 3111 & sleep 3 curl -s -c /tmp/cookies.txt -d "email=admin@aushilfsfahrer.local" -d "password=Admin123!" -X POST http://localhost:3111/login -L -o /dev/null curl -s -b /tmp/cookies.txt http://localhost:3111/dashboard | grep -o 'aria-expanded\|widmann-logo.svg\|Abmelden' | sort -u kill %1 rm /tmp/cookies.txt ``` Expected: all three of `aria-expanded` (the hamburger button), `widmann-logo.svg` (the logo image src), and `Abmelden` appear. - [ ] **Step 7: Commit** ```bash git add web/components/MobileNav.tsx web/components/NavLinks.tsx web/components/LogoutButton.tsx web/app/layout.tsx git commit -m "feat: add mobile drawer navigation and restyle header" ``` --- ### Task 4: Dashboard page **Files:** - Modify: `web/app/dashboard/page.tsx` (full rewrite) **Interfaces:** - Consumes: `Card` from `web/components/ui/Card.tsx` (Task 2). - [ ] **Step 1: Rewrite the dashboard page** Replace the entire contents of `web/app/dashboard/page.tsx` with: ```tsx import { loadProfile } from "@/lib/auth/profile"; import { Card } from "@/components/ui/Card"; export default async function DashboardPage() { const result = await loadProfile(); if (result.status !== "ok") { return null; } return (

Dashboard

Eingeloggt als {result.profile.name} ({result.profile.role})

); } ``` - [ ] **Step 2: Verify the build and tests** ```bash cd web npm run build npm test ``` Expected: build exit code 0; `Tests 17 passed (17)`. - [ ] **Step 3: Manually verify** ```bash cd web npm run dev -- -p 3111 & sleep 3 curl -s -c /tmp/cookies.txt -d "email=admin@aushilfsfahrer.local" -d "password=Admin123!" -X POST http://localhost:3111/login -L -o /dev/null curl -s -b /tmp/cookies.txt http://localhost:3111/dashboard | grep -o 'Eingeloggt als Admin' kill %1 rm /tmp/cookies.txt ``` Expected: `Eingeloggt als Admin` appears (confirms the page still renders the correct data inside the new `Card` markup). - [ ] **Step 4: Commit** ```bash git add web/app/dashboard/page.tsx git commit -m "feat: restyle dashboard page" ``` --- ### Task 5: StatusBadge + Aufträge-Liste **Files:** - Create: `web/components/ui/StatusBadge.tsx` - Modify: `web/components/AuftragListe.tsx` (full rewrite) - Modify: `web/app/auftraege/page.tsx` (full rewrite) **Interfaces:** - Consumes: `AuftragStatus` type from `web/lib/auftraege/queries.ts:17` (`"offen" | "zugewiesen" | "unterwegs" | "abgeschlossen" | "storniert"`), `Card`/`Alert` from Task 2, `buttonClasses` from Task 2. - Produces: `StatusBadge` — named export, props: `{ status: AuftragStatus }`, renders a colored pill with the German label. Consumed by Task 6 (Auftrag-Detail) as well. - [ ] **Step 1: Create the StatusBadge primitive** Create `web/components/ui/StatusBadge.tsx`: ```tsx import type { AuftragStatus } from "@/lib/auftraege/queries"; const STATUS_LABELS: Record = { offen: "Offen", zugewiesen: "Zugewiesen", unterwegs: "Unterwegs", abgeschlossen: "Abgeschlossen", storniert: "Storniert", }; const STATUS_CLASSES: Record = { offen: "bg-gray-100 text-status-neutral", zugewiesen: "bg-blue-50 text-performance-blue", unterwegs: "bg-amber-50 text-status-warning", abgeschlossen: "bg-green-50 text-status-success", storniert: "bg-red-50 text-status-danger", }; export function StatusBadge({ status }: { status: AuftragStatus }) { return ( {STATUS_LABELS[status]} ); } ``` - [ ] **Step 2: Rewrite AuftragListe** Replace the entire contents of `web/components/AuftragListe.tsx` with: ```tsx import Link from "next/link"; import type { Auftrag } from "@/lib/auftraege/queries"; import { Card } from "@/components/ui/Card"; import { StatusBadge } from "@/components/ui/StatusBadge"; export function AuftragListe({ titel, auftraege }: { titel: string; auftraege: Auftrag[] }) { return (

{titel}

{auftraege.length === 0 ? (

Keine Aufträge.

) : (
    {auftraege.map((auftrag) => (
  • {auftrag.abholort.adresse} → {auftrag.zielort.adresse}

    {auftrag.fahrzeug.kennzeichen}

  • ))}
)}
); } ``` - [ ] **Step 3: Rewrite the Aufträge-Liste page** Replace the entire contents of `web/app/auftraege/page.tsx` with: ```tsx import Link from "next/link"; import { loadProfile } from "@/lib/auth/profile"; import { listAuftraegeFuerListe } from "@/lib/auftraege/queries"; import { AuftragListe } from "@/components/AuftragListe"; import { Alert } from "@/components/ui/Alert"; import { buttonClasses } from "@/components/ui/Button"; export default async function AuftraegePage({ searchParams, }: { searchParams: Promise<{ error?: string }>; }) { const { error } = await searchParams; const profileResult = await loadProfile(); if (profileResult.status !== "ok") { return null; } const { meine, offene, alle } = await listAuftraegeFuerListe(profileResult.profile); const istFahrer = profileResult.profile.role === "fahrer"; const kannAnlegen = profileResult.profile.role === "admin" || profileResult.profile.role === "disponent"; return (

Aufträge

{kannAnlegen && ( Neuen Auftrag anlegen )}
{error && (
{error}
)} {istFahrer ? ( <> ) : ( )}
); } ``` Note: `` is styled directly with `buttonClasses(...)` rather than wrapped around a `
)} {auftrag.status === "zugewiesen" && istEigenerAuftrag && (

Fahrt beginnen

{PFLICHT_FOTO_POSITIONEN.map((position) => ( ))}
)} {auftrag.status === "unterwegs" && istEigenerAuftrag && (

Fahrt beenden

)} {auftrag.status === "unterwegs" && istEigenerAuftrag && (

Schadensfoto nachtragen

)} {auftrag.status === "abgeschlossen" && folgeauftrag && (

Anschlussauftrag verfügbar:{" "} Jetzt übernehmen

)} {kannStornieren && auftrag.status !== "abgeschlossen" && auftrag.status !== "storniert" && (
)}
); } ``` - [ ] **Step 2: Verify the build and tests** ```bash cd web npm run build npm test ``` Expected: build exit code 0; `Tests 17 passed (17)`. - [ ] **Step 3: Manually verify against a real order** This page's forms are status-conditional, so a meaningful check needs at least one real `auftraege` row. Reuse the seed-data approach already used for this project's local dev/master-stack verification (insert a row directly via `docker exec -i psql`, or use the existing `orte`/`fahrzeuge` sample rows if present from prior manual testing) — then: ```bash cd web npm run dev -- -p 3111 & sleep 3 curl -s -c /tmp/cookies.txt -d "email=admin@aushilfsfahrer.local" -d "password=Admin123!" -X POST http://localhost:3111/login -L -o /dev/null curl -s -b /tmp/cookies.txt "http://localhost:3111/auftraege/" | grep -o 'Auftrag übernehmen\|Fahrt beginnen\|Fahrt beenden\|Auftrag stornieren' | sort -u kill %1 rm /tmp/cookies.txt ``` Expected: exactly the form(s) matching that order's current `status` appear (e.g. an `offen` order shows only `Auftrag übernehmen`; do not expect all four to appear simultaneously — they are mutually exclusive by status). - [ ] **Step 4: Commit** ```bash git add "web/app/auftraege/[id]/page.tsx" git commit -m "feat: restyle Auftrag detail page" ``` --- ### Task 7: Auftrag-anlegen page **Files:** - Modify: `web/app/auftraege/neu/page.tsx` (full rewrite) **Interfaces:** - Consumes: `Card`, `Button`, `Alert` from Task 2, `FormField`/`FIELD_CLASSES` from Task 2. Does not touch `web/app/auftraege/neu/actions.ts`. - [ ] **Step 1: Rewrite the Auftrag-anlegen page** Replace the entire contents of `web/app/auftraege/neu/page.tsx` with: ```tsx import { redirect } from "next/navigation"; import { createAuftrag } from "./actions"; import { listOrte, listFahrzeuge } from "@/lib/auftraege/queries"; import { loadProfile } from "@/lib/auth/profile"; import { Card } from "@/components/ui/Card"; import { Button } from "@/components/ui/Button"; import { Alert } from "@/components/ui/Alert"; import { FormField, FIELD_CLASSES } from "@/components/ui/FormField"; export default async function NeuerAuftragPage({ searchParams, }: { searchParams: Promise<{ error?: string; vorgaenger_auftrag_id?: string }>; }) { const profileResult = await loadProfile(); // Seitenebenen-Gate zusaetzlich zur INSERT-RLS-Policy auf `auftraege` // (admin/disponent-only): ohne diesen Check wuerde die Seite das Formular // auch Fahrern/Readonly anzeigen, obwohl ein Submit dann ohnehin an der // RLS-Policy scheitern wuerde -- das ist verwirrende UX statt eines echten // Sicherheitslecks, aber ein frueher Redirect ist die klarere Loesung. if ( profileResult.status !== "ok" || (profileResult.profile.role !== "admin" && profileResult.profile.role !== "disponent") ) { redirect(`/auftraege?error=${encodeURIComponent("Nur Disponent/Admin duerfen Auftraege anlegen.")}`); } const { error, vorgaenger_auftrag_id } = await searchParams; const [orte, fahrzeuge] = await Promise.all([listOrte(), listFahrzeuge()]); return (

Neuen Auftrag anlegen

{error && (
{error}
)}
{vorgaenger_auftrag_id && ( )}
); } ``` - [ ] **Step 2: Verify the build and tests** ```bash cd web npm run build npm test ``` Expected: build exit code 0; `Tests 17 passed (17)`. - [ ] **Step 3: Manually verify** ```bash cd web npm run dev -- -p 3111 & sleep 3 curl -s -c /tmp/cookies.txt -d "email=admin@aushilfsfahrer.local" -d "password=Admin123!" -X POST http://localhost:3111/login -L -o /dev/null curl -s -b /tmp/cookies.txt http://localhost:3111/auftraege/neu | grep -o 'Abholort\|Zielort\|Fahrzeug\|Auftrag anlegen' kill %1 rm /tmp/cookies.txt ``` Expected: all four labels appear. - [ ] **Step 4: Commit** ```bash git add web/app/auftraege/neu/page.tsx git commit -m "feat: restyle Auftrag-anlegen page" ``` --- ## After all tasks Once all 7 tasks are committed and reviewed, this branch is a pure presentation-layer change with no schema/RLS/Server-Action modifications — the final whole-branch review can be lighter-weight than the Auftragsverwaltung branch's (no new attack surface to probe), focused on: visual/structural consistency across pages, no accidental logic changes in any `actions.ts` or `lib/` file (diff those files first — they should show zero changes), and `npm run build`/`npm test` green on the full accumulated diff. The project owner will do the final cross-breakpoint visual check themselves in the rebuilt Docker container (`docker compose build web && docker compose up -d web`, per the existing project convention already used after the Auftragsverwaltung merge).