/* ═══════════════════════════════════════════════════════════════
   ECC FILTER BAR (canonical) — see EccFilterBar.razor
   One height token + one type scale. Flex/grid alignment only.
   No zoom, no translateY, no !important. Do not restyle per page.
   Type scale: see eccount-ui.tokens.css / docs/ai/UI_CONTRACT.md section 4.
   ═══════════════════════════════════════════════════════════════ */
/* Size tokens live in eccount-ui.tokens.css (load that file first). */

.ecc-filterbar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    min-width: 0;
    padding: 10px 12px 8px; /* top room for floating outlined labels */
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    flex: 0 0 auto;
    font-size: var(--ecc-fs-body);
}

.ecc-filterbar__fields {
    display: grid;
    grid-template-columns: var(--ecc-filterbar-cols, repeat(auto-fit, minmax(160px, 1fr)));
    align-items: end;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.ecc-filterbar__fields > * {
    min-width: 0;
    width: 100%;
    margin: 0;
}

.ecc-filterbar__actions {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    flex: 0 0 auto;
}

.ecc-filterbar__static {
    display: flex;
    align-items: center;
    height: var(--ecc-filter-h);
    color: var(--mud-palette-text-secondary);
    font-size: var(--ecc-fs-body);
    white-space: nowrap;
}

/* Wrapper owns the height so inner MudBlazor padding cannot grow the box. */
.ecc-filterbar.ecc-filterbar .mud-input.mud-input-outlined {
    height: var(--ecc-filter-h);
    min-height: var(--ecc-filter-h);
    box-sizing: border-box;
    align-items: center;
    font-size: var(--ecc-fs-body);
    line-height: 1.2;
}

.ecc-filterbar.ecc-filterbar .mud-input.mud-input-outlined .mud-input-slot {
    height: 100%;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
    font-size: inherit;
    line-height: inherit;
}

.ecc-filterbar.ecc-filterbar .mud-input.mud-input-outlined div.mud-input-slot {
    display: flex;
    align-items: center;
}

.ecc-filterbar.ecc-filterbar .mud-input-outlined .mud-input-outlined-border {
    border-radius: 8px;
}

.ecc-filterbar.ecc-filterbar .mud-input-control > .mud-input-label {
    font-size: var(--ecc-fs-title);
}

.ecc-filterbar.ecc-filterbar .mud-input-adornment .mud-icon-button {
    padding: 3px;
}

.ecc-filterbar.ecc-filterbar .mud-input-adornment .mud-icon-root {
    font-size: 1.1rem;
}

.ecc-filterbar.ecc-filterbar .ecc-filterbar__actions .mud-button-root {
    height: var(--ecc-filter-h);
    min-height: var(--ecc-filter-h);
    font-size: var(--ecc-fs-body);
    white-space: nowrap;
}

.ecc-filterbar.ecc-filterbar .ecc-filterbar__actions .mud-icon-button {
    width: var(--ecc-filter-h);
    height: var(--ecc-filter-h);
}

/* Same geometry for compact data-entry forms (.ecc-form) */
.ecc-form.ecc-form .mud-input.mud-input-outlined {
    height: var(--ecc-filter-h);
    min-height: var(--ecc-filter-h);
    box-sizing: border-box;
    align-items: center;
    font-size: var(--ecc-fs-body);
    line-height: 1.2;
}

.ecc-form.ecc-form .mud-input.mud-input-outlined .mud-input-slot {
    height: 100%;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
    font-size: inherit;
    line-height: inherit;
}

.ecc-form.ecc-form .mud-input.mud-input-outlined div.mud-input-slot {
    display: flex;
    align-items: center;
}

.ecc-form.ecc-form .mud-input-outlined .mud-input-outlined-border {
    border-radius: 8px;
}

.ecc-form.ecc-form .mud-input-control > .mud-input-label {
    font-size: var(--ecc-fs-title);
}

.ecc-form.ecc-form .mud-input-adornment .mud-icon-button {
    padding: 3px;
}

.ecc-form.ecc-form .mud-input-adornment .mud-icon-root {
    font-size: 1.1rem;
}

/* ROOT CAUSE (MudBlazor 8.15): Margin.Dense adds `margin:4px 0` to .mud-input-control,
   so every field sat 4px above the action buttons. Neutralise it here once. */
.ecc-filterbar.ecc-filterbar .mud-input-control,
.ecc-form.ecc-form .mud-input-control {
    margin: 0;
}

/* Select display value: let the flex wrapper (align-items:center) centre it; keep MudBlazor's
   horizontal padding, only clip long text. */
.ecc-filterbar.ecc-filterbar .mud-select .mud-input.mud-input-outlined div.mud-input-slot,
.ecc-form.ecc-form .mud-select .mud-input.mud-input-outlined div.mud-input-slot {
    height: auto;
    min-height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1.3;
    align-self: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* Resting (not floated) outlined label: MudBlazor assumes a 40px box (translateY 12px).
   Re-centre it for --ecc-filter-h. Floated state keeps MudBlazor's own transform. */
.ecc-filterbar.ecc-filterbar .mud-input:not(.mud-shrink):not(:focus-within) ~ label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined,
.ecc-form.ecc-form .mud-input:not(.mud-shrink):not(:focus-within) ~ label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined {
    transform: translate(14px, calc((var(--ecc-filter-h) - 1.15rem) / 2)) scale(1);
    font-size: var(--ecc-fs-body);
}

/* helper row would push fields above the button baseline in a filter bar */
.ecc-filterbar .mud-input-control-helper-container {
    display: none;
}

/* multi-line fields keep their natural height in .ecc-form */
.ecc-form.ecc-form .ecc-field--multiline .mud-input.mud-input-outlined {
    height: auto;
    min-height: calc(var(--ecc-filter-h) * 2);
    align-items: flex-start;
}

.ecc-form.ecc-form .ecc-field--multiline .mud-input.mud-input-outlined .mud-input-slot {
    height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
    line-height: 1.35;
}

@media (max-width: 1279px) {
    .ecc-filterbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ecc-filterbar__fields {
        grid-template-columns: var(--ecc-filterbar-cols-compact, repeat(auto-fit, minmax(180px, 1fr)));
    }

    .ecc-filterbar__actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .ecc-filterbar {
        padding: 10px 8px 6px;
    }

    .ecc-filterbar__fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .ecc-filterbar__actions .mud-button-root {
        flex: 1 1 0;
        justify-content: center;
    }
}


/* ECC PERIOD NAV: "<  [date] [date]  >" wrapper for EccFilterBar fields */
.ecc-periodnav {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    width: 100%;
}

.ecc-periodnav__fields {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.ecc-periodnav.ecc-periodnav .mud-icon-button {
    flex: 0 0 auto;
    width: 28px;
    height: var(--ecc-filter-h);
    padding: 0;
    border-radius: 6px;

