const COLORS: Record<string, string> = {
  // 작업지시
  CREATED: 'bg-slate-500/15 text-slate-400 border-slate-500/30',
  RELEASED: 'bg-sky-500/15 text-sky-400 border-sky-500/30',
  INPROGRESS: 'bg-amber-500/15 text-amber-400 border-amber-500/30',
  DONE: 'bg-emerald-500/15 text-emerald-400 border-emerald-500/30',
  CLOSED: 'bg-slate-600/15 text-slate-500 border-slate-600/30',
  CANCELLED: 'bg-rose-500/15 text-rose-400 border-rose-500/30',
  // 작업(job)
  ASSIGNED: 'bg-slate-500/15 text-slate-400 border-slate-500/30',
  STARTED: 'bg-amber-500/15 text-amber-400 border-amber-500/30',
  PAUSED: 'bg-orange-500/15 text-orange-400 border-orange-500/30',
  // 출하
  ORDERED: 'bg-slate-500/15 text-slate-400 border-slate-500/30',
  PICKING: 'bg-sky-500/15 text-sky-400 border-sky-500/30',
  PACKING: 'bg-violet-500/15 text-violet-400 border-violet-500/30',
  INSPECTED: 'bg-cyan-500/15 text-cyan-400 border-cyan-500/30',
  SHIPPED: 'bg-emerald-500/15 text-emerald-400 border-emerald-500/30',
  // 공정/설비 가동
  WAIT: 'bg-slate-500/15 text-slate-400 border-slate-500/30',
  RUNNING: 'bg-emerald-500/15 text-emerald-400 border-emerald-500/30',
  RUN: 'bg-emerald-500/15 text-emerald-400 border-emerald-500/30',
  IDLE: 'bg-amber-500/15 text-amber-400 border-amber-500/30',
  DOWN: 'bg-rose-500/15 text-rose-400 border-rose-500/30',
  MAINT: 'bg-orange-500/15 text-orange-400 border-orange-500/30',
  // 입고
  REQUESTED: 'bg-slate-500/15 text-slate-400 border-slate-500/30',
  INSPECTING: 'bg-amber-500/15 text-amber-400 border-amber-500/30',
  ACCEPTED: 'bg-emerald-500/15 text-emerald-400 border-emerald-500/30',
  REJECTED: 'bg-rose-500/15 text-rose-400 border-rose-500/30',
  // 실사
  COUNTED: 'bg-sky-500/15 text-sky-400 border-sky-500/30',
  ADJUSTED: 'bg-emerald-500/15 text-emerald-400 border-emerald-500/30',
  // LOT
  CONSUMED: 'bg-slate-600/15 text-slate-500 border-slate-600/30',
  EXPIRED: 'bg-rose-500/15 text-rose-400 border-rose-500/30',
  // 검사 결과
  PASS: 'bg-emerald-500/15 text-emerald-400 border-emerald-500/30',
  FAIL: 'bg-rose-500/15 text-rose-400 border-rose-500/30',
  // NCR/CAPA
  OPEN: 'bg-rose-500/15 text-rose-400 border-rose-500/30',
  REVIEW: 'bg-amber-500/15 text-amber-400 border-amber-500/30',
  DISPOSITIONED: 'bg-sky-500/15 text-sky-400 border-sky-500/30',
  VERIFY: 'bg-cyan-500/15 text-cyan-400 border-cyan-500/30',
  // severity
  CRITICAL: 'bg-rose-500/15 text-rose-400 border-rose-500/30',
  MAJOR: 'bg-orange-500/15 text-orange-400 border-orange-500/30',
  MINOR: 'bg-amber-500/15 text-amber-400 border-amber-500/30',
  // 일반
  ACTIVE: 'bg-emerald-500/15 text-emerald-400 border-emerald-500/30',
  INACTIVE: 'bg-slate-500/15 text-slate-400 border-slate-500/30',
  DELAYED: 'bg-rose-500/15 text-rose-400 border-rose-500/30',
  ON_TIME: 'bg-emerald-500/15 text-emerald-400 border-emerald-500/30',
}

export default function StatusBadge({ status }: { status?: string }) {
  const key = (status || '').toUpperCase()
  const cls = COLORS[key] || COLORS.CREATED
  return (
    <span className={`inline-block px-2 py-0.5 rounded text-xs font-medium border ${cls}`}>
      {status || '-'}
    </span>
  )
}
