/* ==========================================================================
   New UI: Roster pages (My Roster, Attendance, Billing, Registration Pipeline, Roster Admin lists): head tabs, one primary, kpis.
   Every selector under .nui-on. Reusable pieces belong in new-ui-kit.css.
   ========================================================================== */

/* ---- page shell ----------------------------------------------------------
   .nrs-page is .asr-page.dc-page (so --asr-* / --dc-* tokens resolve) filling the
   .main-container / ui-view slot instead of the viewport-bound Find Items height. */
.nui-on .nrs-page.asr-page,
.nui-on .main-container > .nrs-page.asr-page { height: 100%; min-height: 0; box-sizing: border-box; }
.nui-on graduation-candidates.h100 { display: block; }

/* the sibling pages are now head tabs: the Roster second sidebar column (and the
   classic horizontal second-level menu) are not needed while one of these pages is up */


/* ---- head: tabs (shared partial _engagement/nui-roster-tabs.html) + action ---- */
.nui-on .nrs-tabs-host { display: contents; }
.nui-on .nrs-tabs .nrs-tabs-set { display: contents; }
.nui-on .nrs-tabs button.asr-tab { font-family: var(--asr-font); line-height: 1; }
/* a single sibling (restricted users) is not a choice: drop the lone tab pill,
   and the whole head row when it then has no action either */
.nui-on .nrs-tabs:has(.nrs-tabs-set > .asr-tab:only-child) { display: none; }
.nui-on .nrs-top:not(:has(.asr-btn, .asr-tab:not(:only-child))) { display: none; }

/* flat grey disabled primary / secondary (kit: never faded to near-invisible) */
.nui-on .nrs-page .asr-btn[disabled] {
    opacity: 1;
    background: #EEF1F2;
    border-color: transparent;
    color: var(--asr-muted);
    pointer-events: none;
}

/* ---- layout: the filter aside keeps its classic classes (the roster filter rail
   sizing hangs off aside.page-sidebar + main.page-content-wSidebar) but sits in
   the asr-layout flex row. :where() keeps this below the rail's own collapse rules. */
.nui-on .nrs-page :where(.nrs-layout > aside) {
    float: none;
    flex: 0 0 auto;
    width: 260px;
    padding: 0;
    height: auto;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}
.nui-on .nrs-page :where(.nrs-layout > main) {
    float: none;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nui-on .nrs-page .nrs-results { flex: 1 1 auto; }
.nui-on .nrs-page .nrs-results .asr-results-head { min-height: 46px; box-sizing: border-box; }
.nui-on .nrs-page .nrs-results .asr-results-head .asr-total { margin-left: auto; }
.nui-on .nrs-page .nrs-scroll { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.nui-on .nrs-page .nrs-table-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }
.nui-on .nrs-page .nrs-table-scroll > table { margin-bottom: 0; }
.nui-on .nrs-page .nrs-table-scroll > table > tbody > tr > td { vertical-align: middle; }
.nui-on .nrs-page .nrs-empty { padding: 28px 20px; }
.nui-on .nrs-page .nrs-ai { flex: 0 0 auto; }

/* loading: classic bottom spinner as a small centred pill instead of a wide fade */
.nui-on .nrs-page .aa-loading.bottom-loading {
    left: 50%;
    right: auto;
    bottom: 14px;
    width: auto;
    padding: 6px 14px;
    background: var(--asr-white);
    border: 1px solid var(--asr-border);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(34, 40, 49, .10);
    transform: translateX(-50%);
}
.nui-on .nrs-page .aa-loading.bottom-loading > div { display: inline-flex; align-items: center; gap: 8px; }
.nui-on .nrs-page .aa-loading.bottom-loading > div::before { margin: 0 !important; }
.nui-on .nrs-page .aa-loading.bottom-loading .aa-loading-message { margin: 0; font-size: 12px !important; color: var(--asr-muted); }

/* ---- kpis (Attendance, Billing): dc-kpi tiles, compact ---- */
.nui-on .nrs-page .nrs-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 0; flex: 0 0 auto; }
.nui-on .nrs-page .nrs-kpis .dc-kpi { padding: 10px 14px 9px; }
.nui-on .nrs-page .nrs-kpis .dc-kpi-label { margin-bottom: 4px; }
.nui-on .nrs-page .nrs-kpis .dc-kpi-num { display: inline-block; font-size: 22px; margin-bottom: 0; }
.nui-on .nrs-page .nrs-kpis .dc-kpi-sub { display: inline-block; margin-left: 6px; }

