/*
 * «تاریخچه تغییرات اطلاعات» — the two places its own table is drawn
 * (تسک ۱۴۰۵/۰۶/۱۳/۰۱، بند ۱۵، ۲۰، ۳۱ و ۳۰).
 *
 * There is almost nothing here on purpose. The window under a field and each
 * management's central page are ordinary Filament tables, so the panel's own
 * appearance — the alternating rows, the pinned column titles, the badges, the
 * pagination — is already theirs. This file exists for one thing the panel-wide
 * table rules do not anticipate: a management table inside a *modal*.
 *
 * `panel-table-scroll.css` makes the page's main area the one scrolling box and
 * lets a wide table grow past its card, which is exactly right for a management
 * list and exactly wrong inside a window: a modal is not the main area, so a
 * table wider than the window was drawn spilling out of both its sides, with
 * the «ستون‌ها» and «فیلتر» buttons landing outside the window entirely.
 *
 * These rules give a table inside a modal its own scrolling back, and nothing
 * outside a modal is touched. They are written with the same `body.fi-body:has(…)`
 * prefix the rules they answer use, because a shorter selector of the same
 * meaning would lose to them on specificity and change nothing at all.
 */

/* A table in a window scrolls inside the window, rather than past it. */
body.fi-body:has(.fi-ta-table) .fi-modal .fi-ta-content-ctn {
    overflow: auto;
}

body.fi-body:has(.fi-ta-table) .fi-modal .fi-ta-ctn {
    width: auto;
    min-width: 0;
    max-width: 100%;
}

/* …and its toolbar and pagination keep to the window's width. */
body.fi-body:has(.fi-ta-table) .fi-modal .fi-ta-header-ctn,
body.fi-body:has(.fi-ta-table) .fi-modal .fi-ta-ctn .fi-pagination {
    width: auto;
}

/*
 * The pinned column titles belong to a page that scrolls; a window scrolls its
 * own content, so inside one they simply sit at the top of the table.
 */
body.fi-body:has(.fi-ta-table) .fi-modal .fi-ta-table > thead {
    position: static;
}

/*
 * The line under a field (بند ۹ … ۱۳). Filament's link action already draws it
 * in the panel's own green and red; what it does not do is let it sit on the
 * same line as the field's own explanation, which is where the reference panel
 * puts it. The height is trimmed to match that line rather than a button's.
 */
.fi-fo-field-content-col .fi-data-history-note {
    display: inline-flex;
    padding: 0;
    min-height: 0;
}

/*
 * «؟» به‌جای یک جمله کامل (سابقه‌سراسری-۰۰۳ تا ۰۰۶ و ۰۲۴).
 *
 * حالت «بدون سابقه» پیش از این یک جمله قرمز بود، روی یک خط مستقل، زیر تک‌تک
 * فیلدهای فرم؛ روی مدیریتی با ده‌ها فیلد، بلندترین چیز صفحه همان جمله‌ای بود که
 * می‌گفت هیچ اتفاقی نیفتاده است.
 *
 * حالا یک علامت سؤال است و در ردیف برچسب فیلد کشیده می‌شود، نه زیر آن؛ پس هیچ
 * ارتفاعی به فرم اضافه نمی‌کند. جایگاه آن «پیش از برچسب» است، نه «پس از برچسب»:
 * انتهای ردیف برچسب جایی است که خود فیلامنت «hint» فیلد را آنجا می‌کشد، و
 * نوشتن علامت در همان جایگاه، راهنمای خود فیلد را بی‌صدا پاک می‌کند. اینجا
 * علامت درست چسبیده به ابتدای برچسب می‌نشیند (سابقه‌سراسری-۰۲۲).
 */
.fi-fo-field-label-ctn:has(.fi-data-history-mark) {
    column-gap: 0.375rem;
}

.fi-data-history-mark {
    padding: 0;
    min-height: 0;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
}

.fi-data-history-mark:hover {
    text-decoration: none;
}
