/* ---------------------------------------------------------------------------
   MudBlazor overrides for the Reports experience.

   Loaded AFTER _content/MudBlazor/MudBlazor.min.css (see _Layout.cshtml) so
   these .reports-blazor-scoped rules WIN specificity ties against MudBlazor's
   own mud-* rules. Previously these lived at the end of site.css, which loads
   BEFORE MudBlazor — so MudBlazor won every tie and the overrides never took
   effect. Keeping them in their own sheet means only these scoped rules load
   after MudBlazor; the rest of site.css / Bootstrap still loads before it and
   does not bleed into MudBlazor components.
   --------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   Un-hide MudBlazor table rows (defense in depth).

   site.css carries a flash-of-unpaginated-content guard for the legacy jQuery
   tableManager.js tables:

       table.table > tbody > tr:nth-child(n+5) { display: none; }

   It pre-hides overflow rows so a large table doesn't render fully expanded
   before tableManager paginates it; tableManager's .show() then reveals the
   current page. That rule is now scoped to Bootstrap `.table`, so it no longer
   touches MudBlazor tables (MudDataGrid, MudTable, MudSimpleTable), which are
   NOT managed by tableManager and render <table class="mud-table-root">.

   This override is kept as a safety net: the reports UI is a MudBlazor island
   inside a heavy legacy site.css environment, so any future global `tbody > tr`
   rule that regressed the scoping would otherwise strand grid rows as
   display:none (the grid loads all rows and server-pages correctly, but only
   the first few would be visible). `table.mud-table-root tbody > tr` restores
   the body rows and cannot match any legacy (non-Mud) table. Header rows live
   in <thead> and are never affected. */
table.mud-table-root tbody > tr {
    display: table-row;
}

/* Panels transparent so the navy page gradient shows through. */
.reports-blazor .mud-paper {
    background-color: transparent !important;
    color: #FFFFFF;
}

.reports-blazor .reports-sidebar,
.reports-blazor .reports-filter-bar {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: .5rem;
}

/* Sidebar list hover / selected -> site green. */
.reports-blazor .mud-list-item:hover,
.reports-blazor .mud-list-item-clickable:hover {
    background-color: rgba(0, 178, 93, 0.12);
}

.reports-blazor .mud-selected-item {
    background-color: rgba(0, 178, 93, 0.18) !important;
    color: #FFFFFF !important;
}

/* Tables: white header / dark text, translucent striped body (legacy look). */
.reports-blazor .mud-table,
.reports-blazor .mud-simple-table {
    background-color: transparent !important;
}

.reports-blazor .mud-table-head,
.reports-blazor .mud-simple-table thead {
    background-color: #FFFFFF;
}

.reports-blazor .mud-table-head .mud-table-cell,
.reports-blazor .mud-simple-table thead th {
    background-color: #FFFFFF !important;
    color: #1a2b44 !important;
    font-weight: 600;
}

.reports-blazor .mud-table-row:nth-of-type(odd),
.reports-blazor .mud-simple-table tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.04);
}

.reports-blazor .mud-table-row:hover,
.reports-blazor .mud-simple-table tbody tr:hover {
    background-color: rgba(0, 178, 93, 0.14) !important;
}

