# W4-FE-5 — remaining shell chrome: inpatient header + stay bill, server flow state, summaries, phone/tablet, quick bar, print, follow-up, missing catalog cards (FE)

Read _COMMON.md first. Review rows (review-B-shell-chrome.md): #9 #11 #13b #20 #21 #29 #33 #35 #43 #46 #51 #54 #65 #66 #68 #69 #70 #72; review-A #3-#6; review-D I8, I9, the "lesser" nutrition inpatient rx. Uses W1-BE-A endpoints (report: /home/moonui3/public_html/knowledge-base/plans/visit-shell-completion/reports/W1-BE-A.md): `GET clinic/encounters/{id}/stay`, `GET …/stay-bill`, `GET/PUT …/shell-state`, `signed_by_name`, lab `flag/unit/date`. You own visit-shell.component.* in this wave.

## Tasks
1. **Inpatient header (I8, #9):** the stay chip uses `GET clinic/encounters/{id}/stay` (works without hospital.beds.view): «إقامة · <جناح> · سرير <x> · اليوم <n>/<expected>» and the header doctor kv shows «المعالج: <attending>» for inpatient visits (keep the encounter doctor as «الطبيب»). VS/contexts/inpatient-stay.service.ts.
2. **«حساب الإقامة» (#35):** for inpatient/day-case visits the end-rail orders card becomes «حساب الإقامة» showing the stay-bill summary (total, paid, deposit, balance, latest lines, «فتح الحساب» link to the hospital admission bill screen if the user can). 403 → fall back to today's service-order rail. visit-summary-rail.component.ts.
3. **Server flow state (#20):** done/active stations load from and save to `shell-state` (debounced, also on «تم»); localStorage stays as an offline cache only. Locked visits read-only.
4. **Collapsed/signed summaries (#13b, #46):** history (count of positive answers / key conditions), documents («n مستندات · n مرفقات»), previous («آخر زيارة <date> · <dx>»), timeline, home_meds, team, procedures — every card has a one-line `sum` so a signed visit reads like the prototype's 15_signed.png.
5. **Phone (#70):** the sticky summary strip shows the bill total («فاتورة X ج.م» / stay balance) and tapping it opens a bottom sheet with the orders/bill rail (and the live summary). Tablet (#72): all shell buttons ≥ 44px touch height at tablet/phone widths (keep desktop sizes).
6. **Quick bar (#21):** «التاريخ/الفحص/الفحوصات/التشخيص/دواء» each opens its picker/dialog directly (history → the history card's question picker if W2-FE-2 provided one, exam → existing, lab → lab picker, dx → the diagnosis picker dialog from W2-FE-2, rx → the drug search), not just scroll.
7. **Sign + print (#43):** «توقيع + طباعة» offers (small menu) «ملخص الزيارة» / «الروشتة» / «الطلبات» (use the P5 print engine/documents already used by the rx and orders cards).
8. **Follow-up (#69):** inline «بعد N أيام / تاريخ» + instructions text saved on the follow-up task (find the follow_up_tasks API used by visit-followup-card), and «احجز» opens the booking dialog in place if a booking dialog component exists, else keep the navigation but return to the visit after booking (query param).
9. **Missing catalog cards (A #3-#6, B #54 #65 #66 #68):** shared addable cards `results` (patient lab history grouped by date with flags — reuse the lab history component used in the patient file), `meds` (current meds from prescriptions, with sentence; distinct from home_meds), `photos` (patient photos/attachments of image type — reuse the attachments component the nutrition photos card uses), `intake` (intake status card: what's missing + «أكمل» opens the wizard). Add to card-catalog.ts (kind shared, sizes per prototype CATALOG 441-446, not in defaults).
10. **Intake first-visit mode (#51):** when `clinic.intake.enabled` and the patient's intake is pending on a first visit, the shell opens the intake wizard automatically once (dismissible «تخطّي» respecting clinic.intake.skip).
11. **Nutrition inpatient rx (D lesser):** an inpatient nutrition visit's board Rx dialog passes `kind='inpatient'` (coordinate with the nutrition split from W2-FE-6: the Rx action lives in the nut_actions card).
12. **Inpatient ordering:** follow W1-BE-A's finding (report) — if `ordering_mode` is now intent for inpatient, nothing to do in FE beyond making sure the lab/rad cards show «للاستقبال/على حساب الإقامة» wording.

Run ng build at the end. Do not deploy, do not commit.

## Added by the orchestrator
13. **Intake wizard profile fields (from W3-BE-D, report reports/W3-BE-D.md §2):** features/clinic/intake/intake-wizard.component.ts renders `step.profile_fields` (kind 'profile': select/number with unit/min/max, labels, can_write) with `step.profile_values`, and saves them with `PUT clinic/patients/{patient}/intake/profile {clinical_type, values}` (returns the refreshed payload). Optional fields, not counted in completeness.
