# Live Courts + CRM Clients - Design Document

## Overview

Consolidate Bookings + Players into a "Live Courts" real-time status board. Replace the current Players page with a CRM-style Clients page focused on memberships, expirations, and visit history.

## Navigation

Before: Dashboard | Bookings | Players | Memberships | Reports | Settings
After: Dashboard | Live Courts | Clients | Memberships | Reports | Settings

## Live Courts Page (/live)

Real-time dashboard showing all 6 courts. 3x2 grid of court cards.

### Court States
- Available (green) — empty, can check in players
- Active (blue) — players on court, shows player list
- Open Play (amber) — dedicated free courts, group scheduling
- Booked (purple) — upcoming booking in next 30 min

### Actions
- Check In — add player (search existing or walk-in name)
- End Session — clear all players
- Schedule Group (open play only) — name/note + time, no cost

### Auto-populate
Bookings for current time auto-show as active players.

## Open Play Courts

Settings > Courts toggle: "Open Play Court" (boolean).
- Amber badge on Live Courts
- No pricing on bookings
- Group scheduling: name/note + time slot, no client/payment

## Clients CRM Page (/clients)

### Stats Row
Total Clients | Active Memberships | Expiring This Month | No Membership

### Table Columns
Name | Phone | Email | Membership | Status | Expires | Last Visit | Actions

### Features
- Membership status badges (Active=green, Expiring=amber, Expired=red, None=gray)
- Filters: All / Active Members / Expiring Soon / Expired / No Membership
- Search by name, email, phone
- Client detail modal with membership + visit history

## Schema Changes

Court model: add `isOpenPlay Boolean @default(false)`

New CourtSession model:
- id, courtId, clientId (optional), walkInName (optional)
- startTime, endTime, isActive
- Relations to Court and Client
