# Purpose

Provide a Cartesian grid view for managers to compare allocated hours vs actual hours logged across projects and team members for a selected month.

# Requirements

## Requirement: Display Cartesian grid

The system SHALL display a grid with projects as rows and team members as columns.

### Scenario: Grid renders with data
- GIVEN actuals exist for the selected month
- WHEN the actuals page loads
- THEN the grid displays projects as rows
- AND team members as columns
- AND each cell shows allocated hours and actual hours

### Scenario: Empty month shows no data message
- GIVEN no actuals or allocations exist for the selected month
- WHEN the actuals page loads
- THEN a message indicates no actuals are recorded

## Requirement: Month navigation

The system SHALL allow navigation between months.

### Scenario: Navigate to previous month
- GIVEN user is viewing actuals for March 2024
- WHEN user clicks previous month button
- THEN the grid updates to show February 2024 data

### Scenario: Navigate to next month
- GIVEN user is viewing actuals for March 2024
- WHEN user clicks next month button
- THEN the grid updates to show April 2024 data

## Requirement: Untracked column

The system SHALL display an "Untracked" column for actuals without a team member.

### Scenario: Untracked actuals display
- GIVEN actuals exist with team_member_id = null
- WHEN the grid renders
- THEN an "Untracked" column is visible
- AND untracked actuals appear in this column

## Requirement: Project filtering

The system SHALL allow filtering by project.

### Scenario: Filter by single project
- GIVEN multiple projects have actuals
- WHEN user selects one project in the filter
- THEN only that project's rows are displayed

### Scenario: Filter by multiple projects
- GIVEN multiple projects have actuals
- WHEN user selects multiple projects in the filter
- THEN only those projects' rows are displayed

## Requirement: Team member filtering

The system SHALL allow filtering by team member.

### Scenario: Filter by team members
- GIVEN multiple team members have actuals
- WHEN user selects specific team members in the filter
- THEN only those members' columns are displayed

## Requirement: Include inactive toggle

The system SHALL allow including inactive projects and team members.

### Scenario: Exclude inactive by default
- GIVEN inactive projects and team members exist
- WHEN no filters are applied
- THEN inactive items are excluded from the grid

### Scenario: Include inactive when enabled
- GIVEN user enables "Include inactive" checkbox
- WHEN the grid renders
- THEN inactive projects and team members are included

## Requirement: Search functionality

The system SHALL allow searching by project code, title, or member name.

### Scenario: Search by project code
- GIVEN projects with various codes exist
- WHEN user enters a search term matching a project code
- THEN only matching projects are displayed

### Scenario: Search by member name
- GIVEN team members with various names exist
- WHEN user enters a search term matching a member name
- THEN only matching members are displayed

## Requirement: Pagination

The system SHALL paginate the grid results.

### Scenario: Large dataset pagination
- GIVEN more than 25 project-member combinations exist
- WHEN the grid loads
- THEN results are paginated
- AND pagination controls are visible

### Scenario: Navigate pages
- GIVEN multiple pages of data exist
- WHEN user clicks page 2
- THEN the second page of results is displayed

## Requirement: Read-only cells for inactive projects

The system SHALL disable logging for inactive projects.

### Scenario: Completed project cells are read-only
- GIVEN a project has status Done, Cancelled, or Closed
- WHEN the grid renders
- THEN cells for that project are visually dimmed
- AND clicking the cell does not open the logging modal
