# Dashboard patterns (`dashboard-patterns.md`)

Source views: **`resources/views/dashboard/leads/*.blade.php`**, **`dashboard/design-system/index.blade.php`**.

Machine-readable scaffolding: `resources/design-system/dashboard-patterns.php`.

## Architectural separation

Marketing uses `layouts.app`. Dashboard tooling **never** inherits that shell (prevents unintended SEO tags/service worker interplay).

Standalone documents share:

| Concern | Pattern |
| --- | --- |
| Tailwind | CDN injection + inline extend |
| Font | Inter (Google Fonts preload) |
| Background | Neutral `#f5f5f7` |
| Header | Compact sticky blurred bar |

## Shell layout

Structure:

```
sticky header → main max-w-6xl (design hub uses wider artistic max for documentation)
```

Contrast marketing `max-w-6xl` vs design hub widen only when justified locally.

### Cards

Rounded `rounded-criazo-lg`, border `black/[0.04]`, base shadow family `shadow-criazo`.

Filter states use rings:

```
ring-2 ring-{semantic}/50 ring-offset-{bg}
```

### Filters

Translucent aggregated bar (`.glass-panel`) housing search + selects + accent submit button.

### Data presentation

Operational UI grids favor:

- KPI tile row
- Card grid listing items (vs wide HTML tables except exports)

CSV export streamed from controller (chunked iteration) avoids memory regressions—mirror when augmenting endpoints.

### Modals & dropdowns

`statusModal`: backdrop blurred dark scrim (`bg-black/40`), inner white panel centered.

Menus anchored to card ellipses: absolute positioned with blur + condensed action list destructive accent.

Always supply CSRF tokens for PATCH/DELETE via JSON or form posts.

### Realtime + notifications

Leads index loads Pusher + Beams—do not initialize those scripts on lightweight internal pages unless required (Design System page intentionally omits them to reduce noise).

## Auth

All `/dashboard/*` routes share `auth` middleware from `routes/web.php`.

No `page.cache` middleware on dashboard—avoid caching personalized HTML.
