{% extends "ui/templates/base/layout.html" %}{% block content %}<div class="mx-auto max-w-5xl space-y-6"><div><h2 class="text-2xl font-semibold">{{ title }}</h2></div>{% for error in errors %}<div class="rounded-xl bg-rose-50 px-4 py-3 text-sm text-rose-700">{{ error }}</div>{% endfor %}<form method="post" action="{% if row and row.id %}/client-groups/{{ row.id }}/edit{% else %}/client-groups{% endif %}" class="space-y-6 rounded-2xl bg-white p-6 shadow-soft"><input type="hidden" name="csrf_token" value="{{ csrf_token }}"><div class="grid gap-5 md:grid-cols-2"><label class="text-sm font-medium">Group Code<input name="group_code" required value="{{ row.group_code if row else '' }}" class="mt-1 w-full rounded-xl border px-4 py-2"></label><label class="text-sm font-medium">Group Name<input name="group_name" required value="{{ row.group_name if row else '' }}" class="mt-1 w-full rounded-xl border px-4 py-2"></label><label class="text-sm font-medium">Group Type<select name="group_type" class="mt-1 w-full rounded-xl border px-4 py-2">{% for value in group_types %}<option {% if row and row.group_type == value %}selected{% endif %}>{{ value }}</option>{% endfor %}</select></label><label class="text-sm font-medium">Primary Contact<input name="primary_contact_name" value="{{ row.primary_contact_name if row else '' }}" class="mt-1 w-full rounded-xl border px-4 py-2"></label><label class="text-sm font-medium">Mobile<input name="primary_contact_mobile" value="{{ row.primary_contact_mobile if row else '' }}" class="mt-1 w-full rounded-xl border px-4 py-2"></label><label class="text-sm font-medium">Email<input type="email" name="primary_contact_email" value="{{ row.primary_contact_email if row else '' }}" class="mt-1 w-full rounded-xl border px-4 py-2"></label><label class="text-sm font-medium">Assigned Partner<select name="assigned_partner_user_id" class="mt-1 w-full rounded-xl border px-4 py-2"><option value="">-- None --</option>{% for p in partners %}<option value="{{ p.id }}" {% if row and row.assigned_partner_user_id == p.id %}selected{% endif %}>{{ p.full_name or p.email }}</option>{% endfor %}</select></label><label class="text-sm font-medium">Primary Consultant<select name="primary_consultant_id" class="mt-1 w-full rounded-xl border px-4 py-2"><option value="">-- None --</option>{% for c in consultants %}<option value="{{ c.id }}" {% if row and row.primary_consultant_id == c.id %}selected{% endif %}>{{ c.contact_person }}{% if c.firm_name %} — {{ c.firm_name }}{% endif %}</option>{% endfor %}</select></label></div><label class="block text-sm font-medium">Notes<textarea name="notes" rows="4" class="mt-1 w-full rounded-xl border px-4 py-2">{{ row.notes if row else '' }}</textarea></label><label class="inline-flex items-center gap-2"><input type="checkbox" name="is_active" {% if not row or row.is_active %}checked{% endif %}> Active</label><div><button class="rounded-xl bg-brand-600 px-5 py-2 text-white">Save Group</button></div></form></div>{% endblock %}