/* -------- Email template gallery cards (theme-aware) -------- */
.tg-card {
    background: #ffffff;
    border: 1px solid #d1d5db;                 /* gray-300 — clearly visible */
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.tg-card:hover {
    border-color: #9ca3af;                     /* gray-400 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.dark .tg-card {
    background: #1f2937;                        /* gray-800 */
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: none;
}

.dark .tg-card:hover {
    border-color: rgba(255, 255, 255, 0.28);
}

/* ===========================================================================
 * UI density (admin panel)
 *
 * Three spacing scales, selected by a data-density attribute on <html> that
 * resources/views/filament/density-prepaint.blade.php writes before first
 * paint. Mirrors the density setting in the client portal, but the two are
 * independent preferences on independent origins — an admin's choice here says
 * nothing about their client-side one.
 *
 * WHY ATTRIBUTE + TOKENS. Keying off one root attribute means adding a level
 * is a token block, not a sweep of selectors.
 *
 * The :root block is the "default" level, so a page with no attribute at all
 * (localStorage blocked, script not yet run) renders exactly as Filament ships.
 * EVERY default below is Filament's own value, and that invariant is the whole
 * point: it lets "Default" be a genuine no-op rather than a third opinion
 * about spacing. Anything added here has to be read out of Filament's CSS
 * first (vendor/filament/<package>/resources/css) — see the comment on each
 * token for the rule it mirrors. Re-check them after a Filament upgrade.
 *
 * Never write an asterisk followed by a slash anywhere in this comment, not
 * even inside a path glob: CSS ends a comment at the first one, the rest of
 * the comment then reads as the selector of the :root rule below, and the
 * browser drops that whole rule. That happened from 2026-11-09 to 2026-11-22:
 * "Default" had no tokens, so every padding below computed to 0.
 *
 * SCOPE. Density moves the space BETWEEN and AROUND content: page rhythm,
 * panel padding, table rows, widget gaps, modal padding. It deliberately does
 * not shrink controls — buttons, tabs, inputs, action groups — because those
 * are hit targets, and a preference about how much fits on one screen must not
 * quietly shrink the things people have to click. One exception, asked for by
 * the owner (2026-11-22): at Compact the buttons in a table's header bar drop
 * to Filament's small size, because Compact halves that bar's padding and a
 * full-size button filled it to within 2px of the card's edge.
 * ========================================================================= */
:root,
html[data-density="default"] {
    /* Page shell */
    --density-page-py: 2rem;         /* .fi-page-header-main-ctn (py-8) */
    --density-page-gap: 2rem;        /* .fi-page-header-main-ctn (gap-y-8) */
    --density-gutter-md: 1.5rem;     /* .fi-main (md:px-6) */
    --density-gutter-lg: 2rem;       /* .fi-main (lg:px-8) */
    --density-header-gap: 1rem;      /* .fi-header (gap-4) */

    /* Stacked groups: form/infolist schemas, widget grids */
    --density-group-gap: 1.5rem;     /* .fi-sc-form, .fi-sc.fi-sc-has-gap, .fi-wi (gap-6) */
    --density-stats-gap: 1rem;       /* stats widget heading to stats (gap-y-4) */

    /* Panels */
    --density-section-p: 1.5rem;     /* .fi-section-content (p-6) — also the
                                        inline padding of the bars above and
                                        below it (px-6); the two must stay
                                        equal or headings stop lining up with
                                        the content they head */
    --density-bar-py: 1rem;          /* .fi-section-header/-footer, .fi-ta-header (py-4) */
    --density-stat-p: 1.5rem;        /* .fi-wi-stats-overview-stat (p-6) */

    /* Tables */
    --density-cell-py: 1rem;         /* cell wrappers (py-4) */
    --density-header-py: 0.875rem;   /* .fi-ta-header-cell (py-3.5) */
    --density-toolbar-py: 0.75rem;   /* .fi-ta-header-toolbar, .fi-pagination (py-3) */
    --density-empty-py: 3rem;        /* .fi-ta-empty-state (py-12) */

    /* Modals */
    --density-modal-py: 1.5rem;      /* .fi-modal-content (py-6) */
    --density-modal-gap: 1rem;       /* .fi-modal-content (gap-y-4) */

    /* Navigation */
    --density-sidebar-py: 0.5rem;    /* .fi-sidebar-item-btn (p-2) */
}

html[data-density="comfortable"] {
    --density-page-py: 1.5rem;
    --density-page-gap: 1.5rem;
    --density-gutter-md: 1.125rem;
    --density-gutter-lg: 1.5rem;
    --density-header-gap: 0.75rem;

    --density-group-gap: 1.125rem;
    --density-stats-gap: 0.75rem;

    --density-section-p: 1.125rem;
    --density-bar-py: 0.75rem;
    --density-stat-p: 1.125rem;

    --density-cell-py: 0.625rem;
    --density-header-py: 0.625rem;
    --density-toolbar-py: 0.5rem;
    --density-empty-py: 2.25rem;

    --density-modal-py: 1.125rem;
    --density-modal-gap: 0.75rem;

    --density-sidebar-py: 0.375rem;
}

html[data-density="compact"] {
    --density-page-py: 1rem;
    --density-page-gap: 1rem;
    --density-gutter-md: 0.75rem;
    --density-gutter-lg: 1rem;
    --density-header-gap: 0.5rem;

    --density-group-gap: 0.75rem;
    --density-stats-gap: 0.5rem;

    --density-section-p: 0.75rem;
    --density-bar-py: 0.5rem;
    --density-stat-p: 0.75rem;

    --density-cell-py: 0.375rem;
    --density-header-py: 0.375rem;
    --density-toolbar-py: 0.375rem;
    --density-empty-py: 1.5rem;

    --density-modal-py: 0.75rem;
    --density-modal-gap: 0.5rem;

    --density-sidebar-py: 0.25rem;
}

/*
 * Everything below is scoped to html[data-density] so nothing applies until a
 * level is set. This file is not in a cascade layer and Filament 4's CSS is
 * (@layer components), so these rules win over Filament's whatever their
 * specificity — keep the selectors narrow.
 */

/* -------- Page shell -------- */

html[data-density] .fi-page-header-main-ctn {
    padding-block: var(--density-page-py);
    row-gap: var(--density-page-gap);
}

/*
 * .fi-main carries `px-4 md:px-6 lg:px-8`, so one unconditional override would
 * flatten that ramp and make phones WORSE at the default level — 2rem of
 * gutter on a 375px screen. The gutter is therefore only re-stated at the two
 * breakpoints that have room to give; below md, Filament's px-4 is already as
 * tight as a page gutter should get.
 */
@media (min-width: 768px) {
    html[data-density] .fi-main {
        padding-inline: var(--density-gutter-md);
    }
}

@media (min-width: 1024px) {
    html[data-density] .fi-main {
        padding-inline: var(--density-gutter-lg);
    }
}

html[data-density] .fi-header {
    gap: var(--density-header-gap);
}

/* -------- Stacked groups -------- */

/*
 * .fi-sc-form stacks a page's sections. .fi-sc-has-gap is the schema grid
 * shared by forms AND infolists, so `gap` also tightens the space between
 * side-by-side fields, which is the point. A schema made ->dense() keeps
 * Filament's own tighter gap.
 */
html[data-density] .fi-sc-form:not(.fi-dense) {
    row-gap: var(--density-group-gap);
}

html[data-density] :is(.fi-sc.fi-sc-has-gap:not(.fi-sc-dense), .fi-wi) {
    gap: var(--density-group-gap);
}

/* A stats widget draws its heading and its stats in a section that is not
   contained (no card around it), stacked with gap-y-4. */
html[data-density] .fi-wi-stats-overview .fi-section-not-contained:not(.fi-aside):not(.fi-compact),
html[data-density] .fi-wi-stats-overview .fi-section-not-contained:not(.fi-aside):not(.fi-compact) > .fi-section-content-ctn {
    row-gap: var(--density-stats-gap);
}

/* -------- Panels -------- */

/*
 * Only contained sections (cards) are padded. A section that is not contained
 * has no padding of its own (every stats widget draws one), a compact section
 * is Filament's own tighter variant (->compact()), and a divided section pads
 * each child instead of its content box.
 */
html[data-density] .fi-section:not(.fi-section-not-contained):not(.fi-compact):not(.fi-divided) > .fi-section-content-ctn > .fi-section-content {
    padding: var(--density-section-p);
}

html[data-density] .fi-section:not(.fi-section-not-contained):not(.fi-compact).fi-divided > .fi-section-content-ctn > .fi-section-content > * {
    padding: var(--density-section-p);
}

/*
 * :not(.fi-aside) is load-bearing. An aside section renders its header OUTSIDE
 * the card, with no padding at all — padding here would ADD inset to text
 * meant to sit flush beside the panel.
 */
html[data-density] .fi-section:not(.fi-section-not-contained):not(.fi-aside):not(.fi-compact) > .fi-section-header {
    padding-block: var(--density-bar-py);
    padding-inline: var(--density-section-p);
}

html[data-density] .fi-section:not(.fi-section-not-contained):not(.fi-compact) > .fi-section-content-ctn > .fi-section-footer {
    padding-block: var(--density-bar-py);
    padding-inline: var(--density-section-p);
}

html[data-density] .fi-wi-stats-overview-stat {
    padding: var(--density-stat-p);
}

/*
 * A stat with a chart draws it absolutely along its bottom edge, 1.5rem tall
 * (h-6), inside Filament's p-6. With less bottom padding than that the chart
 * rode up into the description: half its height at Compact, a quarter at
 * Comfortable. So the bottom keeps the chart's height and the other three
 * sides follow the level. At Default this is Filament's own 1.5rem.
 */
html[data-density] .fi-wi-stats-overview-stat:has(.fi-wi-stats-overview-stat-chart) {
    padding-bottom: max(var(--density-stat-p), 1.5rem);
}

/* -------- Tables -------- */

/*
 * Column wrappers are listed BY NAME rather than matched with `.fi-ta-cell > *`.
 * These are the elements Filament actually gives `px-3 py-4` (an inline column,
 * .fi-inline, has none); a blanket child selector would also hit wrappers that
 * carry no padding at all, and setting padding-block on those ADDS height —
 * making "compact" taller than default in exactly the tables with mixed
 * column types.
 *
 * A row is as tall as its tallest cell, and the bulk-select checkbox, the row
 * actions and the summary heading are padded by their cells, outside the
 * fi-ta-* column family. One un-shrunk py-4 cell pins EVERY row at default
 * height, and nearly every resource table here has an actions column, so
 * those three are re-stated too. Filament pads them only from `sm`; below it
 * the table is a stack of cards, laid out differently, and left alone.
 *
 * Horizontal cell padding is deliberately untouched. Filament lines the outer
 * columns up with their headers by construction, and re-stating
 * padding-inline here would knock the columns out of alignment.
 */
html[data-density] :is(
    .fi-ta-text,
    .fi-ta-icon,
    .fi-ta-image,
    .fi-ta-color,
    .fi-ta-select,
    .fi-ta-toggle,
    .fi-ta-checkbox,
    .fi-ta-text-input
):not(.fi-inline) {
    padding-block: var(--density-cell-py);
}

@media (min-width: 640px) {
    html[data-density] tbody > tr > :is(
        .fi-ta-selection-cell,
        .fi-ta-cell:has(.fi-ta-actions),
        .fi-ta-cell.fi-ta-summary-row-heading-cell
    ) {
        padding-block: var(--density-cell-py);
    }
}

html[data-density] .fi-ta-header-cell {
    padding-block: var(--density-header-py);
}

/*
 * The header row has the same trap as the body rows: its select-all checkbox
 * cell is padded py-4 by Filament (cell.css), outside .fi-ta-header-cell, so
 * on every table with bulk actions it held the header at 52px at every level
 * while tables without a checkbox shrank (Clients vs Approve Clients,
 * 2026-11-09). --density-cell-py, not --density-header-py: it is 1rem at
 * Default, which is Filament's own py-4, so Default stays a no-op, and at the
 * tighter levels it equals the header token, so the checkbox cell lines up
 * with the labels beside it. Below `sm` Filament hides this cell.
 */
@media (min-width: 640px) {
    html[data-density] thead > tr > .fi-ta-selection-cell {
        padding-block: var(--density-cell-py);
    }
}

/* A table's heading bar sits at panel-header rhythm (py-4); the search/filter
   toolbar and the pagination bar sit a step tighter (py-3). Two tokens, so
   "Default" reproduces both exactly. */
html[data-density] .fi-ta-ctn :is(.fi-ta-header, .fi-ta-filters-above-content-ctn) {
    padding-block: var(--density-bar-py);
}

html[data-density] .fi-ta-ctn :is(.fi-ta-header-toolbar, .fi-pagination) {
    padding-block: var(--density-toolbar-py);
}

/*
 * Compact takes the buttons in a table's header bar (Export and the like) one
 * size down, to Filament's own sm: gap-1 px-2.5 py-1.5 and a 16px icon (the
 * loading spinner that stands in for it is an .fi-icon too), 32px tall
 * instead of 36. Only md, the size an action has unless it asks for another.
 *
 * Filament lets these buttons overhang the bar's padding through a ladder of
 * negative margins on their row (tables container.css, from sm). The row is
 * given the sm rung, so the bar keeps its 40px and the button gets 4px of air
 * above and below instead of 2px. Not when a larger button shares the row:
 * there the ladder's larger rung has to win.
 */
html[data-density="compact"] .fi-ta-header .fi-ta-actions .fi-btn.fi-size-md:not(.fi-dropdown-panel *) {
    gap: 0.25rem;
    padding: 0.375rem 0.625rem;
}

html[data-density="compact"] .fi-ta-header .fi-ta-actions .fi-btn.fi-size-md:not(.fi-dropdown-panel *) > .fi-icon {
    width: 1rem;
    height: 1rem;
}

@media (min-width: 640px) {
    html[data-density="compact"] .fi-ta-header .fi-ta-actions:has(.fi-btn.fi-size-md:not(.fi-dropdown-panel *)):not(:has(.fi-btn:is(.fi-size-lg, .fi-size-xl):not(.fi-dropdown-panel *))) {
        margin-block: -0.25rem;
    }
}

html[data-density] .fi-ta-empty-state {
    padding-block: var(--density-empty-py);
}

/*
 * An open dropdown sits above the table's top bar. asmit/resized-column lifts
 * that bar (.fi-ta-header-ctn) to z-index 21, one above Filament's dropdown
 * panel (20), so a menu opened over it (the section tabs' "More", a header
 * action group, a non-native select above a table) lost its items to the bar:
 * the bar has no background, so the menu still looked on top, but the bar's
 * bottom border ran across it and the bar took the clicks. 22 stays under the
 * topbar and sidebar (30) and Filament's modals (40). Dropdowns inside the bar
 * resolve within its own stacking context and are not affected. The column
 * search panel sets its own z-index (30) inline.
 */
.fi-dropdown-panel {
    z-index: 22;
}

/* -------- Modals -------- */

/*
 * Only the paddings Filament sets UNCONDITIONALLY are re-stated, plus the two
 * it sets in known cases. The footer's top margin (a modal with no content)
 * is left alone: overriding it would add space where Filament deliberately
 * left none. The sticky footer is excluded outright: it uses py-5, not pb-6,
 * and re-stating one side alone would leave it lopsided.
 */
html[data-density] .fi-modal-content {
    padding-block: var(--density-modal-py);
    row-gap: var(--density-modal-gap);
}

html[data-density] .fi-modal-header {
    padding-top: var(--density-modal-py);
}

/* The header's pb-6: only when it is the modal's last block (no content, no
   footer). Matching it keeps the two sides equal there. */
html[data-density] .fi-modal:not(.fi-modal-has-sticky-footer) .fi-modal-window:not(.fi-modal-window-has-content):not(.fi-modal-window-has-footer) .fi-modal-header {
    padding-bottom: var(--density-modal-py);
}

html[data-density] .fi-modal:not(.fi-modal-has-sticky-footer) .fi-modal-footer {
    padding-bottom: var(--density-modal-py);
}

/* -------- Navigation -------- */
html[data-density] :is(.fi-sidebar-item-btn, .fi-sidebar-tree-button) {
    padding-block: var(--density-sidebar-py);
}

/* -------- Density switcher in the user menu -------- */

/*
 * Filament renders the USER_MENU_PROFILE_AFTER hook INSIDE the profile item's
 * .fi-dropdown-list (p-1, grid gap-px), so the switcher is a group drawn from
 * within someone else's list. Two things follow:
 *
 * - The rule above it is Filament's own group divider (the panel's divide-y,
 *   gray-100 / white-5) redrawn from inside: the negative inline margin cancels
 *   the list's p-1 so the line runs edge to edge like the dividers below it,
 *   with the same 4px of air either side (1px grid gap + 3px margin above, 4px
 *   padding below). A plain border here stopped 4px short at each end.
 * - The padding puts the rows back on the list's own inset, so they are as wide
 *   as the menu's other items and their labels start in the column where those
 *   items' icons do — stock Filament for an item without an icon.
 */
.fi-density-switcher {
    display: grid;
    gap: 1px;
    margin: 3px -0.25rem 0;
    padding: 0.25rem 0.25rem 0;
    border-top: 1px solid var(--gray-100);
}

.dark .fi-density-switcher {
    border-top-color: rgb(255 255 255 / 0.05);
}

/* .fi-dropdown-list-item's geometry and colours (gap-2, rounded-md, p-2 across,
   gray-700 / gray-200 text, gray-50 / white-5 hover), so a level reads as one
   more item of the menu. 6px down rather than p-2's 8px: the 24px preview then
   keeps the row at the 36px of the items around it. */
.fi-density-option {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.375rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    text-align: start;
    color: var(--gray-700);
    transition: background-color 75ms;
}

.dark .fi-density-option {
    color: var(--gray-200);
}

.fi-density-option:hover {
    background-color: var(--gray-50);
}

.dark .fi-density-option:hover {
    background-color: rgb(255 255 255 / 0.05);
}

.fi-density-option[aria-checked="true"] {
    background-color: var(--primary-50);
    color: var(--primary-600);
    font-weight: 500;
}

.dark .fi-density-option[aria-checked="true"] {
    background-color: rgb(255 255 255 / 0.05);
    color: var(--primary-400);
}

/* Thumbnail: more bars in the same box as the level tightens. Decorative —
   aria-hidden — because the option's own text is the accessible name. */
.fi-density-preview {
    display: flex;
    height: 1.5rem;
    width: 2.25rem;
    flex-shrink: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    border-radius: 0.25rem;
    border: 1px solid rgb(228 228 231); /* gray-200 */
    padding: 0 0.25rem;
}

.dark .fi-density-preview {
    border-color: rgb(255 255 255 / 0.1);
}

.fi-density-preview > span {
    display: block;
    height: 2px;
    border-radius: 9999px;
    background-color: rgb(212 212 216); /* gray-300 */
}

/* Without this the bars kept their light-mode gray-300 on the dark menu: almost
   as bright as the labels, so the two levels NOT chosen outshone the chosen
   one. white/20 sits one step above the frame's white/10, as gray-300 does
   above gray-200 in light mode. */
.dark .fi-density-preview > span {
    background-color: rgb(255 255 255 / 0.2);
}

.fi-density-preview > span:first-child {
    width: 50%;
}

.fi-density-option[aria-checked="true"] .fi-density-preview {
    border-color: var(--primary-500);
}

.fi-density-option[aria-checked="true"] .fi-density-preview > span {
    background-color: var(--primary-500);
}

/* ==========================================================================
   Alert banners

   Each banner is drawn by its TEMPLATE inside a sandboxed frame
   (resources/views/filament/alert-banners/frame.blade.php), so its look is the
   template's own CSS, not this file's. The frame keeps that CSS off the panel
   and this file's CSS off the banner.

   What lives here is the close button: the panel draws it over the frame's
   corner, because nothing inside the frame may run code. Templates leave room
   for it with var(--banner-close-space). It has its own hover tint so it reads
   on whatever colour a template paints behind it.
   -------------------------------------------------------------------------- */

.fi-alert-banner-dismiss {
    display: inline-flex;
    padding: 0.25rem;
    border-radius: 0.375rem;
    color: var(--gray-500);
    opacity: 0.8;
    transition: opacity 75ms ease, background-color 75ms ease;
}

.fi-alert-banner-dismiss:hover {
    opacity: 1;
    background-color: color-mix(in oklab, var(--gray-950) 6%, transparent);
}

.dark .fi-alert-banner-dismiss {
    color: var(--gray-400);
}

.dark .fi-alert-banner-dismiss:hover {
    background-color: color-mix(in oklab, white 10%, transparent);
}

.fi-alert-banner-dismiss:disabled {
    opacity: 0.4;
    cursor: default;
}

.fi-alert-banner-dismiss svg {
    width: 1rem;
    height: 1rem;
}

/* -------- Institutional file page header --------
   Up to four actions sit beside a long institution name. Filament 4's header
   wraps them under the name when the row is short of room; these rules let
   the name take the free width first instead of shrinking to its own. */
.fi-resource-institutional-applications .fi-header {
    flex-wrap: wrap;
}

.fi-resource-institutional-applications .fi-header > div:first-child {
    min-width: 0;
}

/* Only where the header is a row. Below `sm` it is a column, where a basis
   is a height: 24rem of empty space under the name on a phone. */
@media (min-width: 640px) {
    .fi-resource-institutional-applications .fi-header > div:first-child {
        flex: 1 1 24rem;
    }
}

/* -------- Institutional file page: question and answer --------
   Filament prints an entry's label in the same colour and size as its value,
   so a page of answers reads as one block of text. On this page the label
   (the question) is muted and the value (the answer) keeps full contrast. */
.fi-resource-institutional-applications .fi-in-entry-label {
    color: var(--gray-500);
    font-weight: 400;
}

.dark .fi-resource-institutional-applications .fi-in-entry-label {
    color: var(--gray-400);
}

/* -------- Client page (View) --------
   ClientOverview + ViewClients: flat sections under a hairline instead of
   boxed cards, a side column of label/value rows, and the heading's
   initials and status. Everything is scoped to the client's view page and
   the trading account page laid out like it (ViewTradingAccount adds
   .crm-trading-account-page); the edit form and other record pages are
   untouched. Labels are muted so a
   label and its value read apart (Filament prints both alike). */
:is(.fi-resource-clients:is(.fi-resource-view-record-page, .crm-client-analysis), .crm-trading-account-page) .fi-in-entry-label {
    color: var(--gray-500);
    font-weight: 400;
}

.dark :is(.fi-resource-clients:is(.fi-resource-view-record-page, .crm-client-analysis), .crm-trading-account-page) .fi-in-entry-label {
    color: var(--gray-400);
}

/* -------- Partner screens (every resource under /admin/partners and /admin/partner-*) --------
   The same muted labels on a campaign, partner, payout, flag or commission
   line, and in their view modals, so a label and its value read apart. */
:is(.fi-resource-partners, [class*="fi-resource-partner-"]) .fi-in-entry-label {
    color: var(--gray-500);
    font-weight: 400;
}

.dark :is(.fi-resource-partners, [class*="fi-resource-partner-"]) .fi-in-entry-label {
    color: var(--gray-400);
}

/* Partner page: the figures read like the client page's (.crm-client-balance-amount). */
.crm-partner-figures .fi-in-entry-label {
    font-size: 0.8125rem;
}

.crm-partner-figures .crm-client-balance-amount {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

/* Why the wallet is frozen, beside the amount rather than on a line of its own. */
.crm-partner-figure-note {
    margin-inline-start: 0.75rem;
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.dark .crm-partner-figure-note {
    color: var(--gray-400);
}

/* The label sits right over its figure, both centred. */
.crm-partner-figures .fi-in-entry {
    row-gap: 0.125rem;
    justify-items: center;
    text-align: center;
}

.crm-partner-figures .fi-in-entry-label-ctn {
    justify-content: center;
}

/* From sm up the figures take their own width, side by side with a hairline
   between them, instead of a third of the row each. :root lifts the gap over
   the density rule (html[data-density] :is(...)). */
@media (min-width: 640px) {
    :root .crm-partner-figures .fi-section-content.fi-grid.fi-sc {
        grid-template-columns: repeat(3, max-content);
        justify-content: center;
        column-gap: 0;
    }

    .crm-partner-figures .fi-grid-col + .fi-grid-col {
        margin-inline-start: 2rem;
        padding-inline-start: 2rem;
        border-inline-start: 1px solid var(--gray-200);
    }

    .dark .crm-partner-figures .fi-grid-col + .fi-grid-col {
        border-inline-start-color: color-mix(in oklab, white 10%, transparent);
    }
}

/* Partner page: the timeline, a dot per event on a thin line. Hidden events
   leave an empty .fi-hidden column, so only shown ones get a dot, and the line
   runs from each dot to the next shown one. The gap is fixed (over the density
   rule, hence :root) so the line can reach the next dot exactly. */
:root .crm-partner-timeline .fi-section-content.fi-sc.fi-sc-has-gap {
    row-gap: 1rem;
}

.crm-partner-timeline .fi-grid-col:not(.fi-hidden) {
    position: relative;
    padding-inline-start: 1.25rem;
}

.crm-partner-timeline .fi-grid-col:not(.fi-hidden)::before {
    content: '';
    position: absolute;
    inset-inline-start: 0.125rem;
    top: 0.375rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: var(--gray-400);
}

.crm-partner-timeline .fi-grid-col:not(.fi-hidden):has(~ .fi-grid-col:not(.fi-hidden))::after {
    content: '';
    position: absolute;
    inset-inline-start: calc(0.375rem - 0.5px);
    top: 1rem;
    bottom: -1.375rem;
    width: 1px;
    background: var(--gray-300);
}

.dark .crm-partner-timeline .fi-grid-col:not(.fi-hidden)::before {
    background: var(--gray-500);
}

.dark .crm-partner-timeline .fi-grid-col:not(.fi-hidden):has(~ .fi-grid-col:not(.fi-hidden))::after {
    background: color-mix(in oklab, white 20%, transparent);
}

/* Heading: photo or initials, name, status. */
.crm-client-heading {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.crm-client-initials {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 9999px;
    background: var(--gray-50);
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.dark .crm-client-initials {
    border-color: color-mix(in oklab, white 10%, transparent);
    background: color-mix(in oklab, white 5%, transparent);
    color: var(--gray-200);
}

.crm-client-heading .crm-client-heading-status {
    align-self: center;
}

/* Flat sections: a small, spaced-out heading over a 1px hairline. */
:is(.fi-resource-clients, .crm-trading-account-page) .fi-section-not-contained > .fi-section-header {
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--gray-200);
}

.dark :is(.fi-resource-clients, .crm-trading-account-page) .fi-section-not-contained > .fi-section-header {
    border-bottom-color: color-mix(in oklab, white 10%, transparent);
}

:is(.fi-resource-clients, .crm-trading-account-page) .fi-section-not-contained > .fi-section-header .fi-section-header-heading {
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dark :is(.fi-resource-clients, .crm-trading-account-page) .fi-section-not-contained > .fi-section-header .fi-section-header-heading {
    color: var(--gray-400);
}

/* Side column: a hairline beside the main column once they sit side by side. */
@media (min-width: 1280px) {
    :is(.fi-resource-clients, .crm-trading-account-page) .crm-client-side {
        padding-inline-start: 1.5rem;
        border-inline-start: 1px solid var(--gray-200);
    }

    .dark :is(.fi-resource-clients, .crm-trading-account-page) .crm-client-side {
        border-inline-start-color: color-mix(in oklab, white 10%, transparent);
    }
}

/* Side lists: one row per value, label left, value right, hairline between.
   :root lifts the gap rule over the density one (html[data-density] :is(...)). */
:root :is(.fi-resource-clients, .crm-trading-account-page) .crm-client-list .fi-section-content.fi-sc.fi-sc-has-gap {
    row-gap: 0;
}

:is(.fi-resource-clients, .crm-trading-account-page) .crm-client-list .fi-in-entry {
    padding-block: 0.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.dark :is(.fi-resource-clients, .crm-trading-account-page) .crm-client-list .fi-in-entry {
    border-bottom-color: color-mix(in oklab, white 6%, transparent);
}

:is(.fi-resource-clients, .crm-trading-account-page) .crm-client-list .fi-in-entry-content {
    font-weight: 500;
}

/* The label takes the width it needs ("Trading accounts" on one line), the
   value the rest, side by side at every width; Filament gives the label a
   fixed third and stacks the two on a phone. */
:is(.fi-resource-clients, .crm-trading-account-page) .crm-client-list .fi-in-entry.fi-in-entry-has-inline-label {
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 1rem;
}

:is(.fi-resource-clients, .crm-trading-account-page) .crm-client-list .fi-in-entry.fi-in-entry-has-inline-label .fi-in-entry-content-col {
    grid-column: auto;
}

/* Room between the flat sections of each column. */
:root :is(.fi-resource-clients, .crm-trading-account-page) :is(.crm-client-main, .crm-client-side) > .fi-sc.fi-sc-has-gap {
    row-gap: 2rem;
}

/* A value that opens a window (the manager): dotted underline. */
:is(.fi-resource-clients, .crm-trading-account-page) .crm-client-editable .fi-in-entry-content {
    cursor: pointer;
    text-decoration: underline dotted;
    text-decoration-color: var(--gray-400);
    text-underline-offset: 4px;
}

/* Total balance: a quiet card, the amount large, the currency small. */
:is(.fi-resource-clients, .crm-trading-account-page) .crm-client-balance .fi-section-header-heading {
    color: var(--gray-500);
    font-size: 0.8125rem;
    font-weight: 400;
}

.dark :is(.fi-resource-clients, .crm-trading-account-page) .crm-client-balance .fi-section-header-heading {
    color: var(--gray-400);
}

:is(.fi-resource-clients, .crm-trading-account-page) .crm-client-balance .fi-section-content-ctn {
    border-top: 0;
}

:is(.fi-resource-clients, .crm-trading-account-page) .crm-client-balance .fi-section-content {
    padding-top: 0;
}

.crm-client-balance-amount {
    font-family: var(--mono-font-family, ui-monospace, monospace);
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 2.25rem;
    letter-spacing: -0.01em;
}

.crm-client-balance-currency {
    margin-inline-start: 0.375rem;
    color: var(--gray-500);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Client page: the balance strip's figures read like the balance card. */
:is(.fi-resource-clients, .crm-trading-account-page) .crm-client-figures .fi-in-entry-label {
    font-size: 0.8125rem;
}

:is(.fi-resource-clients, .crm-trading-account-page) .crm-client-figures .crm-client-balance-amount {
    font-size: 1.375rem;
    line-height: 2rem;
}

/* Overview: the balance strip across the top (App\Livewire\ClientBalanceStrip),
   loaded after the page. Figures a little smaller than the balance card's
   so eight fit in two rows; a figure below zero is red. */
:is(.fi-resource-clients, .crm-trading-account-page) .crm-client-strip .crm-client-balance-amount {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

:is(.fi-resource-clients, .crm-trading-account-page) .crm-client-balance-amount.crm-client-negative {
    color: var(--danger-600);
}

.dark :is(.fi-resource-clients, .crm-trading-account-page) .crm-client-balance-amount.crm-client-negative {
    color: var(--danger-400);
}

:is(.fi-resource-clients, .crm-trading-account-page) .crm-client-strip-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3.5rem;
    color: var(--gray-500);
    font-size: 0.875rem;
}

:is(.fi-resource-clients, .crm-trading-account-page) .crm-client-strip-loading-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Trading account page: its strip (App\Livewire\TradingAccountStrip) holds
   eight figures in one row, so they are a little smaller than the client's. */
.crm-trading-account-page .crm-account-strip .crm-client-balance-amount {
    font-size: 1.0625rem;
    line-height: 1.5rem;
}

/* Communication tab: one email opened (resources/views/filament/clients/email-preview.blade.php). */
.crm-email-preview-meta {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.25rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.crm-email-preview-meta dt {
    color: var(--gray-500);
}

.crm-email-preview-meta dd {
    overflow-wrap: anywhere;
}

.crm-email-preview-frame {
    display: block;
    width: 100%;
    height: 70vh;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    background: white;
}

.dark .crm-email-preview-frame {
    border-color: color-mix(in oklab, white 10%, transparent);
}

.crm-email-preview-text {
    max-height: 70vh;
    overflow: auto;
    font-size: 0.8125rem;
    white-space: pre-wrap;
}

.crm-email-preview-empty {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* -------- Sidebar tree --------
   Domain > group > item, drawn by our sidebar component
   (resources/views/filament/navigation/sidebar.blade.php). Named classes
   rather than Tailwind utilities, so the sidebar does not depend on the theme
   build. Items are Filament's own (.fi-sidebar-item).

   The groups of an open domain hang from a guide line under the domain's
   icon: the row's 0.5rem padding plus half of the 1.25rem icon puts its
   centre 1.125rem in. The items of an open group do the same under the
   group's 1.5rem icon, whose centre is 1.25rem in. */
.fi-sidebar-tree {
    display: flex;
    flex-direction: column;
    row-gap: 0.25rem;
    margin-inline: -0.5rem;
}

.fi-sidebar-tree-list,
.fi-sidebar-tree-domain,
.fi-sidebar-tree-group {
    display: flex;
    flex-direction: column;
    row-gap: 0.25rem;
}

/* Collapsed to icons: Filament spaces its own group list 1.75rem apart. */
.fi-sidebar-nav-groups.fi-sidebar-tree-collapsed {
    row-gap: 0.25rem;
}

.fi-sidebar-tree-button {
    display: flex;
    width: 100%;
    align-items: center;
    column-gap: 0.75rem;
    border-radius: 0.5rem;
    padding: 0.5rem;
    outline: none;
    transition: background-color 75ms ease;
}

.fi-sidebar-tree-button:hover,
.fi-sidebar-tree-button:focus-visible {
    background-color: var(--gray-100);
}

.dark .fi-sidebar-tree-button:hover,
.dark .fi-sidebar-tree-button:focus-visible {
    background-color: rgb(255 255 255 / 0.05);
}

.fi-sidebar-tree-domain-button {
    padding-block: 0.625rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
}

.dark .fi-sidebar-tree-domain-button {
    color: var(--gray-200);
}

.fi-sidebar-tree-domain.fi-active > .fi-sidebar-tree-domain-button {
    color: var(--primary-600);
}

.dark .fi-sidebar-tree-domain.fi-active > .fi-sidebar-tree-domain-button {
    color: var(--primary-400);
}

.fi-sidebar-tree-label {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: start;
}

.fi-sidebar-tree-group-label {
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: var(--gray-700);
}

.dark .fi-sidebar-tree-group-label {
    color: var(--gray-200);
}

.fi-sidebar-tree-domain-icon,
.fi-sidebar-tree-group-icon,
.fi-sidebar-tree-chevron {
    flex-shrink: 0;
    color: var(--gray-400);
}

.dark :is(.fi-sidebar-tree-domain-icon, .fi-sidebar-tree-group-icon, .fi-sidebar-tree-chevron) {
    color: var(--gray-500);
}

.fi-sidebar-tree-domain.fi-active > .fi-sidebar-tree-domain-button > .fi-sidebar-tree-domain-icon {
    color: var(--primary-500);
}

.dark .fi-sidebar-tree-domain.fi-active > .fi-sidebar-tree-domain-button > .fi-sidebar-tree-domain-icon {
    color: var(--primary-400);
}

.fi-sidebar-tree-groups {
    margin-inline-start: 1.125rem;
    padding-inline-start: 0.5rem;
    border-inline-start: 1px solid var(--gray-200);
}

.dark .fi-sidebar-tree-groups {
    border-inline-start-color: rgb(255 255 255 / 0.1);
}

.fi-sidebar-tree-items {
    margin-inline-start: 1.25rem;
    padding-inline-start: 0.5rem;
    border-inline-start: 1px solid var(--gray-200);
}

.dark .fi-sidebar-tree-items {
    border-inline-start-color: rgb(255 255 255 / 0.1);
}

.fi-sidebar-tree-chevron {
    transition: transform 150ms ease;
}

/* A chevron points along the row when closed and down when open. */
.fi-sidebar-tree-chevron.fi-sidebar-tree-open {
    transform: rotate(90deg);
}

[dir="rtl"] .fi-sidebar-tree-chevron.fi-sidebar-tree-open {
    transform: rotate(-90deg);
}

/* The domain holding the current page, closed by the admin: tinted, so the
   page is still findable. Open, the page's own item carries the highlight. */
.fi-sidebar-tree-domain.fi-active > .fi-sidebar-tree-domain-button[aria-expanded="false"] {
    background-color: var(--primary-50);
}

.dark .fi-sidebar-tree-domain.fi-active > .fi-sidebar-tree-domain-button[aria-expanded="false"] {
    background-color: rgb(255 255 255 / 0.05);
}

/* Institutional file › Documents › Review: the answers beside the document
   sit closer than a record page's entries, so more of them fit beside it. */
.fi-document-review-answers .fi-section-content .fi-sc-has-gap {
    row-gap: 0.75rem;
}

/* Sidebar search (filament/sidebar-search.blade.php) stays at the top of the
   menu while it scrolls. The menu (.fi-sidebar-nav) scrolls with py-8 and
   px-6, and a sticky box is held inside that padding, so the box reaches
   back over it (top and margin -2rem, padding 2rem) to sit flush at the top
   and cover the full width the items scroll under. Its background is what
   shows behind the sidebar: its own white / gray-900 below lg, the page's
   gray-50 / gray-950 from lg, where the sidebar is transparent. */
.fi-sidebar-nav > .fi-sidebar-nav-search {
    position: sticky;
    top: -2rem;
    z-index: 10;
    margin: -2rem -1.5rem 0;
    padding: 2rem 1.5rem 1rem;
    background-color: #fff;
}

.dark .fi-sidebar-nav > .fi-sidebar-nav-search {
    background-color: var(--gray-900);
}

@media (min-width: 1024px) {
    .fi-sidebar-nav > .fi-sidebar-nav-search {
        background-color: var(--gray-50);
    }

    .dark .fi-sidebar-nav > .fi-sidebar-nav-search {
        background-color: var(--gray-950);
    }
}


/* ==========================================================================
   UTC clock and cookie banner

   Our own views since 2026-11-09, replacing two plugins:
   resources/views/filament/utc-clock.blade.php (gerenuk/filament-utc-dts) and
   resources/views/filament/cookie-consent.blade.php
   (marcogermani87/filament-cookie-consent). Named classes rather than Tailwind
   utilities (written before the panel had a theme build). They copy the look
   of the plugins they replaced.
   ========================================================================== */

/* The grey box before the search box: hidden below `sm`, as before.
   Tabular figures keep its width still while the seconds change. */
.crm-utc-clock {
    display: none;
    align-items: center;
    height: 2.25rem;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
    background-color: #fff;
    color: var(--gray-400);
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    box-shadow: 0 0 0 1px color-mix(in oklab, var(--gray-950) 10%, transparent), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.dark .crm-utc-clock {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--gray-500);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

@media (min-width: 640px) {
    .crm-utc-clock {
        display: flex;
    }
}

/* The strip fixed to the foot of the window: message, then the two buttons,
   centred. On a narrow screen the buttons drop under the message instead of
   squeezing it (the old banner wrapped "Allow cookies" over two lines). */
.crm-cookie-consent {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 50;
    padding: 1rem;
    background-color: #fff;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.dark .crm-cookie-consent {
    background-color: var(--gray-800);
    border-top-color: var(--gray-600);
}

.crm-cookie-consent__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    max-width: 80rem;
    margin: 0 auto;
}

.crm-cookie-consent__message {
    margin: 0;
}

.crm-cookie-consent__actions {
    display: flex;
    flex-shrink: 0;
    gap: 0.25rem;
}


/* ==========================================================================
   Star rating: the form field and the table column

   App\Filament\Forms\Components\Rating and App\Filament\Tables\Columns\RatingColumn
   (views in resources/views/filament/{forms/components/rating,tables/columns/
   rating-column}.blade.php), our own since 2026-11-09 in place of
   mokhosh/filament-rating. Each star is a grey star with a coloured copy on
   top, clipped to 0, 50 or 100% of its width; the field lays two invisible
   buttons over each star (start half, end half) to choose a value.
   ========================================================================== */
.crm-rating {
    --crm-rating-size: 1.5rem;
    --crm-rating-color: var(--primary-500);
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    vertical-align: middle;
}

.crm-rating--xs { --crm-rating-size: 0.75rem; }
.crm-rating--sm { --crm-rating-size: 1rem; }
.crm-rating--md { --crm-rating-size: 1.5rem; }
.crm-rating--lg { --crm-rating-size: 2rem; }
.crm-rating--xl { --crm-rating-size: 2.5rem; }

.crm-rating--primary { --crm-rating-color: var(--primary-500); }
.crm-rating--success { --crm-rating-color: var(--success-500); }
.crm-rating--warning { --crm-rating-color: var(--warning-500); }
.crm-rating--danger { --crm-rating-color: var(--danger-500); }
.crm-rating--info { --crm-rating-color: var(--info-500); }
.crm-rating--gray { --crm-rating-color: var(--gray-500); }

.crm-rating__star {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: var(--crm-rating-size);
    height: var(--crm-rating-size);
}

.crm-rating__icon {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--crm-rating-size);
    height: var(--crm-rating-size);
    max-width: none;
}

.crm-rating__icon--empty {
    color: var(--gray-300);
}

.dark .crm-rating__icon--empty {
    color: var(--gray-600);
}

.crm-rating__fill {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    overflow: hidden;
    color: var(--crm-rating-color);
    pointer-events: none;
}

.crm-rating__hit {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.crm-rating__hit--start,
.crm-rating__hit--end {
    width: 50%;
}

.crm-rating__hit--end {
    inset-inline-start: auto;
    inset-inline-end: 0;
}

.crm-rating__hit:focus-visible {
    outline: 2px solid var(--crm-rating-color);
    outline-offset: 1px;
    border-radius: 2px;
}

.crm-rating--disabled .crm-rating__hit,
.crm-rating--disabled .crm-rating__zero {
    cursor: default;
}

.crm-rating__zero {
    display: inline-flex;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--gray-300);
    cursor: pointer;
}

.crm-rating__zero--on {
    color: var(--danger-500);
}

.crm-rating__zero-icon {
    width: var(--crm-rating-size);
    height: var(--crm-rating-size);
}

/* The column cell pads like Filament's own text column (px-3 py-4), with the
   vertical padding following the admin's density setting (see UI density
   above), so a row is no taller than its neighbours. */
.crm-rating-column {
    display: flex;
    padding-inline: 0.75rem;
    padding-block: var(--density-cell-py, 1rem);
}


/* ==========================================================================
   Tables searched column by column

   App\Filament\Support\ColumnSearch marks such a table `crm-column-search`.
   It has no search box over the table: a small search button beside each
   column's name opens that column's search
   (resources/views/filament/tables/column-search-header-cell.blade.php), so
   Filament's own row of boxes under the headers is hidden.

   What is left of Filament's toolbar row (the filter and column buttons, and
   bulk actions once rows are ticked) sits at the end of the table's top row,
   beside its heading and header actions, instead of on a row of its own. Both
   keep their own padding and bottom border; side by side and stretched to one
   height, the two borders read as one line.
   ========================================================================== */
.crm-column-search .fi-ta-header-ctn:has(> .fi-ta-header) {
    display: flex;
    flex-wrap: wrap;
}

.crm-column-search .fi-ta-header-ctn > .fi-ta-header {
    flex: 1 1 auto;
    justify-content: center;
}

.crm-column-search .fi-ta-header-ctn > .fi-ta-header ~ .fi-ta-header-toolbar {
    flex: 0 1 auto;
    padding-inline-start: 0;
}

.crm-column-search .fi-ta-individual-search-row {
    display: none;
}

/* The column's name (and sort button) with the search button after it. */
.crm-col-head {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.crm-col-search-trigger {
    display: inline-flex;
    padding: 0.125rem;
    border-radius: 0.25rem;
    color: var(--gray-400);
}

.crm-col-search-trigger:hover,
.crm-col-search-trigger:focus-visible {
    color: var(--gray-700);
    background-color: var(--gray-100);
}

.dark .crm-col-search-trigger {
    color: var(--gray-500);
}

.dark .crm-col-search-trigger:hover,
.dark .crm-col-search-trigger:focus-visible {
    color: var(--gray-200);
    background-color: color-mix(in oklab, var(--gray-50) 10%, transparent);
}

/* A search is set on the column. */
.crm-col-search-trigger.crm-col-search-trigger-active {
    color: var(--primary-600);
}

.dark .crm-col-search-trigger.crm-col-search-trigger-active {
    color: var(--primary-400);
}

.crm-col-search-icon {
    width: 0.875rem;
    height: 0.875rem;
}

/* The panel: Filament's dropdown panel, moved to the end of the page and
   placed by its button (the script sets position, top, left, width and
   max-height). */
.crm-col-search-popover {
    overflow-y: auto;
}

.crm-col-search-find {
    padding: 0.5rem;
}

.crm-col-search-choices {
    max-height: 16rem;
    overflow-y: auto;
}

/* How to search on the left; the value, or the calendar, on the right. */
.crm-col-search-body {
    display: flex;
}

.crm-col-search-operators {
    flex: 0 0 11rem;
    border-inline-end: 1px solid var(--gray-100);
}

.dark .crm-col-search-operators {
    border-color: color-mix(in oklab, #fff 5%, transparent);
}

.crm-col-search-value {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.75rem;
}

.crm-col-search-values {
    display: grid;
    gap: 0.5rem;
}

@media (max-width: 639px) {
    .crm-col-search-body {
        flex-direction: column;
    }

    .crm-col-search-operators {
        flex-basis: auto;
        border-inline-end: 0;
        border-bottom: 1px solid var(--gray-100);
    }

    .dark .crm-col-search-operators {
        border-color: color-mix(in oklab, #fff 5%, transparent);
    }
}

/* A list item: its label, and a check on the one chosen. */
.crm-col-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

.crm-col-search-check {
    width: 1rem;
    height: 1rem;
    color: var(--primary-600);
}

.dark .crm-col-search-check {
    color: var(--primary-400);
}

.fi-dropdown-list-item.crm-col-search-current {
    background-color: var(--gray-50);
}

.dark .fi-dropdown-list-item.crm-col-search-current {
    background-color: color-mix(in oklab, #fff 5%, transparent);
}

.fi-dropdown-list-item.crm-col-search-current .fi-dropdown-list-item-label {
    font-weight: 600;
}

.crm-col-search-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem;
}

/* The calendar of a date column's search: a month, Monday first. */
.crm-cal {
    display: grid;
    gap: 0.5rem;
}

.crm-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.crm-cal-month {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-950);
}

.dark .crm-cal-month {
    color: #fff;
}

.crm-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.125rem;
    text-align: center;
}

.crm-cal-weekday {
    padding-block: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-500);
}

.crm-cal-day {
    height: 2rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.crm-cal-day:hover {
    background-color: var(--gray-100);
}

.dark .crm-cal-day {
    color: var(--gray-200);
}

.dark .crm-cal-day:hover {
    background-color: color-mix(in oklab, #fff 5%, transparent);
}

.crm-cal-day.crm-cal-out {
    color: var(--gray-400);
}

.dark .crm-cal-day.crm-cal-out {
    color: var(--gray-500);
}

.crm-cal-day.crm-cal-today {
    font-weight: 700;
    color: var(--primary-600);
}

.dark .crm-cal-day.crm-cal-today {
    color: var(--primary-400);
}

.crm-cal-day.crm-cal-range {
    background-color: color-mix(in oklab, var(--primary-500) 12%, transparent);
}

.crm-cal-day.crm-cal-edge,
.dark .crm-cal-day.crm-cal-edge {
    background-color: var(--primary-600);
    color: #fff;
}

.crm-cal-choice {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.dark .crm-cal-choice {
    color: var(--gray-400);
}

/*
 * Badges that hold a sentence (the checkpoints of "Why was this paid?"):
 * Filament keeps a badge on one line and cuts off what does not fit, which
 * hid a line's second flag. Here the words wrap inside the panel.
 */
.crm-wrap-badges .fi-badge {
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: start;
    justify-content: flex-start;
}
