<div class="mx-auto max-w-6xl"><div class="grid gap-6 xl:grid-cols-[1fr_390px]"><section><div class="mb-5"><h2 class="font-display text-2xl font-extrabold">Professional Profile</h2><p class="mt-2 text-sm text-slate-500">Public professional information and dispatch settings.</p></div><?php if($errors=session()->getFlashdata('errors')): ?><div class="mb-4 rounded-xl bg-rose-50 p-4 text-sm text-rose-700"><?php foreach($errors as $e): ?><div><?= esc($e) ?></div><?php endforeach; ?></div><?php endif; ?><form action="/practitioner/profile" method="post" class="rounded-2xl border border-slate-100 bg-white p-6 shadow-card"><?= csrf_field() ?><div class="mb-5 flex items-center gap-4"><span class="grid h-16 w-16 place-items-center rounded-full bg-teal-50 font-display text-xl font-extrabold text-teal-700"><?= initials($user['full_name'] ?? '') ?></span><div><h3 class="font-display text-xl font-extrabold"><?= esc($user['full_name'] ?? '') ?></h3><span class="mt-1 inline-flex rounded-full px-2.5 py-1 text-[10px] font-bold <?= $profile['verification_status']==='verified'?'bg-emerald-50 text-emerald-700':'bg-amber-50 text-amber-700' ?>"><?= esc(ucwords(str_replace('_',' ',$profile['verification_status']))) ?></span></div></div><div class="grid gap-4 sm:grid-cols-2"><div><label class="mb-1.5 block text-xs font-bold text-slate-500">Profession</label><input name="profession" required value="<?= esc(old('profession',$profile['profession'])) ?>" class="w-full rounded-xl border border-slate-200 px-4 py-3 text-sm"></div><div><label class="mb-1.5 block text-xs font-bold text-slate-500">Years experience</label><input name="years_experience" type="number" min="0" value="<?= esc(old('years_experience',$profile['years_experience'])) ?>" class="w-full rounded-xl border border-slate-200 px-4 py-3 text-sm"></div><div><label class="mb-1.5 block text-xs font-bold text-slate-500">Registration number</label><input name="registration_number" value="<?= esc(old('registration_number',$profile['registration_number'])) ?>" class="w-full rounded-xl border border-slate-200 px-4 py-3 text-sm"></div><div><label class="mb-1.5 block text-xs font-bold text-slate-500">Professional body</label><input name="professional_body" value="<?= esc(old('professional_body',$profile['professional_body'])) ?>" class="w-full rounded-xl border border-slate-200 px-4 py-3 text-sm"></div><div><label class="mb-1.5 block text-xs font-bold text-slate-500">Service radius (km)</label><input name="service_radius_km" type="number" min="1" step="0.5" value="<?= esc(old('service_radius_km',$profile['service_radius_km'])) ?>" class="w-full rounded-xl border border-slate-200 px-4 py-3 text-sm"></div><div class="sm:col-span-2"><label class="mb-1.5 block text-xs font-bold text-slate-500">Professional bio</label><textarea name="bio" maxlength="5000" class="min-h-36 w-full rounded-xl border border-slate-200 px-4 py-3 text-sm"><?= esc(old('bio',$profile['bio'])) ?></textarea></div></div><div class="mt-6 flex justify-end"><button class="rounded-xl bg-teal-600 px-6 py-3 text-sm font-extrabold text-white">Save profile</button></div></form></section>
<aside><div class="rounded-2xl border border-slate-100 bg-white p-5 shadow-card"><h3 class="font-display text-lg font-extrabold">Credentials</h3><p class="mt-1 text-xs leading-5 text-slate-400">Documents are stored outside the public web directory and require operational review.</p><div class="mt-4 space-y-3"><?php if(!$credentials): ?><p class="rounded-xl bg-slate-50 p-4 text-xs text-slate-400">No credentials uploaded yet.</p><?php endif; ?><?php foreach($credentials as $c): ?><div class="rounded-xl border border-slate-100 p-4"><div class="flex items-center justify-between gap-3"><span class="text-xs font-bold"><?= esc($c['credential_type']) ?></span><span class="rounded-full bg-slate-100 px-2 py-1 text-[9px] font-bold text-slate-500"><?= esc(ucfirst($c['status'])) ?></span></div><p class="mt-1 text-[11px] text-slate-400"><?= esc($c['issuer'] ?: '') ?> <?= $c['credential_number']?'• '.esc($c['credential_number']):'' ?></p></div><?php endforeach; ?></div></div><div class="mt-5 rounded-2xl border border-slate-100 bg-white p-5 shadow-card"><h3 class="font-display font-extrabold">Submit credential</h3><form action="/practitioner/credentials" method="post" enctype="multipart/form-data" class="mt-4 space-y-3"><?= csrf_field() ?><input name="credential_type" required class="w-full rounded-xl border border-slate-200 px-3 py-2.5 text-sm" placeholder="Credential type"><input name="credential_number" class="w-full rounded-xl border border-slate-200 px-3 py-2.5 text-sm" placeholder="Number"><input name="issuer" class="w-full rounded-xl border border-slate-200 px-3 py-2.5 text-sm" placeholder="Issuer"><input name="expires_at" type="date" class="w-full rounded-xl border border-slate-200 px-3 py-2.5 text-sm"><input name="document" type="file" accept=".pdf,.jpg,.jpeg,.png" class="w-full text-xs text-slate-500"><button class="w-full rounded-xl bg-navy px-4 py-3 text-sm font-extrabold text-white">Submit for review</button></form></div></aside></div></div>
