/* The record count beside a management in the menu (شمارنده-بالیگپا-۰۰۸ … ۰۱۴).

   Here rather than in `theme.css` for the same reason every other panel-wide
   sheet in `public/css/` is: this ships as a file the page links, so it takes
   effect on the server without the assets being rebuilt.

   The colour is not chosen here. `--panel-accent` is Baligpa's identity, `#1f7957`,
   declared once in `panel-identity.css`, and `--panel-on-accent` is the white that
   file pairs with it — the same pair the sidebar already fills the open management
   with. So the counter cannot drift from the panel's green, and moving the
   identity moves the counter with it. */

/* Filament wraps whatever a navigation item's badge returns in its own
   `<x-filament::badge>`, which brings a tint, a ring and padding of its own. Where
   — and only where — that wrapper holds this counter, it is stood down, so what is
   drawn is one solid pill and not a pill inside a pill. Every other badge in the
   panel, including the two amber queues, is untouched. */
.fi-badge:has(> .fi-menu-count) {
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    min-width: 0;
}

.fi-menu-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    /* Real padding either side rather than a fixed width: ۰ and ۱۲٬۵۰۰ both have
       to sit in it, and the badge has to widen for the longer one rather than clip
       it (شمارنده-بالیگپا-۰۱۳ و ۰۱۴). */
    padding: 0.0625rem 0.375rem;
    border-radius: 9999px;
    background-color: var(--panel-accent, #1f7957);
    color: var(--panel-on-accent, #ffffff);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.125rem;
    white-space: nowrap;
    /* So a four-figure number does not jitter the row it sits on. */
    font-variant-numeric: tabular-nums;
}

/* The management being stood in is itself filled with `--panel-accent`, so there
   the pill is inverted rather than being green on green. */
.fi-sidebar-item-active .fi-menu-count,
.dark .fi-sidebar-item-active .fi-menu-count {
    background-color: var(--panel-on-accent, #ffffff);
    color: var(--panel-accent, #1f7957);
}

/* تسک ۳۲ — in the menu's window every counter stands in one column at the row's
   far end, rather than right after a name of whatever length: the numbers of a
   menu read down one line, and a long name or a long number cannot run into
   the other. The name keeps the room it needs and wraps before it would. */
.fi-sidebar-flyout-item > .fi-menu-count,
.fi-sidebar-flyout-item > [data-menu-count] {
    margin-inline-start: auto;
    flex: 0 0 auto;
}

/* The management being looked at is filled green in the window too; its counter
   turns white there, as in the column, instead of vanishing green on green. */
.fi-sidebar-flyout-current > .fi-menu-count {
    background-color: var(--panel-on-accent, #ffffff);
    color: var(--panel-accent, #1f7957);
}
