# EduNest v4 — what changed

## Why Management / Teacher login said "Server error. Please try again."
The login pages post to `api/auth/login_school.php` (management) and `teacher/api/login_teacher.php` (teacher).
**Neither file existed in the server zip**, so the server answered with a 404 HTML page, the login script could not read
it as JSON and showed "Server error". The whole teacher portal (login, dashboard, attendance …) and the sign-up endpoint
(`api/auth/register_school.php`) and the messaging endpoints were missing too. All of them are now included.

## New server files
- `api/auth/login_school.php`, `api/auth/register_school.php`, `teacher/api/login_teacher.php`
- `includes/api_boot.php` – every API now always answers with clean JSON (a DB/PHP problem can no longer show "Server error"), plus login throttling (8 wrong tries / 10 min; table `sms_login_attempts` is created automatically)
- Teacher portal: `teacher/login.php, logout.php, dashboard.php, students.php, attendance.php, marks.php, timetable.php, subjects.php, messages.php, notices.php, events.php, profile.php` (+ `homework.php` that already existed), PWA files
- `api/messages_poll.php`, `api/push_subscribe.php`, `api/message_audio.php` (browser notifications / voice notes were calling files that did not exist)

## Notices
- Student & teacher notice pages rebuilt (search, type filters, urgent/new/expired badges, full text)
- Mobile API `notices` rebuilt: full text on tap, expired notices shown under "Earlier notices" instead of silently hidden, status match is case-insensitive, real errors instead of an empty list
- Teachers now have a Notices screen in the app and on the web
- Legacy pages no longer cover the screen when the Tailwind CDN is blocked

## Other fixes
- `push_check.php` called functions that don't exist (white screen) – rewritten
- `includes/messages.php` – merged the newer copy from the old `server/` folder (Android push hook). The `server/` folder is no longer needed.
- Teachers can assign homework / enter marks for every class they teach (timetable), not only the class they are class-teacher of
- Student login no longer leaks raw database errors

## Design
Each login now has its own colour world: Management = royal blue/navy, Teacher = emerald, Student = violet.
Fonts: Plus Jakarta Sans (headings) + Inter (text). Change colours in `en_palette()` in `includes/ui.php`.

## Deploy
Upload everything inside `sms/` over your existing `/sms/` folder, **except** keep your live `config/db_sms_config.php`
and `config/firebase-service-account.json`. No database changes are required.
