{% extends "ui/templates/base/layout.html" %}
{% block content %}
<div class="space-y-6">
  <div class="flex items-center justify-between"><h1 class="text-2xl font-semibold">Platform Plans</h1>{% if can_manage %}<a href="/platform-billing/plans/new" class="rounded-xl bg-brand-600 px-4 py-2 text-sm font-semibold text-white">New Plan</a>{% endif %}</div>
  <form method="get" class="rounded-2xl border bg-white p-4 shadow-soft"><input name="q" value="{{ q or '' }}" placeholder="Search plan" class="w-full rounded-xl border px-3 py-2 text-sm" /></form>
  <div class="overflow-hidden rounded-2xl border bg-white shadow-soft"><table class="min-w-full text-sm"><thead class="bg-slate-50 text-left"><tr><th class="px-4 py-3">Code</th><th class="px-4 py-3">Name</th><th class="px-4 py-3">For</th><th class="px-4 py-3">Cycle</th><th class="px-4 py-3 text-right">Base</th><th class="px-4 py-3">Status</th></tr></thead><tbody class="divide-y">{% for row in rows %}<tr><td class="px-4 py-3 font-medium">{{ row.code }}</td><td class="px-4 py-3">{{ row.name }}</td><td class="px-4 py-3">{{ row.target_account_type }}</td><td class="px-4 py-3">{{ row.billing_cycle }}</td><td class="px-4 py-3 text-right">₹ {{ '%.2f'|format(row.base_amount or 0) }}</td><td class="px-4 py-3">{{ 'Active' if row.is_active else 'Inactive' }}</td></tr>{% else %}<tr><td colspan="6" class="px-4 py-8 text-center text-slate-500">No plans found.</td></tr>{% endfor %}</tbody></table></div>
</div>
{% endblock %}