.reports-blazor .mud-table-cell,
.reports-blazor .mud-simple-table td {
    color: #FFFFFF;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.reports-blazor .mud-table-pager,
.reports-blazor .mud-table-toolbar {
    background-color: transparent !important;
    color: #FFFFFF;
}

/* Primary buttons adopt the site green. */
.reports-blazor .mud-button-filled-primary {
    background-color: #00B25D !important;
    color: #FFFFFF !important;
}

.reports-blazor .mud-button-filled-primary:hover {
    background-color: #14ab57 !important;
}

/* Grid panel: lighter solid surface with padding. */
.reports-blazor .aaam-datagrid {
    background-color: #16355c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: .5rem;
    padding: 1rem 1.25rem;
    margin-top: .5rem;
}

.reports-blazor .aaam-datagrid .mud-table-toolbar {
    padding-left: 0;
    padding-right: 0;
    min-height: 48px;
    margin-bottom: .5rem;
}

.reports-blazor .aaam-datagrid .mud-table-root {
    background-color: transparent !important;
}

/* Grid pager controls visible on navy. */
.reports-blazor .aaam-datagrid .mud-table-pager-content,
.reports-blazor .aaam-datagrid .mud-table-pager .mud-icon-button,
.reports-blazor .aaam-datagrid .mud-table-pager .mud-select-input,
.reports-blazor .aaam-datagrid .mud-table-pager .mud-typography {
    color: #FFFFFF !important;
}

/* Keep Refresh and Export CSV the same height. */
.reports-blazor .aaam-datagrid .mud-table-toolbar .mud-button-root {
    min-height: 34px;
    line-height: 1;
}

/* ---------- Filter-bar inputs: white surface, dark text, legible labels ----------
   MudBlazor 9.3 outlined structure: .mud-input.mud-input-outlined wraps a
   .mud-input-slot; the floated label is .mud-input-label(.mud-input-label-outlined).
   Paint the interactive surface white and give the floated label its own dark
   chip so it stays readable above the white input on the navy chrome.
   (Consolidated from two earlier overlapping batches.) */
.reports-blazor .reports-filter-bar .mud-input.mud-input-outlined,
.reports-blazor .reports-filter-bar .mud-input.mud-input-outlined .mud-input-slot,
.reports-blazor .reports-filter-bar .mud-select .mud-select-input,
.reports-blazor .reports-filter-bar .mud-picker-input .mud-input-slot {
    background-color: #FFFFFF !important;
    border-radius: .25rem;
}

.reports-blazor .reports-filter-bar .mud-input-outlined input,
.reports-blazor .reports-filter-bar .mud-input-outlined .mud-select-input,
.reports-blazor .reports-filter-bar .mud-input-outlined .mud-input-root,
.reports-blazor .reports-filter-bar .mud-select .mud-select-input {
    color: #1a2b44 !important;
}

.reports-blazor .reports-filter-bar .mud-input-label,
.reports-blazor .reports-filter-bar .mud-input-label.mud-input-label-animated,
.reports-blazor .reports-filter-bar .mud-input-label.mud-input-label-outlined {
    color: #FFFFFF !important;
    background-color: #0a1d33;
    padding: 0 .35rem;
    border-radius: .2rem;
    z-index: 2;
}

/* When the label is shrunk (focused or populated) keep it above the white input. */
.reports-blazor .reports-filter-bar .mud-input-label.mud-input-label-outlined.mud-input-label-inputcontrol {
    transform: translate(14px, -9px) scale(.75);
}

/* Adornment icons (calendar / dropdown caret) dark against the white input. */
.reports-blazor .reports-filter-bar .mud-input-adornment .mud-icon-root,
.reports-blazor .reports-filter-bar .mud-input-adornment svg {
    color: #1a2b44 !important;
    fill: #1a2b44;
}

.reports-blazor .reports-filter-bar .mud-input-outlined-border {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Show-toggle checkbox labels stay white on the navy filter bar. */
.reports-blazor .reports-filter-bar .mud-checkbox .mud-typography {
    color: #FFFFFF;
}

/* ---------- Filter sections (Show App Type / Show Search Type) ----------
   Bordered fieldsets that group the Show toggles into labelled sections and
   sit side by side in a row (wrapping on narrow screens). Bootstrap Reboot
   strips fieldset/legend chrome, so re-establish it here scoped to the bar. */
.reports-blazor .reports-filter-groups {
    align-items: stretch;
}

.reports-blazor .reports-filter-group {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: .5rem;
    padding: .35rem .9rem .6rem;
    margin: 0;
    min-width: 260px;
    flex: 1 1 300px;
}

.reports-blazor .reports-filter-group > legend {
    float: none;              /* Bootstrap floats legends; keep it inline-block */
    width: auto;
    margin-bottom: .3rem;
    padding: 0 .4rem;
    font-size: 13px;
    font-weight: 600;
    color: #FFFFFF;
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* Nested App / OEM sub-groups inside "Show Search Type" — a lighter dashed
   box so the App-vs-OEM split reads clearly without competing with the
   parent fieldset border. */
.reports-blazor .reports-filter-subgroup {
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: .4rem;
    padding: .15rem .7rem .35rem;
    margin: 0;
    min-width: 0;
}

.reports-blazor .reports-filter-subgroup > legend {
    float: none;
    width: auto;
    margin-bottom: .1rem;
    padding: 0 .35rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

/* Quick-range buttons: light outline that reads on the navy bar. */
.reports-blazor .reports-quick-range .mud-button-outlined {
    border-color: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

.reports-blazor .reports-quick-range .mud-button-outlined:hover {
    border-color: #00B25D;
    background-color: rgba(0, 178, 93, 0.14);
}
