<script setup lang="ts">
/**
 * KBX Section Header — v60 simplified
 * Standard header for screen sections
 */
withDefaults(
  defineProps<{
    title: string
    count?: number
    countUnit?: string
    description?: string
  }>(),
  { countUnit: '건' }
)
</script>

<template>
  <header class="kbx-section-header">
    <div>
      <h2>
        {{ title }}
        <span v-if="count != null"> {{ count.toLocaleString('ko-KR') }}{{ countUnit }}</span>
      </h2>
      <p v-if="description">{{ description }}</p>
    </div>
    <div class="kbx-section-header__actions">
      <slot name="actions" />
    </div>
  </header>
</template>

<style scoped>
.kbx-section-header {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--kbx-color-border, #e5e7eb);
  padding: 0 16px;
}

.kbx-section-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--kbx-color-text, #000);
}

.kbx-section-header h2 span {
  font-size: 13px;
  color: var(--kbx-color-text-muted, #6b7280);
  font-weight: 500;
  margin-left: 6px;
}

.kbx-section-header p {
  margin: 4px 0 0;
  color: var(--kbx-color-text-muted, #6b7280);
  font-size: 12px;
}

.kbx-section-header__actions {
  display: flex;
  gap: 8px;
}

@media (prefers-color-scheme: dark) {
  .kbx-section-header {
    border-bottom-color: #374151;
  }

  .kbx-section-header h2 {
    color: #f9fafb;
  }

  .kbx-section-header h2 span,
  .kbx-section-header p {
    color: #d1d5db;
  }
}
</style>
