1.  **/mnt/ssd_data/html/early_access/db_schema_update.sql**: Create a new SQL file to define the database schema updates. The file should contain the following SQL queries:
    ```sql
    -- Create sub_groups table
    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),
        FOREIGN KEY (club_id) REFERENCES clubs(club_id)
    );

    -- Create sub_group_members junction table
    CREATE TABLE sub_group_members (
        sub_group_id INT NOT NULL,
        athlete_id INT NOT NULL,
        PRIMARY KEY (sub_group_id, athlete_id),
        FOREIGN KEY (sub_group_id) REFERENCES sub_groups(sub_group_id),
        FOREIGN KEY (athlete_id) REFERENCES athletes(athlete_id)
    );
    ```
2.  **/mnt/ssd_data/html/early_access/db_connection.php**: Update the database connection file to include functions for interacting with the new tables. Add functions like `createSubGroup`, `addSubGroupMember`, `removeSubGroupMember`, and `getSubGroupMembers`.
3.  **/mnt/ssd_data/html/early_access/admin.php**: Modify the admin page to allow creation and management of sub-groups. This includes:
    *   Adding a new section for sub-group management.
    *   Implementing UI elements for creating, editing, and deleting sub-groups.
    *   Adding functionality to assign athletes to sub-groups, including validation to prevent duplicate assignments and assignments to non-existent sub-groups.
4.  **/mnt/ssd_data/html/early_access/timetable.php**: Update the timetable page to allow sessions to be associated with sub-groups.
    *   Modify the session creation/editing form to include a sub-group selection field.
    *   Update the display logic to indicate if a session is associated with a sub-group.
    *   Modify the Find POD logic to filter by sub_group_id if a session is tagged with a sub-group.
5.  **/mnt/ssd_data/html/early_access/coachs-site.php**: Modify the coach's site to display sub-group information. This includes:
    *   Displaying the sub-groups that an athlete belongs to.
    *   Filtering the timetable by sub-group.
6.  **/mnt/ssd_data/html/early_access/dashboard.php**: Update the user dashboard to display sub-group information. This includes:
    *   Displaying the sub-groups that an athlete belongs to.
7.  **/mnt/ssd_data/html/early_access/csv_upload.php**: Update the CSV upload logic to include a column for sub-group tags.  The logic should handle comma-separated strings for multiple group memberships.  Implement server-side validation to ensure the sub-groups exist.
8.  **/mnt/ssd_data/html/early_access/csv_export.php**: Update the CSV export logic to include a column for sub-group tags, ensuring it handles comma-separated strings for multiple group memberships.
9.  **/mnt/ssd_data/html/early_access/new_competition_trigger.php**: Create a new PHP script to handle the automation of sub-group creation upon competition creation. This script will listen for the new competition event and automatically create a corresponding sub-group.
10. **/mnt/ssd_data/html/early_access/index.php**: Update the How-To-Use landing page to explain the difference between Main Groups and Sub-groups.
11. **/mnt/ssd_data/html/early_access/unit_tests.php**: Create a unit test file to verify the core functionality. This includes tests to ensure that adding an athlete to 'Tuesday Gym' does not remove them from 'Main Group A', and that validation rules prevent duplicate assignments. Test that the CSV Upload is assigning the correct athletes to sub-groups. Test edge cases for CSV upload such as athletes being assigned to non-existent sub-groups, or non-existent athletes being assigned to sub-groups.
