<section class="border-b border-gray-300 p-2 shrink-0 bg-control-panel">
  <p class="text-sm text-gray-700 mb-2">관리자 페이지에서 사용할 지자체를 선택하세요. 선택한 지자체 기준으로 목록·등록이 표시됩니다.</p>
</section>
<div class="border border-gray-300 overflow-auto mt-2 p-4">
  <?php if (empty($list)): ?>
  <p class="text-gray-600 py-4">등록된 지자체가 없습니다. <a href="<?= base_url('admin/local-governments') ?>" class="text-blue-600 hover:underline">지자체 관리</a>에서 먼저 등록하세요.</p>
  <?php else: ?>
  <form action="<?= base_url('admin/select-local-government') ?>" method="POST" class="space-y-3">
    <?= csrf_field() ?>
    <ul class="space-y-2">
      <?php foreach ($list as $lg): ?>
      <li class="flex items-center gap-2">
        <input type="radio" name="lg_idx" id="lg_<?= $lg->lg_idx ?>" value="<?= (int) $lg->lg_idx ?>" class="rounded border-gray-300 text-blue-600 focus:ring-blue-500"/>
        <label for="lg_<?= $lg->lg_idx ?>" class="text-sm font-medium text-gray-800 cursor-pointer"><?= esc($lg->lg_name) ?> (<?= esc($lg->lg_code) ?>)</label>
      </li>
      <?php endforeach; ?>
    </ul>
    <button type="submit" class="bg-btn-search text-white px-4 py-2 rounded-sm text-sm font-medium shadow hover:opacity-90 transition">선택하고 관리자 페이지로 이동</button>
  </form>
  <?php endif; ?>
</div>
