@props([
    'label',
    'variant' => 'neutral',
])

@php
    $severity = config('theme.ui.severity', []);
    $map = [
        'success' => $severity['success'] ?? config('theme.colors.primary'),
        'danger' => $severity['danger'] ?? config('theme.colors.accent'),
        'critical' => $severity['critical'] ?? $severity['danger'] ?? '#dc3545',
        'warning' => $severity['warning'] ?? '#ffc107',
        'info' => $severity['info'] ?? config('theme.colors.primary'),
        'muted' => $severity['muted'] ?? config('theme.colors.muted'),
        'neutral' => config('theme.colors.muted'),
    ];
    $bg = $map[$variant] ?? $map['neutral'];
    $fg = in_array($variant, ['warning'], true) ? config('theme.colors.text') : config('theme.colors.on_badge');
@endphp

<span {{ $attributes->class('badge rounded-pill small') }}
    style="background-color: {{ $bg }}; color: {{ $fg }};">{{ $label }}</span>