/* ---- summary widgets that are shared with the dashboards (GC metrics, pipeline
   status tiles): classic solid-blue / grey aa-tile blocks restyled as quiet tiles
   here only. The widgets keep their markup, data and click-through. ---- */
.nui-on .nrs-page .nrs-kpi-wrap { flex: 0 0 auto; padding: 12px 14px 4px; border-bottom: 1px solid var(--asr-border); }
.nui-on .nrs-page .nrs-widget .box-stack { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 10px !important; padding: 0 !important; }
.nui-on .nrs-page .nrs-widget .box-stack > [class*="box-x"] { max-width: none; width: auto; flex: none; padding: 0 !important; }
/* the lone "Total in Pipeline" tile sits outside the .box-stack */
.nui-on .nrs-page .nrs-widget .aa-tile-metric[class*="box-x"] { display: block; width: auto; max-width: 200px; margin: 0 0 10px !important; padding: 0 !important; }
.nui-on .nrs-page .nrs-widget .aa-tile-metric {
    --aa-tile-fill-hover: var(--asr-blue-soft);
    background: var(--asr-white) !important;
    background-image: none !important;
    border: 1px solid var(--asr-border);
    border-radius: 12px;
    color: var(--asr-ink) !important;
    box-shadow: none;
}
.nui-on .nrs-page .nrs-widget .aa-tile-metric.is-aa-primary { background: var(--asr-blue-soft) !important; border-color: rgba(0, 116, 197, .25); }
.nui-on .nrs-page .nrs-widget .aa-tile-metric::after { content: none; }
.nui-on .nrs-page .nrs-widget .aa-tile-metric:hover { border-color: var(--asr-blue); }
.nui-on .nrs-page .nrs-widget .aa-tile-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 10px 14px 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--asr-ink) !important;
}
.nui-on .nrs-page .nrs-widget .aa-tile-value > span:nth-child(2) { font-size: 11px; font-weight: 600; color: var(--asr-muted); }
.nui-on .nrs-page .nrs-widget .aa-tile-label {
    padding: 4px 14px 11px;
    font-size: 10.5px !important;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--asr-muted) !important;
}

/* ---- cells ---- */
/* PLP Templates: districts / courses / categories are one clamped line (the classic
   newline filter put every comma on its own line, which made the rows very tall) */
.nui-on .nrs-page .nrs-clamp { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Zones: district values as quiet tags instead of solid-blue blocks */
.nui-on .nrs-page .nrs-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.nui-on .nrs-page .nrs-tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 11px;
    background: var(--asr-blue-soft);
    color: var(--asr-blue);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .nui-on .nrs-page :where(.nrs-layout > aside) { width: 230px; }
}

/* Head tabs on Roster pages that aren't .nrs-page list layouts (Goals grids,
   Forecast Weightings, Cobb reports): hide the old second column there too, and
   give the tabs the --asr-* tokens they need outside an .asr-page. */

.nui-on .nrs-tabs-row {
    --asr-blue: var(--aa-blue, #0074C5);
    --asr-blue-soft: rgba(0, 116, 197, .10);
    --asr-ink: var(--aa-ink, #222831);
    --asr-muted: var(--aa-grey-500, #7B8E92);
    --asr-text: var(--aa-grey-700, #4A5358);
    --asr-border: var(--aa-grey-300, #C5CDD0);
    --asr-bg: var(--aa-off-white, #F7F9FA);
    --asr-white: #fff;
    --asr-radius: 14px;
    --asr-radius-sm: 8px;
    --asr-font: "Montserrat", "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 18px 0;
    font-family: var(--asr-font);
}
.nui-on .nrs-subtabs { margin-left: 4px; }
.nui-on .nrs-subtabs .asr-tab { font-size: 12px; }

/* Roster pages with head tabs: the classic in-page second-level menu is replaced by the tabs */
.nui-on:has(.nrs-page, .nrs-tabs-row) .second-level-menu { display: none !important; }
