/* DATE-RANGE FILTER BAR — <DateRangeFilterBar /> in SPC.Blazor.Components.Shared.

   A library stylesheet rather than a .razor.css: scoped CSS from a referenced project
   never reaches the heads (same reason as print-station.css beside it). Every head
   that uses the component links this — without the link the range field falls back to
   a full-width block and the bar stacks into three rows.

   Colour comes from --mud-palette-* only, so the bar reads correctly under the back
   office chrome and the café's day/night roast alike, in any of the ten apps.

   The bar deliberately draws no surface of its own — no card, no border. It is placed
   INSIDE whatever panel the page already uses (.panel-card on the RES screens), so it
   inherits that page's card treatment instead of stacking a second one inside it.

   Shape: one row — a segmented preset control on the left, one date-range field on the
   right. Below ~640px each takes the full width on its own line. */

.filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

/* The presets are one segmented control: a single rounded track, the active segment
   filled with the primary colour. */
.filter-bar__presets {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: 999px;
    background: var(--mud-palette-surface);
}

.filter-bar__preset {
    appearance: none;
    border: 0;
    margin: 0;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease;
}

.filter-bar__preset:hover {
    background: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-text-primary);
}

.filter-bar__preset.is-active {
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

.filter-bar__preset:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* The range field sits at the right end of the row, sized to its content rather than
   stretched across the card. */
.filter-bar__dates {
    margin-left: auto;
    width: min(100%, 20rem);
}

.filter-bar__dates .filter-bar__range,
.filter-bar__dates .mud-input-control {
    margin-top: 0;
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .filter-bar__presets {
        width: 100%;
    }

    .filter-bar__preset {
        flex: 1 1 0;
        min-width: 0;
        font-size: 0.8125rem;
        padding-left: 0.4rem;
        padding-right: 0.4rem;
    }

    .filter-bar__dates {
        margin-left: 0;
        width: 100%;
    }
}
