<div class="rounded-3xl border border-slate-200 bg-white shadow-soft">
  <div class="flex flex-col gap-3 border-b border-slate-100 p-5 md:flex-row md:items-center md:justify-between">
    <div><h2 class="text-lg font-bold text-slate-900">Financial Years</h2><p class="text-sm text-slate-500">Create, mark current, lock and manage financial years from existing FY settings.</p></div>
    <a href="/system-settings/financial-years" class="rounded-xl bg-brand-600 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-700">Manage FY</a>
  </div>
  <div class="overflow-x-auto">
    <table class="min-w-full divide-y divide-slate-100 text-sm">
      <thead class="bg-slate-50 text-left text-xs font-semibold uppercase tracking-wide text-slate-500"><tr><th class="px-5 py-3">FY</th><th class="px-5 py-3">AY</th><th class="px-5 py-3">Period</th><th class="px-5 py-3">Current</th><th class="px-5 py-3">Lock Status</th></tr></thead>
      <tbody class="divide-y divide-slate-100">
        {% for fy in financial_years %}
        <tr class="hover:bg-slate-50"><td class="px-5 py-3 font-semibold text-slate-900">{{ fy.year_code }}</td><td class="px-5 py-3">{{ fy.assessment_year }}</td><td class="px-5 py-3 text-slate-600">{{ fy.start_date }} to {{ fy.end_date }}</td><td class="px-5 py-3">{% if fy.is_current %}<span class="rounded-full bg-emerald-50 px-2 py-1 text-xs font-semibold text-emerald-700">Current</span>{% else %}<span class="text-slate-400">-</span>{% endif %}</td><td class="px-5 py-3">{% if fy.is_locked %}<span class="rounded-full bg-slate-100 px-2 py-1 text-xs font-semibold text-slate-700">Locked</span>{% else %}<span class="rounded-full bg-amber-50 px-2 py-1 text-xs font-semibold text-amber-700">Open</span>{% endif %}</td></tr>
        {% else %}
        <tr><td colspan="5" class="px-5 py-8 text-center text-slate-500">No financial years created yet.</td></tr>
        {% endfor %}
      </tbody>
    </table>
  </div>
</div>
