(Badge might be off-screen or wrongly placed if parent lacks `relative`)
Key Gotcha Points:
Parent must be `relative`
: For an `absolute` positioned badge to be placed correctly *on top of* or *relative to* an element (like an icon), the icon's container (or the icon itself if it can act as a_container) must have `position: relative;` (Tailwind: `relative`).
Badge must be `absolute`
: The badge itself then uses `position: absolute;` (Tailwind: `absolute`) along with positioning utilities like `top-0`, `right-0`, `left-0`, `bottom-0`.
Precise Positioning
: Classes like `translate-x-N`, `translate-y-N` (or negative versions `-translate-x-N`) are often needed to fine-tune the badge's position, especially to center it over a corner or edge. For example, `top-0 right-0 -translate-x-1/2 -translate-y-1/2` centers the badge on the top-right corner of its `relative` parent.