1.  **/mnt/ssd_data/html/early_access/roadmap.md:** Update the "In Progress" section to include "Sub-groups".
2.  **Database:** Create the `sub_groups` table:
    ```sql
    CREATE TABLE sub_groups (
        sub_group_id INT AUTO_INCREMENT PRIMARY KEY,
        club_id INT NOT NULL,
        name VARCHAR(255) NOT NULL,
        description TEXT,
        category VARCHAR(255),
        created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
        FOREIGN KEY (club_id) REFERENCES clubs(club_id) -- Assuming you have a 'clubs' table
    );
    ```
3.  **Database:** Create the `sub_group_members` table:
    ```sql
    CREATE TABLE sub_group_members (
        sub_group_member_id INT AUTO_INCREMENT PRIMARY KEY,
        sub_group_id INT NOT NULL,
        athlete_id INT NOT NULL,
        created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
        FOREIGN KEY (sub_group_id) REFERENCES sub_groups(sub_group_id),
        FOREIGN KEY (athlete_id) REFERENCES athletes(athlete_id), -- Assuming you have an 'athletes' table
        UNIQUE (sub_group_id, athlete_id) -- Prevent duplicate entries
    );
    ```
4.  **/mnt/ssd_data/html/early_access/admin.php:** Add UI elements to create, edit, and delete sub-groups. Include input fields for name, description, and category.  This UI should be club specific.
5.  **/mnt/ssd_data/html/early_access/admin.php:**  Add UI to assign/unassign athletes to sub-groups within the admin interface.  This UI should prevent assigning an athlete to the same sub-group twice. Implement validation to handle cases where the `sub_group_id` or `athlete_id` does not exist.
6.  **/mnt/ssd_data/html/early_access/admin.php:** Implement server-side logic to handle sub-group creation, updates, deletion, and athlete assignments/unassignments. Use prepared statements to prevent SQL injection.
7.  **/mnt/ssd_data/html/early_access/timetable.php:** Modify the timetable creation/editing interface to allow tagging sessions with sub-group IDs. Add a field to select one or more sub-groups for each session.
8.  **/mnt/ssd_data/html/early_access/timetable.php:** Update the Find POD logic to filter by `sub_group_id`. If a session is tagged with a sub-group, exclude athletes not in that sub-group.
9.  **/mnt/ssd_data/html/early_access/coachs-site.php:**  Display sub-group information (name, description, athletes) on the coach's site.
10. **/mnt/ssd_data/html/early_access/dashboard.php:**  Display the sub-groups an athlete belongs to on the user dashboard.
11. **Automated Sub-group Creation (New Competition):** Create or modify existing PHP scripts used for competition creation. When a new competition is created, automatically generate a corresponding sub-group with a relevant name (e.g., "Competition X Participants"). This will likely involve adding a function to `admin.php` and hooking it into the competition creation workflow.
12. **CSV Upload/Export:** Modify the CSV upload/export scripts (likely in `admin.php` and any relevant CSV processing files) to include a column for sub-group tags. This column should handle comma-separated strings for multiple sub-group memberships.
13. **Validation:** Enhance server-side validation scripts to detect and handle incorrect assignments to prevent errors.
14. **/mnt/ssd_data/html/index.php:** Update the "How-To-Use" landing page to explain the difference between Main Groups and Sub-groups, and how they are used within the application.
15. **Unit Tests:** Create unit tests to verify that adding an athlete to 'Tuesday Gym' does not remove them from 'Main Group A', and vice versa. Test athlete assignment, sub-group creation, deletion, and updates.
16.  **/mnt/ssd_data/html/early_access/bugs.md:** Add entry for any identified bugs.
17. **Error Handling:** Add Try/Catch blocks to handle errors during the DB interactions (insert/update/delete).
18. **/mnt/ssd_data/html/early_access/ChangeLog.md:** Add entries for each step.
