/*
 * Our additions to the panel's stylesheet. Registered through FilamentAsset
 * in AppServiceProvider and published to public/css/app/panel.css by
 * `php artisan filament:assets`, which is committed, as the flatpickr
 * assets are.
 *
 * Everything here is scoped to a Filament class and overrides one of its
 * own utilities, so the compiled stylesheet (which has only the classes
 * Filament itself uses — see CLAUDE.md on h-*) is not a constraint.
 */

/*
 * The tabs over a record's relation managers — a list's Numbers and
 * Uploads, a lead's History and Suppressions.
 *
 * Filament draws them as a centred pill floating above the panel with a
 * gap beneath, which reads as a detached control. These are the tabs of
 * the panel under them, so they sit on its top edge, start at the left
 * edge of the content in line with the cards above, and the active one is
 * underlined, as tabs in a page header are. Icons and count badges are
 * Filament's own and untouched.
 *
 * Every selector starts at .fi-body: this file is loaded before the
 * panel's own stylesheet, so a rule of equal specificity would lose to
 * the utility it is meant to override.
 */
.fi-body .fi-resource-relation-managers {
    row-gap: 0;
}

.fi-body .fi-resource-relation-managers > .fi-tabs {
    margin-inline: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border-bottom: 1px solid rgb(var(--gray-200));
}

.dark .fi-body .fi-resource-relation-managers > .fi-tabs {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.fi-body .fi-resource-relation-managers > .fi-tabs > .fi-tabs-item {
    margin-bottom: -1px;
    border-radius: 0.5rem 0.5rem 0 0;
    border-bottom: 2px solid transparent;
}

.fi-body .fi-resource-relation-managers > .fi-tabs > .fi-tabs-item.fi-active {
    background: transparent;
    border-bottom-color: rgb(var(--primary-600));
}

.dark .fi-body .fi-resource-relation-managers > .fi-tabs > .fi-tabs-item.fi-active {
    border-bottom-color: rgb(var(--primary-400));
}

/* The panel's top corners meet the tab bar's line; square them off. */
.fi-body .fi-resource-relation-managers > .fi-tabs + div .fi-ta-ctn {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/*
 * The note under the Upload history title. Filament caps a subheading at
 * max-w-2xl, which breaks this sentence in two; it is one line at 1280px
 * when it may use the width the title has.
 */
.fi-body .fi-resource-suppression-imports .fi-header-subheading {
    max-width: none;
}

/*
 * A stats card whose description is a single line that must not run past
 * the card: the Last upload card on a list's page, where the file name
 * is longer than the card at 1280px. The card's inner grid and the
 * description are allowed to shrink below their content, and the link
 * clips with an ellipsis; the full name is in its tooltip.
 */
.fi-body .lm-stat-truncate > .grid {
    grid-template-columns: minmax(0, 1fr);
}

.fi-body .lm-stat-truncate .fi-wi-stats-overview-stat-description {
    min-width: 0;
}

/* The date stays on one line, as it does on the other cards. */
.fi-body .lm-stat-truncate .fi-wi-stats-overview-stat-value {
    white-space: nowrap;
}

.fi-body .lm-stat-truncate .fi-wi-stats-overview-stat-description > a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
