<section class="border-b border-gray-300 p-2 shrink-0 bg-control-panel">
  <div class="flex items-center gap-2">
    <a href="<?= base_url('admin/bag-prices') ?>" class="text-blue-600 hover:underline text-sm">&larr; 단가 목록</a>
    <span class="text-gray-400">|</span>
    <span class="text-sm font-bold text-gray-700">단가 변경 이력 — <?= esc($item->bp_bag_name) ?> (<?= esc($item->bp_bag_code) ?>)</span>
  </div>
</section>
<div class="border border-gray-300 overflow-auto mt-2">
  <table class="w-full data-table">
    <thead>
      <tr>
        <th class="w-16">번호</th>
        <th>변경 필드</th>
        <th>이전 값</th>
        <th>변경 값</th>
        <th>변경일시</th>
      </tr>
    </thead>
    <tbody class="text-right">
      <?php foreach ($list as $row): ?>
      <tr>
        <td class="text-center"><?= esc($row->bph_idx) ?></td>
        <td class="text-left pl-2"><?= esc($row->bph_field) ?></td>
        <td><?= number_format((float) $row->bph_old_value) ?></td>
        <td><?= number_format((float) $row->bph_new_value) ?></td>
        <td class="text-center"><?= esc($row->bph_changed_at) ?></td>
      </tr>
      <?php endforeach; ?>
      <?php if (empty($list)): ?>
      <tr><td colspan="5" class="text-center text-gray-400 py-4">변경 이력이 없습니다.</td></tr>
      <?php endif; ?>
    </tbody>
  </table>
</div>
