# WP6 FE (templates dialog) + WP7 (custom renderers)
Read first: LEDGER.md (contract, notes for WP2/WP3-5), features/gyn/customize/* (GynCustomizeService, *gynHide directive, gyn-element-keys.ts helpers), visit-shell.component.* (gear menu + form-mode header).

WP6 FE — «القوالب» in the customize header (form mode, managers only, clinic.layout.manage):
BE (done, Modules/Clinic): GET /clinic/layout-templates?clinical_type=gyn_ob → {data:[{id,clinical_type,name,description,is_main,payload,created_at,updated_at}]} main first; POST {clinical_type,name,description?,from_current:true} → {data,skipped}; PUT {id} {name?,description?}; DELETE {id}; POST {id}/apply (replaces the company profile for that type, becomes main); GET {id}/export (JSON attachment, format 'moon.layout-template'); POST layout-templates/import (multipart `file`) → {data,skipped}.
Build a compact dialog: list (★ main badge), «احفظ التخصيص الحالي كقالب» (name, desc), apply/«اجعله الأساسي» with confirm (it overwrites the current customization), rename, delete, export (download via HttpClient blob with X-Authorization), import (file input) and show `skipped` list if any. After apply reload the visit layout so the screen reflects it. Save-as of unsaved edits: ask to save edits first.

WP7 — elements rendered OUTSIDE GynModuleForm get the same treatment: every column/row/button/header/summary hideable with *gynHide (kinds col/row/btn/hdr/sum/card/el) using stable codes, required + ⓘ where they edit schema fields, and the unified option picker where they use inline selects. Renderers: gyn-obhx-card (OB history table, its own selects/pickers), pregnancy / antenatal flowsheet / delivery grids, POP-Q grid, PROM score, UDS report, spouse panel, operation header, cycle/discharge/followup/urogyn custom parts (find them under features/gyn/cards and features/gyn/**). For table columns: hiding a column hides header + cells. Also: the required checker should register these when they edit required schema fields. Keep keys ≤ limits via the helpers.
Also fix: required check covers only mounted forms — make GynCustomizeService.missingRequired also evaluate unopened GYN tabs/modules from the visit's stored answers + schema + rules (pure function, no rendering), so a required field on an unopened tab still blocks signing.

Conventions: Angular 21 + PrimeNG 21; append i18n keys without reformatting; bump I18N_VERSION; build green; do not commit/deploy; never touch src/assets/config.json. Saving space: no extra height in normal mode.
