<section class="border-b border-gray-300 p-2 shrink-0 bg-control-panel">
  <span class="text-sm font-bold text-gray-700">대행소 수정</span>
</section>
<div class="border border-gray-300 rounded-lg p-4 mt-2 bg-white max-w-3xl">
  <form action="<?= mgmt_url('sales-agencies/update/' . (int) $item->sa_idx) ?>" method="POST" class="space-y-4">
    <?= csrf_field() ?>

    <div class="flex flex-wrap items-center gap-2">
      <label class="block text-sm font-bold text-gray-700 w-28">대행소 구분 <span class="text-red-500">*</span></label>
      <input class="border border-gray-300 rounded px-3 py-1.5 text-sm w-60" name="sa_kind" type="text" value="<?= esc(old('sa_kind', $item->sa_kind ?? '')) ?>" required maxlength="50"/>
    </div>

    <div class="flex flex-wrap items-center gap-2">
      <label class="block text-sm font-bold text-gray-700 w-28">대행소 코드 <span class="text-red-500">*</span></label>
      <input class="border border-gray-300 rounded px-3 py-1.5 text-sm w-60" name="sa_code" type="text" value="<?= esc(old('sa_code', $item->sa_code ?? '')) ?>" required maxlength="50"/>
    </div>

    <div class="flex flex-wrap items-center gap-2">
      <label class="block text-sm font-bold text-gray-700 w-28">대행소 명 <span class="text-red-500">*</span></label>
      <input class="border border-gray-300 rounded px-3 py-1.5 text-sm w-60" name="sa_name" type="text" value="<?= esc(old('sa_name', $item->sa_name)) ?>" required maxlength="100"/>
    </div>

    <div class="flex gap-2 pt-2">
      <button type="submit" class="bg-btn-search text-white px-6 py-1.5 rounded-sm text-sm shadow hover:opacity-90 transition">수정</button>
      <a href="<?= mgmt_url('sales-agencies') ?>" class="bg-gray-200 text-gray-700 px-6 py-1.5 rounded-sm text-sm hover:bg-gray-300 transition">취소</a>
    </div>
  </form>
</div>
