/* FASAMS-specific styles.
   Loaded after site.css and TemplateStyles.css, which carry the shared DCF
   design system. Only add a rule here when the shared stylesheets genuinely
   have no equivalent — prefer reusing an existing class over inventing one. */

/* App.razor's <FocusOnNavigate Selector=".app-main h1" /> puts tabindex="-1" on
   the page heading and focuses it after every navigation, so screen readers land
   on the new page title. Chromium still paints a focus ring for that programmatic
   focus, which reads as a stray black box around every page heading.
   :focus-visible does not reliably exclude it, so suppress the ring on the
   tabindex="-1" target specifically — that element is not tab-reachable, so no
   keyboard user loses a focus indicator.
   (wwwroot/app.css carries the same intent but is not linked from _Host.cshtml.) */
.app-main h1[tabindex]:focus,
.app-main h1:focus {
    outline: none;
}

/* ---------------------------------------------------------------------------
   Public landing page
   Uses RTT's .public-landing / .public-home-image pattern, which makes .app-main
   full-bleed with zero padding. Two FASAMS-specific adjustments below.
   --------------------------------------------------------------------------- */

/* Hero sizing.

   A fixed-ratio image cannot fill an arbitrary-ratio box without either cropping
   (object-fit: cover) or leaving bars (object-fit: contain). Rather than pick a
   loser, let the IMAGE decide the height of the region: the main column is given
   no height of its own, so the row collapses onto the artwork exactly.

   The image then spans the full width at every window size and scales by its own
   2.41:1 ratio, so there is no crop, no letterbox bar, and no gap on any edge --
   the side navigation and the footer sit flush against it.

   Do not reintroduce a viewport-based min-height here. That is what produced the
   bars above and below the artwork; site.css already sets min-height: 0 on
   .app-shell:has(.public-landing) for exactly this reason. */
.public-landing {
    display: block;
    width: 100%;
}

/* site.css pins .public-home-image to aspect-ratio 1.6632/1 for RTT's artwork.
   The FASAMS hero is 1672x733 (2.28:1), so that ratio would distort it. Release
   the override and let the intrinsic ratio govern the height -- which is also
   why swapping in artwork of a different shape needs no CSS change.

   That 2.28:1 is not arbitrary. The chrome above the hero is 80px (an 8px top
   strip plus a 72px header) and the footer is 70px, so for the hero to fill the
   gap and leave the footer showing, the artwork has to be about
   (viewportWidth - sideNav) / (viewportHeight - 115) wide-to-tall. That lands
   at 2.25:1 to 2.32:1 across 1440, 1536 and 1920 wide windows, so the supplied
   1672x940 artwork was cropped to 1672x733 -- all of it from the bottom, which
   was flat background below y=650. Re-crop rather than add a max-height here:
   a height cap would letterbox or crop at render time, which is the problem
   releasing the aspect ratio exists to avoid. */
.fasams-home-image {
    aspect-ratio: auto;
    display: block;
    height: auto;
    max-width: none;
    width: 100%;
}

/* Row action buttons inside a data-table. */
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
}

.table-actions .btn-link {
    padding: .15rem .4rem;
    text-decoration: none;
}

.table-actions .btn-link:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Administration / Submitting Entities
   --------------------------------------------------------------------------- */

/* Section heading inside the details modal. Matches the uppercase label idiom
   used by .entity-detail-grid dt and .project-card-meta dt, but weighted and
   ruled so it reads as a section break rather than one more field label. */
.contacts-heading {
    align-items: center;
    border-bottom: 2px solid #dce6f0;
    color: #102c49;
    display: flex;
    font-size: .9rem;
    font-weight: 900;
    gap: .55rem;
    letter-spacing: .08em;
    margin: 1.9rem 0 .35rem;
    padding-bottom: .6rem;
    text-transform: uppercase;
}

.contacts-heading-icon {
    align-items: center;
    background: #155f95;
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .82rem;
    height: 1.85rem;
    justify-content: center;
    width: 1.85rem;
}

.contacts-heading-count {
    background: #eef5ff;
    border: 1px solid #9dccff;
    border-radius: 999px;
    color: #155f95;
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: 0;
    padding: .1rem .5rem;
}

/* Contact tiles carry their own colour so they separate from the white modal
   body: a soft diagonal wash that lifts the top-left and fades out to white.
   The primary contact keeps a solid accent bar; the rest stay neutral. */
.rtts-modal-card .contact-card {
    background: linear-gradient(135deg, #d9e8f7 0%, #eef5fc 42%, #fff 100%);
    border: 1px solid #c8dced;
    border-left: 4px solid #cfdeeb;
}

.rtts-modal-card .contact-card.is-primary {
    border-left-color: #2e86d4;
}

.contact-card .project-card-meta dt {
    align-items: center;
    display: flex;
    gap: .35rem;
}

@media (max-width: 720px) {
    .rtts-modal-card .project-card-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Managing entity picker on the Add New User form. A checkbox list bound to a
   collection is net-new UI in this estate -- no multi-select control existed in
   either FASAMS or the RTT reference app -- so it is built from the existing
   .check-control field styling rather than a new control vocabulary. */
.entity-checklist {
    border: 1px solid #dce6f0;
    border-radius: 8px;
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    margin: 0;
    max-height: 17rem;
    overflow-y: auto;
    padding: .75rem;
}

.entity-checklist[disabled] {
    opacity: .6;
}

.entity-checklist-item {
    align-items: center;
    display: flex;
    gap: .5rem;
    margin: 0;
}

.entity-checklist-item span {
    font-size: .86rem;
    font-weight: 700;
    text-transform: none;
}

/* Per-field validation text. The house convention is a single ValidationSummary,
   but the Users form also shows inline messages, so they need a weight of their
   own that does not compete with the field label above them. */
.entity-form .validation-message {
    color: #a82020;
    display: block;
    font-size: .78rem;
    font-weight: 700;
    margin-top: .3rem;
}

/* Add New User is a long form in a wide modal. The shared .form-grid is a fixed
   two columns, which on an xl dialog leaves half the width empty and pushes the
   Managing Entity picker far below the fold. Let the columns fit the space. */
.user-form .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

/* The action row is the last child of the form, which is itself inside the
   scrolling body, so it needs to stay clear of the fields above it. */
.user-form .rtts-modal-actions {
    margin-top: 1.5rem;
}

/* Keep the first section heading from colliding with the validation summary. */
.user-form .contacts-heading:first-of-type {
    margin-top: 1rem;
}

/* Add New User button.

   .table-toolbar is a grid whose first column is minmax(240px, 1fr) -- sized
   for the search box. The button is the first child, so it landed in that
   flexible column and stretched to fill it; no amount of padding would shrink
   it. Give this toolbar its own column order instead: button sized to content,
   search box taking the remaining width. */
.users-toolbar {
    grid-template-columns: auto minmax(240px, 1fr);
}

.users-toolbar .add-user-button {
    justify-self: start;
}

/* The shared .app-command is sized for page-header commands, which is larger
   than a toolbar button needs. */
.add-user-button.app-command {
    font-size: .78rem;
    gap: .3rem;
    min-height: 1.95rem;
    padding: .22rem .6rem;
}

.add-user-button.app-command i {
    font-size: .72rem;
}

/* Add New User dialog: smaller than the details dialog, which keeps modal-xl
   because its card grid needs the width. Everything inside is tightened to
   match, so the shorter dialog does not simply mean more scrolling. */
.add-user-dialog {
    max-width: min(760px, 94vw);
}

.add-user-dialog .rtts-modal-card {
    max-height: 82vh;
}

.add-user-dialog .rtts-modal-header h2 {
    font-size: 1.15rem;
}

.user-form .form-grid {
    gap: .6rem;
}

.user-form .form-field {
    padding: .5rem .6rem;
}

/* Field labels and values match the View Details dialog exactly.

   They diverged because each dialog was tuned separately: the labels here kept
   site.css's weight of 850 while the view dialog dropped to 700, and the inputs
   sat a step larger than the values they mirror. Opening View and Edit on the
   same user made the difference obvious. Keep these three numbers in step with
   the .compact-detail-dialog dt/dd rules below. */
.user-form .form-field span {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.user-form .form-input {
    font-size: .82rem;
    padding: .3rem .45rem;
}

.user-form .contacts-heading {
    font-size: .8rem;
    margin: 1.1rem 0 .3rem;
    padding-bottom: .4rem;
}

.user-form .contacts-heading-icon {
    height: 1.5rem;
    width: 1.5rem;
    font-size: .72rem;
}

/* No inner scroll. The base rule caps this list at 11rem and scrolls it, which
   hid managing entities behind a scrollbar inside an already-scrollable dialog
   -- two nested scroll regions, and the user could not see the whole set at
   once. The list is bounded (Florida has seven managing entities), so it is
   allowed to size to its content and the dialog does any scrolling. */
.user-form .entity-checklist {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    max-height: none;
    overflow-y: visible;
    padding: .55rem;
}

.user-form .entity-checklist-item span {
    font-size: .8rem;
}

/* Contact Info pairs up: the two emails share a row, the two phones share the
   next. The section's auto-fit default would otherwise pack three across and
   split a pair, putting Phone 1 beside Email 2. */
.user-form .pair-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 620px) {
    .user-form .pair-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Circular row actions: view, edit, activate/deactivate. Each is a tinted disc
   so the three read as a set while staying distinguishable at a glance. */
.icon-actions {
    align-items: center;
    display: flex;
    gap: .45rem;
}

.icon-action {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .88rem;
    height: 2.1rem;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: filter .12s ease-in-out;
    width: 2.1rem;
}

.icon-action:hover:not(:disabled),
.icon-action:focus-visible:not(:disabled) {
    filter: brightness(.93);
}

.icon-action:disabled {
    cursor: default;
    opacity: .6;
}

.icon-action.is-view {
    background: #e4efff;
    border-color: #bcd8f7;
    color: #1f6fc4;
}

.icon-action.is-edit {
    background: #fdf1d4;
    border-color: #f0d79a;
    color: #b07c11;
}

.icon-action.is-status-on {
    background: #ddf6e6;
    border-color: #a7dfbe;
    color: #1a8b4b;
}

/* An inactive user is called out in red rather than greyed down: it is the
   state an administrator is scanning the grid for, and grey pushed it into the
   background. Same tokens as .status-pill.danger so the row reads as one. */
.icon-action.is-status-off {
    background: #fde8e8;
    border-color: #f0c8c8;
    color: #a82020;
}

/* ---------------------------------------------------------------------------
   Data Hub
   Colours taken from the approved design: error tint #fef2f2 on #fecaca with a
   solid #dc2626 disc, warning tint #fffbeb on #fde68a with a solid #f59e0b
   disc. The shared .metric-card tones were too pale to read as a state.
   --------------------------------------------------------------------------- */

.page-subtitle {
    color: #52657d;
    font-size: .86rem;
    margin: .15rem 0 0;
}

.data-hub-summary-row {
    align-items: stretch;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(360px, 2.1fr) repeat(3, minmax(150px, 1fr));
    margin-bottom: 1rem;
}

.data-hub-summary-row .metric-card {
    align-items: center;
    display: flex;
    gap: .85rem;
    margin: 0;
    padding: .9rem 1.1rem;
}

.data-hub-summary-row .metric-card p {
    color: #52657d;
    font-size: .8rem;
    font-weight: 700;
    margin: 0;
}

.data-hub-summary-row .metric-card strong {
    color: #102c49;
    display: block;
    font-size: 1.7rem;
    font-weight: 900;
    line-height: 1.1;
}

.data-hub-summary-row .metric-icon {
    align-items: center;
    border-radius: 10px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.05rem;
    height: 2.6rem;
    justify-content: center;
    width: 2.6rem;
}

.data-hub-summary-row .metric-icon.tone-blue {
    background: #eaf2fb;
    color: #2b6cb0;
}

.metric-card-error {
    background: #fef2f2;
    border-color: #fecaca;
}

.metric-card-error .metric-icon {
    background: #dc2626;
    border-radius: 50%;
    color: #fff;
}

.metric-card-error strong {
    color: #b91c1c;
}

.metric-card-warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.metric-card-warning .metric-icon {
    background: #f59e0b;
    border-radius: 50%;
    color: #fff;
}

.metric-card-warning strong {
    color: #b45309;
}

.entity-selector-card {
    align-items: center;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    padding: .85rem 1.1rem;
    position: relative;
}

.entity-selector-text {
    display: grid;
    gap: .1rem;
    min-width: 0;
}

.entity-selector-label {
    color: #52657d;
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.entity-selector-static {
    color: #102c49;
    font-size: 1rem;
    font-weight: 850;
    line-height: 1.25;
    /* One line, truncated with an ellipsis rather than allowed to run.
       It cannot rely on the cell clipping it: .summary-cell.entity-selector-card
       is deliberately overflow:visible so the dropdown can escape the cell, so
       anything that overflows here lands on top of the next metric. That is
       exactly what happened -- "Central Florida Behavioral Health Network" ran
       across the Accepted figure. The full name is on the button's title. */
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Total Jobs card, tinted like the other two rather than left plain white. */
.metric-card-total {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.metric-card-total strong {
    color: #1d4ed8;
}

.entity-selector-code {
    color: #60758e;
    font-size: .78rem;
    font-weight: 700;
}

/* The real select covers the card and is transparent; the chevron below is what
   the user sees. Keeps the native picker and keyboard behaviour intact. */
.entity-selector-select {
    appearance: none;
    border: 0;
    cursor: pointer;
    height: 100%;
    inset: 0;
    opacity: 0;
    position: absolute;
    width: 100%;
}

.entity-selector-select:focus-visible + .entity-selector-chevron {
    outline: 2px solid #2b6cb0;
    outline-offset: 2px;
}

.entity-selector-chevron {
    color: #52657d;
    flex: 0 0 auto;
    pointer-events: none;
}

.data-hub-toolbar {
    align-items: center;
    border-bottom: 1px solid #e1ebf4;
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    padding: .85rem 1rem;
}

.data-hub-refresh {
    align-items: center;
    background: #eaf2fb;
    border: 1px solid #bcd8f7;
    border-radius: 8px;
    color: #2b6cb0;
    display: inline-flex;
    flex: 0 0 auto;
    height: 2.3rem;
    justify-content: center;
    width: 2.3rem;
}

.data-hub-refresh:hover,
.data-hub-refresh:focus-visible {
    background: #2b6cb0;
    color: #fff;
}

.data-hub-search {
    align-items: center;
    background: #fff;
    border: 1px solid #cdd8e5;
    border-radius: 8px;
    display: flex;
    flex: 1 1 18rem;
    gap: .5rem;
    min-width: 14rem;
    padding: 0 .7rem;
}

.data-hub-search i {
    color: #8fa3ba;
    flex: 0 0 auto;
    font-size: .85rem;
}

.data-hub-search input {
    background: transparent;
    border: 0;
    color: #31455f;
    font-size: .86rem;
    min-height: 2.25rem;
    min-width: 0;
    outline: none;
    width: 100%;
}

.data-hub-command {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .84rem;
    font-weight: 800;
    gap: .45rem;
    min-height: 2.3rem;
    padding: .35rem .85rem;
    white-space: nowrap;
}

.data-hub-command.is-plain {
    background: #fff;
    border: 1px solid #cdd8e5;
    color: #31455f;
}

.data-hub-command.is-plain:hover,
.data-hub-command.is-plain:focus-visible {
    background: #f2f7fc;
}

.data-hub-command.is-primary {
    background: #1d5f9e;
    border: 1px solid #1d5f9e;
    color: #fff;
}

.data-hub-command.is-primary:hover,
.data-hub-command.is-primary:focus-visible {
    background: #174e83;
}

.data-hub-command.is-success {
    background: #15803d;
    border: 1px solid #15803d;
    color: #fff;
}

.data-hub-command.is-success:hover,
.data-hub-command.is-success:focus-visible {
    background: #116631;
}

.data-hub-page .data-table th {
    padding: 0;
}

.data-hub-page .data-table th:first-child .sort-header {
    padding-left: 1.15rem;
}

.data-hub-page .data-table td:first-child {
    padding-left: 1.15rem;
}

.sort-header {
    align-items: center;
    background: transparent;
    border: 0;
    color: #31455f;
    display: flex;
    font-size: .74rem;
    font-weight: 850;
    gap: .35rem;
    padding: .7rem .75rem;
    text-transform: none;
    width: 100%;
}

.sort-header:hover,
.sort-header:focus-visible {
    color: #1d5f9e;
}

.sort-header i {
    color: #9fb2c7;
    font-size: .72rem;
}

.sort-header:hover i {
    color: #1d5f9e;
}

th[aria-sort="ascending"] .sort-header i,
th[aria-sort="descending"] .sort-header i {
    color: #1d5f9e;
}

.file-cell {
    align-items: center;
    display: flex;
    gap: .45rem;
    max-width: 22rem;
}

.file-cell-icon {
    color: #1d5f9e;
    flex: 0 0 auto;
}

.file-link {
    background: transparent;
    border: 0;
    color: #1d5f9e;
    font-size: .86rem;
    font-weight: 700;
    overflow: hidden;
    padding: 0;
    text-align: left;
    text-decoration: underline;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-link:hover,
.file-link:focus-visible {
    color: #123f6b;
}

.value-null {
    color: #94a3b8;
    font-style: italic;
}

.data-hub-page .data-table td.count-error,
.rtts-modal-card dd.count-error {
    color: #dc2626;
    font-weight: 400;
}

.data-hub-page .data-table td.count-warning,
.rtts-modal-card dd.count-warning {
    color: #f59e0b;
    font-weight: 400;
}

/* Grid figures read as data, not emphasis. */
.data-hub-page .data-table td {
    font-weight: 400;
}

.data-hub-page .status-pill,
.rtts-modal-card .status-pill {
    align-items: center;
    display: inline-flex;
    gap: .3rem;
}

.data-hub-page .status-pill.success {
    background: #dcfce7;
    color: #15803d;
}

.data-hub-page .status-pill.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.data-hub-page .status-pill.warning {
    background: #fef3c7;
    color: #b45309;
}

.data-hub-pager {
    align-items: center;
    border-top: 1px solid #e1ebf4;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: space-between;
    padding: .85rem 1rem;
}

.data-hub-pager-summary {
    color: #52657d;
    font-size: .84rem;
}

.data-hub-pager-pages {
    align-items: center;
    display: flex;
    gap: .25rem;
}

.page-button {
    align-items: center;
    background: #fff;
    border: 1px solid #cdd8e5;
    border-radius: 6px;
    color: #31455f;
    display: inline-flex;
    font-size: .82rem;
    font-weight: 800;
    justify-content: center;
    min-height: 2rem;
    min-width: 2rem;
    padding: 0 .4rem;
}

.page-button:hover:not(:disabled):not(.selected),
.page-button:focus-visible:not(:disabled):not(.selected) {
    background: #f2f7fc;
    border-color: #9dccff;
}

.page-button.selected {
    background: #1d5f9e;
    border-color: #1d5f9e;
    color: #fff;
}

.page-button:disabled {
    color: #b6c2d1;
    cursor: default;
}

.page-gap {
    color: #8fa3ba;
    padding: 0 .15rem;
}

.filter-panel {
    background: #f8fbff;
    border: 1px solid #dce6f0;
    border-radius: 8px;
    display: grid;
    gap: .85rem;
    margin: 1rem;
    padding: 1rem;
}

.filter-panel-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: space-between;
}

.filter-panel-header h3 {
    align-items: center;
    color: #102c49;
    display: flex;
    font-size: .85rem;
    font-weight: 900;
    gap: .45rem;
    margin: 0;
    text-transform: uppercase;
}

.filter-panel-note {
    align-items: center;
    color: #b45309;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 700;
    gap: .35rem;
}

.filter-panel-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-panel-actions {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
}

.upload-dropzone {
    align-items: center;
    background: #f4f8fd;
    border: 2px dashed #bcd8f7;
    border-radius: 10px;
    display: grid;
    gap: .5rem;
    justify-items: center;
    padding: 2.25rem 1rem;
    position: relative;
    text-align: center;
}

.upload-dropzone[aria-disabled="true"] {
    opacity: .75;
}

.upload-dropzone-icon {
    color: #9dccff;
    font-size: 2.2rem;
}

.upload-dropzone strong {
    color: #102c49;
    font-size: 1rem;
}

.upload-dropzone span {
    color: #60758e;
    font-size: .84rem;
}

.upload-dropzone-hint {
    align-items: center;
    display: inline-flex;
    gap: .35rem;
}

.upload-file-input {
    cursor: pointer;
    inset: 0;
    opacity: 0;
    position: absolute;
    width: 100%;
    z-index: 1;
}

.upload-dropzone[aria-disabled="true"] .upload-file-input {
    cursor: default;
}

.upload-dropzone-icon,
.upload-dropzone strong,
.upload-dropzone > span {
    pointer-events: none;
}

.upload-selected-section {
    display: grid;
    gap: .65rem;
}

.upload-selected-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.upload-selected-heading h3 {
    color: #102c49;
    font-size: .9rem;
    font-weight: 900;
    margin: 0;
    text-transform: uppercase;
}

.upload-selected-heading span,
.upload-selected-size {
    color: #60758e;
    font-size: .78rem;
    font-weight: 700;
}

.upload-selected-list {
    border: 1px solid #dce6f0;
    border-radius: 8px;
    list-style: none;
    margin: 0;
    overflow: hidden;
    padding: 0;
}

.upload-selected-row {
    align-items: center;
    display: grid;
    gap: .7rem;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    padding: .7rem .8rem;
}

.upload-selected-row + .upload-selected-row {
    border-top: 1px solid #e1ebf4;
}

.upload-selected-file-icon {
    color: #1d5f9e;
}

.upload-selected-name {
    color: #102c49;
    font-size: .84rem;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-selected-row .status-pill.info,
.upload-selected-row .status-pill.neutral {
    background: #e8f2fd;
    color: #1d5f9e;
}

.upload-selected-row .status-pill.warning {
    background: #fff4d2;
    color: #8a5a00;
}

.upload-selected-row .status-pill.success {
    background: #dcfce7;
    color: #15803d;
}

.upload-selected-row .status-pill.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.upload-remove-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: #60758e;
    display: inline-flex;
    height: 1.9rem;
    justify-content: center;
    padding: 0;
    width: 1.9rem;
}

.upload-remove-button:hover,
.upload-remove-button:focus-visible {
    background: #fee2e2;
    color: #b91c1c;
}

.upload-batch-status {
    background: #f4f8fd;
    border: 1px solid #dce6f0;
    border-radius: 8px;
    color: #52657d;
    padding: .7rem .8rem;
}

@media (max-width: 640px) {
    .upload-selected-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .upload-selected-size {
        grid-column: 2;
    }
}

.export-option-group {
    border: 1px solid #dce6f0;
    border-radius: 8px;
    display: grid;
    gap: .4rem;
    margin: 0;
    padding: .75rem .9rem;
}

.export-option-group legend {
    color: #52657d;
    float: none;
    font-size: .7rem;
    font-weight: 850;
    margin: 0;
    padding: 0 .3rem;
    text-transform: uppercase;
    width: auto;
}

.detail-note {
    color: #60758e;
    display: block;
    font-size: .76rem;
    font-weight: 600;
    margin-top: .2rem;
    text-transform: none;
}

@media (max-width: 1100px) {
    .data-hub-summary-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------------------------------------------------------------------------
   File Details
   --------------------------------------------------------------------------- */

.file-details-header {
    align-items: center;
    gap: 1rem;
}

.file-details-header .page-title-group {
    align-items: center;
    gap: .85rem;
}

.file-details-header h1 {
    margin: 0;
}

.file-details-exports {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

/* --- Summary card --- */
.file-summary-row {
    align-items: stretch;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
    margin-bottom: 1rem;
}

.file-summary-main {
    display: grid;
    gap: .9rem;
    padding: 1rem 1.15rem;
}

.file-summary-title {
    align-items: center;
    display: flex;
    gap: .75rem;
    min-width: 0;
}

.file-summary-title > div {
    display: grid;
    gap: .1rem;
    min-width: 0;
}

.file-summary-title strong {
    color: #102c49;
    font-size: 1.05rem;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-summary-title span {
    color: #60758e;
    font-size: .82rem;
    font-weight: 700;
}

.file-summary-icon {
    align-items: center;
    background: #eaf2fb;
    border-radius: 10px;
    color: #1d5f9e;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.1rem;
    height: 2.7rem;
    justify-content: center;
    width: 2.7rem;
}

.file-summary-facts {
    border-top: 1px solid #e1ebf4;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    padding-top: .85rem;
}

.file-summary-facts dt {
    color: #52657d;
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.file-summary-facts dd {
    color: #102c49;
    font-size: .88rem;
    font-weight: 700;
    margin: .2rem 0 0;
    overflow-wrap: anywhere;
}

.file-summary-status {
    display: grid;
    gap: .9rem;
    justify-items: start;
    padding: 1rem 1.15rem;
}

.file-summary-badge {
    font-size: .88rem;
    padding: .45rem .85rem;
}

.file-summary-metrics {
    border-top: 1px solid #e1ebf4;
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: .85rem;
    width: 100%;
}

.file-summary-metrics > div {
    align-items: center;
    display: flex;
    gap: .5rem;
    min-width: 0;
}

.file-summary-metrics p {
    color: #52657d;
    font-size: .74rem;
    font-weight: 700;
    margin: 0;
}

.file-summary-metrics strong {
    color: #102c49;
    font-size: 1.15rem;
    font-weight: 900;
}

.file-summary-metrics .metric-icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .85rem;
    height: 2.1rem;
    justify-content: center;
    width: 2.1rem;
}

.file-summary-metrics .metric-icon.tone-blue {
    background: #eaf2fb;
    color: #2b6cb0;
}

.file-summary-metrics .metric-icon.is-error {
    background: #dc2626;
    border-radius: 50%;
    color: #fff;
}

.file-summary-metrics .metric-icon.is-warning {
    background: #f59e0b;
    border-radius: 50%;
    color: #fff;
}

.count-error-text {
    color: #dc2626;
}

.count-warning-text {
    color: #f59e0b;
}

/* --- Tabs --- */
.violation-tabs {
    padding: .75rem 1rem 0;
}

.violation-tabs .assignment-tab {
    align-items: center;
    display: inline-flex;
    gap: .4rem;
}

.tab-icon-error {
    color: #dc2626;
}

.tab-icon-warning {
    color: #f59e0b;
}

/* --- Grouped violation list --- */
.violation-groups {
    display: grid;
    gap: .65rem;
    padding: 1rem;
}

.violation-group {
    border: 1px solid #dce6f0;
    border-radius: 10px;
    overflow: hidden;
}

.violation-group-header {
    align-items: center;
    background: #fbfdff;
    border: 0;
    display: flex;
    gap: .75rem;
    padding: .7rem .85rem;
    text-align: left;
    width: 100%;
}

.violation-group-header:hover,
.violation-group-header:focus-visible {
    background: #f2f7fc;
}

.violation-group-icon {
    align-items: center;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .8rem;
    height: 1.9rem;
    justify-content: center;
    width: 1.9rem;
}

.violation-group-icon.is-error {
    background: #dc2626;
}

.violation-group-icon.is-warning {
    background: #f59e0b;
}

.violation-group-text {
    display: grid;
    flex: 1 1 auto;
    gap: .1rem;
    min-width: 0;
}

.violation-group-text strong {
    color: #102c49;
    font-size: .9rem;
    font-weight: 850;
}

.violation-group-text span {
    color: #60758e;
    font-size: .78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.violation-group-count {
    border-radius: 999px;
    flex: 0 0 auto;
    font-size: .76rem;
    font-weight: 800;
    padding: .2rem .6rem;
}

.violation-group-count.is-error {
    background: #fee2e2;
    color: #b91c1c;
}

.violation-group-count.is-warning {
    background: #fef3c7;
    color: #b45309;
}

.violation-group-chevron {
    color: #8fa3ba;
    flex: 0 0 auto;
    font-size: .8rem;
}

.violation-table {
    min-width: 0;
}

.violation-table th {
    padding: .55rem .85rem;
}

.violation-table td {
    font-weight: 400;
    padding: .55rem .85rem;
    vertical-align: top;
}

.severity-pill {
    font-size: .72rem;
    padding: .2rem .55rem;
}

.violation-code {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.violation-message {
    color: #31455f;
    overflow-wrap: anywhere;
}

.violation-empty {
    display: block;
    padding: 2.5rem 1rem;
    text-align: center;
}

@media (max-width: 1100px) {
    .file-summary-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .file-summary-facts,
    .file-summary-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------------------------------------------------------------------------
   File Details â€” corrections against the approved design
   --------------------------------------------------------------------------- */

/* The violation table is ruled on both axes, as in the approved design; the
   shared .data-table draws only horizontal row separators. */
.violation-table.is-lined {
    border: 1px solid #dce6f0;
    border-collapse: collapse;
    min-width: 0;
    width: 100%;
}

.violation-table.is-lined th,
.violation-table.is-lined td {
    border: 1px solid #dce6f0;
}

.violation-table.is-lined th {
    background: #f6f9fc;
    color: #52657d;
    font-size: .72rem;
    font-weight: 800;
    text-transform: none;
}

/* Column widths: severity and code stay tight so the message gets the room. */
.violation-table.is-lined th:nth-child(1),
.violation-table.is-lined td:nth-child(1) {
    width: 8.5rem;
}

.violation-table.is-lined th:nth-child(2),
.violation-table.is-lined td:nth-child(2) {
    width: 5rem;
}

/* "Business Rule" must stay on one line. */
.severity-pill {
    display: inline-flex;
    font-size: .72rem;
    padding: .2rem .55rem;
    white-space: nowrap;
}

/* Selected row, so Back makes it obvious which file was opened. */
.data-hub-page .data-table tbody tr.is-selected-row > td {
    background: #eaf2fb;
    box-shadow: inset 0 0 0 9999px rgba(29, 95, 158, .06);
}

.data-hub-page .data-table tbody tr.is-selected-row > td:first-child {
    box-shadow:
        inset 4px 0 0 0 #1d5f9e,
        inset 0 0 0 9999px rgba(29, 95, 158, .06);
}

/* ---------------------------------------------------------------------------
   File Details â€” second pass against the approved design
   --------------------------------------------------------------------------- */

/* Ruled on both axes. The shared .data-table draws only horizontal separators,
   and .data-table td carries its own border-top, so these must be specific
   enough to win and must reset that border-top explicitly. */
.file-details-page .violation-table.is-lined,
.violation-table.is-lined {
    border: 1px solid #d7e2ee;
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
}

.file-details-page .violation-table.is-lined th,
.file-details-page .violation-table.is-lined td,
.violation-table.is-lined th,
.violation-table.is-lined td {
    border: 1px solid #d7e2ee;
    border-top: 1px solid #d7e2ee;
    padding: .5rem .6rem;
    vertical-align: top;
}

.file-details-page .violation-table.is-lined th,
.violation-table.is-lined th {
    background: #f6f9fc;
    color: #52657d;
    font-size: .72rem;
    font-weight: 800;
    text-align: left;
    text-transform: none;
}

/* Fixed layout so Severity and Code stay narrow and Message takes the rest. */
.violation-table.is-lined th:nth-child(1),
.violation-table.is-lined td:nth-child(1) {
    width: 8.5rem;
}

.violation-table.is-lined th:nth-child(2),
.violation-table.is-lined td:nth-child(2) {
    width: 5.5rem;
}

.severity-pill {
    display: inline-flex;
    font-size: .7rem;
    padding: .18rem .5rem;
    white-space: nowrap;
}

/* Group header text aligns with the table headings below it. */
.violation-group-header {
    padding-left: .6rem;
}

.violation-groups {
    padding: .85rem;
}

/* Issue-type dropdown, styled to match the search box beside it. */
.issue-type-filter {
    align-items: center;
    background: #fff;
    border: 1px solid #cdd8e5;
    border-radius: 8px;
    display: flex;
    flex: 0 1 17rem;
    gap: .5rem;
    min-width: 11rem;
    padding: 0 .7rem;
    position: relative;
}

.issue-type-filter select {
    appearance: none;
    background: transparent;
    border: 0;
    color: #31455f;
    font-size: .84rem;
    min-height: 2.25rem;
    min-width: 0;
    outline: none;
    padding-right: 1rem;
    width: 100%;
}

.issue-type-filter i {
    color: #8fa3ba;
    font-size: .72rem;
    pointer-events: none;
    position: absolute;
    right: .7rem;
}

/* ---------------------------------------------------------------------------
   File Details summary card â€” matched to the approved design
   --------------------------------------------------------------------------- */

/* The left panel must fit "Central Florida Behavioral Health Network" on one
   line beside two more columns, so it gets a real minimum rather than a ratio.
   Below the stacking breakpoint this is relaxed, so it never forces a scroll. */
.file-summary-row {
    grid-template-columns: minmax(640px, 1.6fr) minmax(360px, 1fr);
}

.file-details-page .file-summary-title strong {
    color: #1d5f9e;
    font-size: 1.05rem;
}

/* Fields sit in a ruled row: separators between them, not around them. */
.file-details-page .file-summary-facts {
    gap: 0;
    grid-template-columns: auto auto auto;
    justify-content: start;
}

.file-details-page .file-summary-facts > div {
    padding: 0 1.15rem;
}

.file-details-page .file-summary-facts > div:first-child {
    padding-left: 0;
}

.file-details-page .file-summary-facts > div + div {
    border-left: 1px solid #e1ebf4;
}

/* Title case, as drawn â€” not the uppercase label style used elsewhere. */
.file-details-page .file-summary-facts dt {
    color: #64748b;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.file-details-page .file-summary-facts dd {
    color: #1d5f9e;
    font-size: .92rem;
    font-weight: 700;
    margin-top: .25rem;
    /* The whole point: the entity name stays on one line. */
    white-space: nowrap;
}

/* Metrics get the same ruled treatment. */
.file-details-page .file-summary-metrics {
    gap: 0;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
}

.file-details-page .file-summary-metrics > div {
    padding: 0 1.1rem;
}

.file-details-page .file-summary-metrics > div:first-child {
    padding-left: 0;
}

.file-details-page .file-summary-metrics > div + div {
    border-left: 1px solid #e1ebf4;
}

.file-details-page .file-summary-metrics p {
    color: #64748b;
    font-size: .74rem;
    font-weight: 600;
    white-space: nowrap;
}

.file-details-page .file-summary-metrics strong {
    font-size: 1.2rem;
    font-weight: 900;
}

.count-processed-text {
    color: #16a34a;
}

/* Narrow viewports: release the fixed minimum and let values wrap rather than
   forcing a horizontal scrollbar across the whole page. */
@media (max-width: 1100px) {
    .file-summary-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .file-details-page .file-summary-facts,
    .file-details-page .file-summary-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: .85rem;
    }

    .file-details-page .file-summary-facts dd {
        white-space: normal;
    }

    .file-details-page .file-summary-facts > div,
    .file-details-page .file-summary-metrics > div {
        padding-left: 1rem;
    }

    .file-details-page .file-summary-facts > div:nth-child(odd),
    .file-details-page .file-summary-metrics > div:nth-child(odd) {
        border-left: 0;
        padding-left: 0;
    }
}

/* ---------------------------------------------------------------------------
   File Details violations card â€” matched to the approved design
   --------------------------------------------------------------------------- */

/* Tabs are underlined text, not the pill style used elsewhere in the app. */
.violation-tabs {
    align-items: stretch;
    border-bottom: 1px solid #e5eaf0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--feature-tab-gap);
    padding: 0 1.15rem;
}

.violation-tab {
    align-items: center;
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    color: #64748b;
    display: inline-flex;
    font-size: var(--feature-tab-font-size);
    font-weight: var(--feature-tab-font-weight);
    line-height: 1.5;
    min-height: var(--feature-tab-min-height);
    gap: .45rem;
    margin-bottom: -1px;
    padding: var(--feature-tab-padding-block) var(--feature-tab-padding-inline);
}

.violation-tab:hover {
    color: #31455f;
}

.violation-tab.is-error > i {
    color: #dc2626;
}

.violation-tab.is-warning > i {
    color: #f59e0b;
}

.violation-tab.selected {
    color: #0f172a;
}

.violation-tab.is-error.selected {
    border-bottom-color: #dc2626;
}

.violation-tab.is-warning.selected {
    border-bottom-color: #f59e0b;
}

.violation-tab-count {
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 800;
    padding: .1rem .55rem;
}

.violation-tab-count.is-error {
    background: #fee2e2;
    color: #b91c1c;
}

.violation-tab-count.is-warning {
    background: #fef3c7;
    color: #b45309;
}

/* Toolbar: search and filter on the left, icon buttons pinned right. */
.file-details-page .data-hub-toolbar {
    border-bottom: 0;
    gap: .65rem;
    padding: .9rem 1.15rem;
}

.violation-toolbar-actions {
    display: flex;
    gap: .4rem;
    margin-left: auto;
}

.violation-icon-button {
    align-items: center;
    background: #fff;
    border: 1px solid #cdd8e5;
    border-radius: 8px;
    color: #52657d;
    display: inline-flex;
    height: 2.35rem;
    justify-content: center;
    width: 2.35rem;
}

.violation-icon-button:hover:not(:disabled) {
    background: #f2f7fc;
}

.violation-icon-button.selected {
    background: #e4f1fb;
    border-color: #7cc0ec;
    color: #1d5f9e;
}

.violation-icon-button:disabled {
    color: #b6c2d1;
    cursor: default;
}

/* Record cards. */
.violation-groups {
    display: grid;
    gap: .75rem;
    padding: 0 1.15rem 1.15rem;
}

.violation-group {
    background: #fff;
    border: 1px solid #e3eaf2;
    border-radius: 10px;
    overflow: hidden;
}

.violation-group-header {
    align-items: center;
    background: #fbfdff;
    gap: .7rem;
    padding: .7rem .85rem;
}

.violation-group-text strong {
    color: #0f172a;
    font-size: .92rem;
    font-weight: 800;
}

/* Identifiers separated by a rule, as drawn. */
.violation-group-identifiers {
    align-items: center;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    font-size: .74rem;
    gap: 0;
    margin-top: .15rem;
}

.identifier-part {
    padding: 0 .6rem;
}

.identifier-part:first-child {
    padding-left: 0;
}

.identifier-part + .identifier-part {
    border-left: 1px solid #d7e2ee;
}

.violation-group-count {
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 800;
    padding: .22rem .7rem;
    white-space: nowrap;
}

.violation-group-count.is-error {
    background: #fde8e8;
    color: #c0392b;
}

.violation-group-count.is-warning {
    background: #fef3c7;
    color: #b45309;
}

/* Table inside a record. */
.file-details-page .violation-table.is-lined {
    border: 0;
    border-top: 1px solid #e3eaf2;
}

.file-details-page .violation-table.is-lined th {
    background: #f7fafc;
    padding: 0;
}

.file-details-page .violation-table.is-lined th .sort-header {
    color: #475569;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: 0;
    padding: .55rem .75rem;
    text-transform: none;
}

.file-details-page .violation-table.is-lined td {
    color: #334155;
    font-size: .82rem;
    padding: .55rem .75rem;
}

.file-details-page .violation-table.is-lined th:nth-child(1),
.file-details-page .violation-table.is-lined td:nth-child(1) {
    width: 9rem;
}

.file-details-page .violation-table.is-lined th:nth-child(2),
.file-details-page .violation-table.is-lined td:nth-child(2) {
    width: 6rem;
}

.file-details-page .violation-table.is-lined th:nth-child(3),
.file-details-page .violation-table.is-lined td:nth-child(3) {
    width: 14rem;
}

/* Severity reads as a tinted pill, not the app's status vocabulary. */
.severity-pill {
    border-radius: 6px;
    display: inline-flex;
    font-size: .72rem;
    font-weight: 700;
    padding: .25rem .55rem;
    white-space: nowrap;
}

.severity-pill.is-error {
    background: #fde8e8;
    color: #c0392b;
}

.severity-pill.is-warning {
    background: #fef3c7;
    color: #b45309;
}

/* Code sits in a badge, as drawn. */
.code-badge {
    background: #eef2f7;
    border-radius: 6px;
    color: #334155;
    display: inline-block;
    font-size: .76rem;
    padding: .2rem .5rem;
}

.violation-field {
    color: #334155;
    overflow-wrap: anywhere;
}

/* File Details toolbar proportions: the search box was taking the whole spare
   row while the issue-type dropdown truncated its rule labels. Scoped to this
   page so the Data Hub toolbar keeps its own balance. */
.file-details-page .data-hub-search {
    flex: 1 1 18rem;
    max-width: 30rem;
}

.file-details-page .issue-type-filter {
    flex: 0 1 24rem;
    min-width: 16rem;
}

/* ---------------------------------------------------------------------------
   Data Hub â€” matched to the approved design
   The summary is ONE card divided into four, not four cards with gaps, and the
   grid is ruled on both axes with a compact header row.
   --------------------------------------------------------------------------- */

.data-hub-page .data-hub-summary-row {
    align-items: stretch;
    display: grid;
    gap: 0;
    /* The ONE place these columns are defined. They were declared in four
       different blocks at one point, each overriding the last, which is how the
       selector ended up too narrow for the entity name. Change them here. */
    grid-template-columns: minmax(300px, 1.7fr) repeat(3, minmax(150px, 1fr));
    margin-bottom: 1rem;
    overflow: hidden;
    padding: 0;
}

.data-hub-page .summary-cell {
    /* A grid item defaults to min-width:auto, which lets its content push the
       track wider than the template allows. Without this the cells stop
       honouring their columns as soon as a value is long. */
    min-width: 0;
    padding: .85rem 1.15rem;
}

.data-hub-page .summary-cell + .summary-cell {
    border-left: 1px solid #e5eaf0;
}

/* Metric sections are plain white; only the icon and the figure carry colour. */
.data-hub-page .summary-metric {
    align-items: center;
    display: flex;
    gap: .75rem;
}

.data-hub-page .summary-metric p {
    color: #64748b;
    font-size: .78rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.data-hub-page .summary-metric strong {
    color: #0f172a;
    display: block;
    font-size: 1.65rem;
    font-weight: 900;
    line-height: 1.15;
}

.data-hub-page .summary-metric .metric-icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1rem;
    height: 2.5rem;
    justify-content: center;
    width: 2.5rem;
}

.data-hub-page .summary-metric .metric-icon.tone-blue {
    background: #f1f5f9;
    color: #64748b;
}

.data-hub-page .summary-metric .metric-icon.is-error {
    background: #dc2626;
    border-radius: 50%;
    color: #fff;
}

.data-hub-page .summary-metric .metric-icon.is-warning {
    background: #f59e0b;
    border-radius: 50%;
    color: #fff;
}

.data-hub-page .count-error-text {
    color: #dc2626;
}

.data-hub-page .count-warning-text {
    color: #d97706;
}

.data-hub-page .entity-selector-card {
    align-items: center;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    position: relative;
}

/* --- Grid: ruled on both axes, compact header --- */
.data-hub-page .data-table {
    border-collapse: collapse;
}

.data-hub-page .data-table th,
.data-hub-page .data-table td {
    border-bottom: 1px solid #e5eaf0;
}

.data-hub-page .data-table th:not(:last-child),
.data-hub-page .data-table td:not(:last-child) {
    border-right: 1px solid #e5eaf0;
}

.data-hub-page .data-table thead th {
    background: #f7fafc;
    border-top: 1px solid #e5eaf0;
}

/* Smaller header row, as drawn. */
/* Title case is now the default for every grid header, so this no longer needs
   to override it -- only the Data Hub's tighter size and padding remain. */
.data-hub-page .data-table th .sort-header {
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .01em;
    padding: .45rem .6rem;
}

.data-hub-page .data-table th:first-child .sort-header {
    padding-left: .85rem;
}

.data-hub-page .data-table td {
    font-size: .82rem;
    padding: .55rem .6rem;
}

.data-hub-page .data-table td:first-child {
    padding-left: .85rem;
}

/* The toolbar sits in the same card as the grid, so it needs no bottom gap. */
.data-hub-page .data-hub-toolbar {
    padding: .8rem .85rem;
}

@media (max-width: 1100px) {
    .data-hub-page .data-hub-summary-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .data-hub-page .summary-cell:nth-child(odd) {
        border-left: 0;
    }

    .data-hub-page .summary-cell:nth-child(n + 3) {
        border-top: 1px solid #e5eaf0;
    }
}

/* A <td> must stay display:table-cell. Setting display:flex on it removes the
   cell from the table formatting context: it renders as a detached box, drops
   its column border, and stops aligning with the header above it. The flex
   layout belongs on an inner wrapper. */
.data-hub-page .data-table td.file-cell {
    display: table-cell;
    max-width: 24rem;
    vertical-align: middle;
}

.file-cell-inner {
    align-items: center;
    display: flex;
    gap: .45rem;
    min-width: 0;
}

.data-hub-page .data-table td.actions-cell {
    display: table-cell;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.data-hub-page .data-table td.actions-cell .icon-actions {
    align-items: center;
    display: inline-flex;
    gap: .45rem;
}

/* Summary row spacing, matched to the approved design: the sections breathe
   more, and the card sits clear of the grid card below it. */
.data-hub-page .data-hub-summary-row {
    margin-bottom: 1.15rem;
}

.data-hub-page .summary-cell {
    padding: 1.05rem 1.5rem;
}


/* Figures sized so a seven-digit total fits its cell at the widths above.
   Declared once; do not add another .summary-metric strong rule elsewhere. */
.data-hub-page .summary-metric strong {
    font-size: 1.3rem;
    overflow-wrap: anywhere;
}

/* Below 1400 the four columns cannot all keep their natural width. The
   selector keeps the larger share because a truncated entity name is worse
   than a slightly tighter number. */
@media (max-width: 1400px) {
    .data-hub-page .data-hub-summary-row {
        grid-template-columns: minmax(250px, 1.5fr) repeat(3, minmax(118px, 1fr));
    }

    .data-hub-page .summary-metric strong {
        font-size: 1.15rem;
    }

    .data-hub-page .entity-selector-static {
        font-size: .92rem;
    }
}

/* Two rows: selector and Accepted, then Errors and Warnings. */
@media (max-width: 1100px) {
    .data-hub-page .data-hub-summary-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.data-hub-page .summary-metric {
    gap: .95rem;
}

/* Warnings is a PALE disc with an amber glyph, not a solid fill. Errors stays
   solid red, as drawn. */
.data-hub-page .summary-metric .metric-icon.is-warning {
    background: #fef3c7;
    color: #f59e0b;
}

.data-hub-page .summary-metric .metric-icon.tone-blue {
    background: #f1f5f9;
    border-radius: 8px;
    color: #475569;
}

/* Grid card: toolbar and table need the same breathing room. */
.data-hub-page .data-hub-toolbar {
    padding: .9rem 1rem;
}

.data-hub-page .data-table th .sort-header {
    padding: .5rem .7rem;
}

.data-hub-page .data-table td {
    padding: .6rem .7rem;
}

.data-hub-page .data-table th:first-child .sort-header,
.data-hub-page .data-table td:first-child {
    padding-left: 1rem;
}

/* .app-page is a grid with gap: 1.25rem, so a margin-bottom on a child ADDS to
   that gap instead of setting it — which is what made the space below the
   summary row roughly double the space above it. Let the grid gap alone govern,
   so every card on the page is separated by the same distance. */
.data-hub-page .data-hub-summary-row,
.file-details-page .file-summary-row {
    margin-bottom: 0;
}

/* The metric figures were losing their colour: .file-details-page
   .file-summary-metrics strong (0,2,1) outranked the bare .count-*-text class
   (0,1,0), so Processed, Errors and Warnings all rendered slate. Match the
   element selector so the colours actually apply. */
.file-details-page .file-summary-metrics strong.count-processed-text {
    color: #16a34a;
}

.file-details-page .file-summary-metrics strong.count-error-text {
    color: #dc2626;
}

.file-details-page .file-summary-metrics strong.count-warning-text {
    color: #f59e0b;
}

/* Expand / collapse all. There is no industry-standard colour for these; the
   established convention is a neutral icon button whose ACTIVE state carries
   the product accent. Expand and collapse are also mutually exclusive, so only
   one is ever lit, which is what tells the user the current state. */
.violation-icon-button {
    color: #475569;
}

.violation-icon-button:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #b6c6d8;
    color: #1d5f9e;
}

.violation-icon-button.selected {
    background: #e4f1fb;
    border-color: #1d5f9e;
    color: #1d5f9e;
}

/* Two columns now, so Message takes the width the Field column used to hold. */
.file-details-page .violation-table.is-lined th:nth-child(3),
.file-details-page .violation-table.is-lined td:nth-child(3) {
    width: auto;
}

/* ---------------------------------------------------------------------------
   Managing Entity picker â€” custom listbox
   Replaces the native <select>, which could not carry per-entity icons, code
   badges or a selected-state check.
   --------------------------------------------------------------------------- */

.data-hub-page .entity-selector-card {
    padding: 0;
    position: relative;
}

.entity-selector-trigger {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 10px;
    display: flex;
    gap: .85rem;
    padding: 1.05rem 1.3rem;
    text-align: left;
    width: 100%;
}

.entity-selector-trigger:hover {
    background: #f7fafd;
}

.data-hub-page .entity-selector-card.is-open {
    box-shadow: inset 0 0 0 2px #2fc4d8;
    border-radius: 10px;
}

.entity-selector-icon {
    align-items: center;
    background: #e3f4f8;
    border-radius: 50%;
    color: #1d6b86;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1rem;
    height: 2.7rem;
    justify-content: center;
    width: 2.7rem;
}

.data-hub-page .entity-selector-text {
    display: grid;
    flex: 1 1 auto;
    gap: .05rem;
    min-width: 0;
}

.entity-selector-chevron {
    color: #1d3f63;
    flex: 0 0 auto;
    font-size: .9rem;
}

/* Backdrop catches the click that dismisses the menu. */
.entity-menu-backdrop {
    inset: 0;
    position: fixed;
    z-index: 40;
}

.entity-menu {
    background: #fff;
    border: 1px solid #d9e6ee;
    border-radius: 12px;
    box-shadow: 0 18px 38px rgba(15, 31, 61, .16);
    left: 0;
    margin-top: .4rem;
    max-height: 22rem;
    overflow-y: auto;
    padding: .4rem;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 50;
}

.entity-option {
    align-items: center;
    background: transparent;
    border: 0;
    border-left: 4px solid transparent;
    border-radius: 8px;
    display: flex;
    gap: .75rem;
    padding: .6rem .75rem;
    text-align: left;
    width: 100%;
}

.entity-option:hover,
.entity-option:focus-visible {
    background: #f1f5f9;
}

.entity-option.selected {
    background: #f0fbfd;
    border-left-color: #2fc4d8;
}

.entity-option-icon {
    align-items: center;
    background: #e8f1f8;
    border-radius: 50%;
    color: #1d5f9e;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .85rem;
    height: 2.1rem;
    justify-content: center;
    width: 2.1rem;
}

.entity-option-name {
    color: #0f2f52;
    flex: 1 1 auto;
    font-size: .92rem;
    font-weight: 700;
    min-width: 0;
}

.entity-option-code {
    background: #eef2f7;
    border-radius: 6px;
    color: #52657d;
    flex: 0 0 auto;
    font-size: .76rem;
    font-weight: 700;
    padding: .18rem .55rem;
}

.entity-option-check {
    color: #0f7c92;
    flex: 0 0 auto;
    font-size: 1.15rem;
    width: 1.2rem;
}

.entity-menu-note {
    border-top: 1px solid #edf2f7;
    color: #64748b;
    font-size: .78rem;
    margin: .35rem 0 0;
    padding: .55rem .75rem .3rem;
}

/* The card clips its children for the rounded corners, which would hide the
   menu; the menu escapes only on this page's summary row. */
.data-hub-page .data-hub-summary-row,
.data-hub-page .summary-cell.entity-selector-card {
    overflow: visible;
}

/* Expand / Collapse all are COMMANDS, not toggles. They previously lit when the
   page happened to be fully expanded or fully collapsed, but the page opens in
   a mixed state (first few records open), so on load neither lit and the pair
   read as "nothing is on". A command button gets hover and press feedback only;
   the chevron direction already says which does what. */
.violation-icon-button {
    background: #fff;
    border: 1px solid #cdd8e5;
    color: #475569;
    transition: background-color .12s ease-in-out, color .12s ease-in-out;
}

.violation-icon-button:hover:not(:disabled) {
    background: #eef4fa;
    border-color: #9dccff;
    color: #1d5f9e;
}

.violation-icon-button:active:not(:disabled) {
    background: #dce9f6;
    border-color: #1d5f9e;
    color: #14497a;
}

.violation-icon-button:focus-visible {
    outline: 2px solid #1d5f9e;
    outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Client Search
   --------------------------------------------------------------------------- */

.client-search-page .page-title-group h1 {
    margin: 0;
}

/* --- Search criteria card --- */
.criteria-card {
    padding: 0;
}

.criteria-header {
    align-items: center;
    border-bottom: 1px solid #e5eaf0;
    color: #1d3f63;
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    padding: .85rem 1.15rem;
}

.criteria-header h2 {
    color: #0f2f52;
    font-size: .95rem;
    font-weight: 850;
    margin: 0;
}

.criteria-header > i {
    color: #1d5f9e;
}

.criteria-hint {
    color: #64748b;
    font-size: .8rem;
    font-weight: 500;
}

.criteria-grid {
    display: grid;
    gap: .9rem 1.1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 1.1rem 1.15rem .35rem;
}

.criteria-field {
    display: grid;
    gap: .3rem;
    min-width: 0;
}

.criteria-field > span {
    color: #334155;
    font-size: .78rem;
    font-weight: 700;
}

.criteria-field input,
.criteria-select select {
    background: #fff;
    border: 1px solid #cdd8e5;
    border-radius: 8px;
    color: #31455f;
    font-size: .86rem;
    min-height: 2.45rem;
    padding: .35rem .7rem;
    width: 100%;
}

.criteria-field input:focus,
.criteria-select select:focus {
    border-color: #1d5f9e;
    outline: none;
}

.criteria-field input::placeholder {
    color: #9aa9bb;
}

.criteria-field input:disabled,
.criteria-select select:disabled {
    background: #f8fafc;
    color: #94a3b8;
}

/* Select wrapper carries the leading icon and the chevron. */
.criteria-select {
    align-items: center;
    display: flex;
    position: relative;
}

.criteria-select > i:first-child {
    color: #1d5f9e;
    font-size: .85rem;
    left: .7rem;
    pointer-events: none;
    position: absolute;
}

.criteria-select > i:first-child ~ select {
    padding-left: 2.1rem;
}

.criteria-select select {
    appearance: none;
    padding-right: 2rem;
}

.criteria-chevron {
    color: #64748b;
    font-size: .72rem;
    pointer-events: none;
    position: absolute;
    right: .75rem;
}

.criteria-wide {
    grid-column: span 2;
}

.criteria-actions {
    display: flex;
    gap: .6rem;
    justify-content: flex-end;
    padding: .35rem 1.15rem 1.1rem;
}

/* --- Results card --- */
.results-toolbar {
    justify-content: space-between;
}

.results-title-group {
    align-items: center;
    display: flex;
    gap: .55rem;
}

.results-title-group h2 {
    color: #0f2f52;
    font-size: .95rem;
    font-weight: 850;
    margin: 0;
}

.results-title-group > i {
    color: #1d5f9e;
}

.violation-tab-count.is-neutral {
    background: #e4f1fb;
    color: #1d5f9e;
}

.results-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-left: auto;
}

.results-actions .data-hub-search {
    flex: 0 1 17rem;
}

/* --- Results grid --- */
.client-table {
    border-collapse: collapse;
    min-width: 1180px;
    width: 100%;
}

.client-search-page .data-table th,
.client-search-page .data-table td {
    border-bottom: 1px solid #e5eaf0;
}

.client-search-page .data-table th:not(:last-child),
.client-search-page .data-table td:not(:last-child) {
    border-right: 1px solid #e5eaf0;
}

.client-search-page .data-table thead th {
    background: #f7fafc;
    border-top: 1px solid #e5eaf0;
    padding: 0;
}

.client-search-page .data-table th .sort-header {
    color: #475569;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: 0;
    padding: .5rem .6rem;
    text-transform: none;
    white-space: nowrap;
}

.client-search-page .data-table td {
    color: #334155;
    font-size: .8rem;
    font-weight: 400;
    padding: .55rem .6rem;
    vertical-align: top;
}

.client-search-page .cell-strong {
    color: #0f2f52;
    font-weight: 800;
}

.provider-cell {
    display: table-cell;
    max-width: 14rem;
}

.provider-name {
    color: #1d5f9e;
    display: block;
    font-weight: 600;
}

.provider-tax-id {
    color: #64748b;
    display: block;
    font-size: .74rem;
}

.masked-cell {
    font-size: .76rem;
    white-space: nowrap;
}

.competency-cell {
    color: #b45309;
    max-width: 15rem;
}

/* Page-size selector sits with the pager controls. */
.page-size-select {
    align-items: center;
    display: flex;
    margin-right: .4rem;
    position: relative;
}

.page-size-select select {
    appearance: none;
    background: #fff;
    border: 1px solid #cdd8e5;
    border-radius: 6px;
    color: #31455f;
    font-size: .8rem;
    font-weight: 700;
    min-height: 2rem;
    padding: 0 1.75rem 0 .6rem;
}

.page-size-select i {
    color: #64748b;
    font-size: .68rem;
    pointer-events: none;
    position: absolute;
    right: .6rem;
}

@media (max-width: 1200px) {
    .criteria-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .criteria-wide {
        grid-column: span 2;
    }
}

@media (max-width: 700px) {
    .criteria-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .criteria-wide {
        grid-column: span 1;
    }
}

/* Client Search: Clear and Search Clients live in the criteria grid now, so
   they occupy the free columns beside Source Record Identifier instead of
   forming a row of their own. */
.criteria-grid > .criteria-actions {
    align-items: end;
    align-self: end;
    display: flex;
    gap: .6rem;
    grid-column: 3 / -1;
    justify-content: flex-end;
    padding: 0;
}

.criteria-grid {
    padding-bottom: 1.1rem;
}

/* Results toolbar stays on one line: the heading on the left, the search box,
   export and refresh pinned right. Only the search box gives up width. */
.results-toolbar {
    flex-wrap: nowrap;
}

.results-actions {
    flex-wrap: nowrap;
    min-width: 0;
}

.results-actions .data-hub-search {
    flex: 0 1 16rem;
    min-width: 9rem;
}

.results-actions .data-hub-command {
    flex: 0 0 auto;
}

.results-title-group {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    /* At two columns the buttons need the whole final row to themselves. */
    .criteria-grid > .criteria-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .results-toolbar,
    .results-actions {
        flex-wrap: wrap;
    }
}

/* ---------------------------------------------------------------------------
   Administration
   --------------------------------------------------------------------------- */

/* Grid ruled on both axes, matching the File Details violation grid. Scoped to
   the page rather than to one tab so the Submitting Entities and Users grids do
   not end up with different rules on the same screen. */
.administration-page .data-table {
    border: 1px solid #dce6f0;
    border-collapse: collapse;
    width: 100%;
}

.administration-page .data-table th,
.administration-page .data-table td {
    border: 1px solid #dce6f0;
}

.administration-page .data-table th {
    background: #f6f9fc;
}

/* Both View Details dialogs were modal-xl: 1360px wide and nearly full height,
   so each covered the page behind it. Sized to match the Add New User dialog so
   every popup on this page agrees. */
.compact-detail-dialog {
    max-width: min(760px, 94vw);
}

.compact-detail-dialog .rtts-modal-card {
    max-height: 82vh;
}

.compact-detail-dialog .rtts-modal-header h2 {
    font-size: 1.15rem;
}

/* --- View Details dialog: fit the content, no scrollbars ---

   The horizontal scrollbar came from the email addresses. An address is one
   unbreakable token, and every container here is a CSS grid whose items default
   to min-width: auto -- so a single long address pushed the track, the card and
   then the dialog wider than the viewport rather than wrapping. Releasing the
   min-width and letting the value break fixes the overflow at its source;
   shrinking the type is what then keeps the whole dialog inside one screen. */
.compact-detail-dialog .rtts-modal-body,
.compact-detail-dialog .project-card-grid,
.compact-detail-dialog .project-card,
.compact-detail-dialog .project-card-header div,
.compact-detail-dialog .project-card-meta > div {
    min-width: 0;
}

.compact-detail-dialog .entity-detail-grid dd,
.compact-detail-dialog .project-card-meta dd {
    overflow-wrap: anywhere;
}

/* Values read as data, not as headings: lighter and a step smaller. */
.compact-detail-dialog .entity-detail-grid dt,
.compact-detail-dialog .project-card-meta dt {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.compact-detail-dialog .entity-detail-grid dd,
.compact-detail-dialog .project-card-meta dd {
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.35;
}

.compact-detail-dialog .project-card-header strong {
    font-size: .88rem;
    font-weight: 600;
}

.compact-detail-dialog .project-card-header span:not(.status-pill) {
    font-size: .76rem;
}

/* Spacing trimmed so two contacts and the address block clear the fold. */
.compact-detail-dialog .rtts-modal-body {
    gap: .7rem;
    padding: .9rem 1.1rem 1rem;
}

.compact-detail-dialog .entity-detail-grid {
    gap: .7rem;
}

.compact-detail-dialog .entity-detail-grid div {
    padding: .55rem .7rem;
}

.compact-detail-dialog .contacts-heading {
    font-size: .8rem;
    margin: .9rem 0 .25rem;
    padding-bottom: .45rem;
}

.compact-detail-dialog .project-card-grid {
    gap: .7rem;
    padding: .25rem 0 0;
}

.compact-detail-dialog .project-card {
    gap: .6rem;
    padding: .7rem .8rem;
}

.compact-detail-dialog .project-card-meta {
    gap: .5rem .7rem;
}

.compact-detail-dialog .project-card-meta div {
    padding-top: .4rem;
}

/* A managing entity the user is no longer active on. This is what an
   administrator opens the dialog to find, so it is called out in red rather
   than greyed down. The selectors carry four classes because
   .project-card-header strong and .project-card-meta dd set their own colours
   in site.css -- a lighter selector here would lose to them. */
.rtts-modal-card .contact-card.is-revoked {
    background: linear-gradient(135deg, #fbe0e0 0%, #fdf2f2 42%, #fff 100%);
    border-color: #f0c8c8;
    border-left-color: #dc2626;
}

.rtts-modal-card .contact-card.is-revoked .project-card-header strong,
.rtts-modal-card .contact-card.is-revoked .project-card-header span:not(.status-pill),
.rtts-modal-card .contact-card.is-revoked .project-card-meta dt,
.rtts-modal-card .contact-card.is-revoked .project-card-meta dd {
    color: #b42323;
}

.rtts-modal-card .contact-card.is-revoked .project-card-meta div {
    border-top-color: #f0c8c8;
}

/* --- User form: Role section ---

   Single-select: [auth].[usp_UpsertApplicationUserRole] keeps at most one
   user_role row per user and application. The selected row is filled rather
   than merely radio-checked, because the description text makes a bare radio
   easy to miss. */
.role-checklist {
    border: 1px solid #dce6f0;
    border-radius: 8px;
    display: grid;
    gap: .35rem;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    margin: 0;
    padding: .55rem;
}

.role-checklist[disabled] {
    opacity: .6;
}

.role-checklist-item {
    align-items: flex-start;
    border: 1px solid transparent;
    border-radius: 6px;
    display: flex;
    gap: .5rem;
    margin: 0;
    padding: .3rem .4rem;
}

.role-checklist-item span {
    display: grid;
    gap: .1rem;
    min-width: 0;
    text-transform: none;
}

.role-checklist-item strong {
    color: #52657d;
    font-size: .82rem;
    font-weight: 600;
}

.role-checklist-item em {
    color: #7d8ea3;
    font-size: .72rem;
    font-style: normal;
}

.role-checklist-item.is-assigned {
    background: #eaf3fb;
    border-color: #b7d5ef;
}

.role-checklist-item:hover {
    background: #f4f8fc;
}

.role-checklist-item.is-assigned strong {
    color: #10416b;
    font-weight: 800;
}

.role-checklist-item.is-assigned em {
    color: #3c6389;
}

.role-note {
    align-items: flex-start;
    color: #60758e;
    display: flex;
    font-size: .76rem;
    gap: .4rem;
    margin: .45rem 0 0;
}

/* Role cell placeholder while the second-database lookup is in flight. */
.role-cell-loading {
    color: #9aa9bb;
    font-size: .78rem;
}

/* ---------------------------------------------------------------------------
   Job Performance
   --------------------------------------------------------------------------- */
.job-criteria-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.job-criteria-grid .criteria-actions {
    align-items: flex-end;
    display: flex;
}

/* --- Tab strip. Four of the five tabs are disabled shells. --- */
.job-tab-strip {
    background: #fff;
    border: 1px solid #e1ebf4;
    border-radius: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: var(--feature-tab-gap);
    padding: .35rem;
}

.job-tab {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 7px;
    color: #52657d;
    display: inline-flex;
    font-size: var(--feature-tab-font-size);
    font-weight: var(--feature-tab-font-weight);
    line-height: 1.5;
    min-height: var(--feature-tab-min-height);
    gap: .4rem;
    padding: var(--feature-tab-padding-block) var(--feature-tab-padding-inline);
}

.job-tab:hover:not(:disabled) {
    background: #f2f7fc;
}

.job-tab.is-active {
    background: var(--feature-tab-selected-background);
    color: var(--feature-tab-selected-color);
}

.job-tab:disabled {
    color: #9aa9bb;
    cursor: not-allowed;
}

/* --- Context bar --- */
.job-context-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: space-between;
    padding: .65rem .9rem;
}

.job-context-entity {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    min-width: 0;
}

.job-context-label {
    align-items: center;
    color: #52657d;
    display: inline-flex;
    font-size: .68rem;
    font-weight: 700;
    gap: .35rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.job-context-entity strong {
    color: #10416b;
    font-size: .92rem;
}

.job-context-range {
    align-items: center;
    background: #f2f7fc;
    border-radius: 999px;
    color: #10416b;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 600;
    gap: .4rem;
    padding: .25rem .7rem;
    white-space: nowrap;
}

/* --- Metric cards --- */
.job-metric-row {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.job-metric-card {
    align-items: center;
    display: flex;
    gap: .7rem;
    padding: .8rem .9rem;
}

.job-metric-icon {
    align-items: center;
    border-radius: .5rem;
    display: inline-flex;
    flex: 0 0 auto;
    height: 2.1rem;
    justify-content: center;
    width: 2.1rem;
}

.job-metric-icon.tone-blue  { background: #e0edfb; color: #1d6fb8; }
.job-metric-icon.tone-green { background: #dcf3e6; color: #0f9d58; }
.job-metric-icon.tone-red   { background: #fee2e2; color: #dc2626; }
.job-metric-icon.tone-gold  { background: #fdf0d5; color: #d97706; }

.job-metric-body {
    display: grid;
    flex: 1 1 auto;
    gap: .1rem;
    min-width: 0;
}

.job-metric-body span {
    color: #52657d;
    font-size: .72rem;
    font-weight: 600;
}

.job-metric-body strong {
    color: #0f1f3d;
    font-size: 1.35rem;
    line-height: 1.1;
    /* Seven-digit totals must wrap rather than push the card. */
    overflow-wrap: anywhere;
}

.job-performance-page .count-success-text { color: #0f9d58; }
.job-performance-page .count-error-text   { color: #dc2626; }
.job-performance-page .count-warning-text { color: #d97706; }

/* --- Chart cards --- */
.job-chart-row {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.job-chart-card {
    min-width: 0;
    padding: .85rem .95rem 1rem;
}

.job-chart-header {
    align-items: flex-start;
    display: flex;
    gap: .6rem;
    margin-bottom: .7rem;
}

.job-chart-header h2 {
    font-size: .95rem;
    font-weight: 600;
    margin: 0;
}

.job-chart-header p {
    color: #7d8ea3;
    font-size: .74rem;
    margin: .1rem 0 0;
}

.job-chart-header .tone-blue   { color: #1d6fb8; }
.job-chart-header .tone-red    { color: #dc2626; }
.job-chart-header .tone-purple { color: #7c3aed; }

.job-total-errors {
    color: #dc2626;
    font-size: 1.05rem;
    font-weight: 800;
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
}

.job-total-errors small {
    color: #7d8ea3;
    display: block;
    font-size: .68rem;
    font-weight: 600;
}

.job-chart-canvas {
    min-height: 160px;
    position: relative;
}

.job-trend-canvas {
    height: 260px;
}

/* Donut and its legend. The legend is rendered by Blazor rather than Chart.js
   so it can carry the app's own number formatting. */
.job-donut-layout {
    align-items: center;
    display: grid;
    gap: .9rem;
    grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
}

.job-donut-canvas {
    height: 190px;
    position: relative;
}

.job-donut-legend {
    display: grid;
    gap: .3rem;
    list-style: none;
    margin: 0;
    min-width: 0;
    padding: 0;
}

.job-donut-legend li {
    align-items: center;
    display: flex;
    gap: .5rem;
    min-width: 0;
}

.job-legend-swatch {
    border-radius: 3px;
    flex: 0 0 auto;
    height: .7rem;
    width: .7rem;
}

.job-legend-label {
    color: #334155;
    flex: 1 1 auto;
    font-size: .78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-legend-value {
    color: #0f1f3d;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .job-chart-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .job-donut-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Criteria on one line: dates take only the width a date needs, the three
   dropdowns share what is left, and Run Report sits with them rather than
   wrapping to a row of its own. */
.job-criteria-grid {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
}

.job-criteria-grid .criteria-field {
    flex: 1 1 170px;
    min-width: 0;
}

.job-criteria-grid .criteria-field.is-date {
    flex: 0 0 8.5rem;
}

.job-criteria-grid .criteria-field.is-date input {
    width: 100%;
}

.job-criteria-grid .criteria-actions {
    flex: 0 0 auto;
    margin-left: auto;
}

.job-context-acronym {
    background: #e4f1fb;
    border-radius: 999px;
    color: #10416b;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .03em;
    padding: .15rem .55rem;
}

@media (max-width: 900px) {
    .job-criteria-grid .criteria-actions {
        margin-left: 0;
        width: 100%;
    }
}

/* The context bar names the entity directly; the "Submitting Entity" label that
   preceded it only repeated the criteria field above. */
.job-context-icon {
    color: #1d6fb8;
}
/* ---------------------------------------------------------------------------
   Dashboard: top providers by client volume

   One read supplies the displayed provider volumes and an independent unique
   person identifier total across all associated providers.
   --------------------------------------------------------------------------- */
.provider-metric-row {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.provider-metric-card {
    align-items: center;
    display: flex;
    gap: .75rem;
    padding: .85rem .95rem;
}

.provider-metric-icon {
    align-items: center;
    border-radius: .6rem;
    display: inline-flex;
    flex: 0 0 auto;
    height: 2.3rem;
    justify-content: center;
    width: 2.3rem;
}

.provider-metric-icon.tone-blue  { background: #e0edfb; color: #1d6fb8; }
.provider-metric-icon.tone-sky   { background: #e4f1fb; color: #0891b2; }
.provider-metric-icon.tone-gold  { background: #fdf0d5; color: #d97706; }
.provider-metric-icon.tone-green { background: #dcf3e6; color: #0f9d58; }

.provider-metric-card div {
    display: grid;
    gap: .1rem;
    min-width: 0;
}

.provider-metric-card span {
    color: #1d6fb8;
    font-size: .78rem;
    font-weight: 600;
}

.provider-metric-card strong {
    color: #0f1f3d;
    font-size: 1.6rem;
    line-height: 1.1;
}

.provider-metric-card strong.provider-metric-unavailable {
    font-size: 1rem;
}

.provider-metric-card small,
.provider-metric-definition {
    color: #52667c;
    font-size: .75rem;
}

.provider-metric-definition {
    margin: -.2rem 0 0;
}

.dashboard-page .tone-orange-text { color: #ea580c; }
.dashboard-page .tone-green-text  { color: #0f9d58; }

.provider-content-row {
    display: grid;
    gap: .75rem;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
}

.provider-card-header {
    align-items: flex-start;
    display: flex;
    gap: .6rem;
    margin-bottom: .8rem;
}

.provider-card-header h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.provider-card-header p {
    color: #7d8ea3;
    font-size: .76rem;
    margin: .1rem 0 0;
}

.provider-card-header .tone-blue { color: #1d6fb8; }

.provider-rank-card,
.provider-snapshot-card {
    min-width: 0;
    padding: .9rem 1rem 1rem;
}

/* --- Ranked list --- */
.provider-rank-list {
    display: grid;
    gap: .3rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* A button, not a div: the row selects the provider shown in the snapshot, so
   it has to be reachable and operable from the keyboard. */
.provider-rank-row {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    display: flex;
    gap: .6rem;
    padding: .3rem .4rem;
    text-align: left;
    width: 100%;
}

.provider-rank-row:hover {
    background: #f6fafd;
}

.provider-rank-row.is-selected {
    background: #eef6fd;
    border-color: #b7d5ef;
}

.provider-rank-number {
    color: #94a3b8;
    flex: 0 0 1.1rem;
    font-size: .78rem;
    text-align: right;
}

.provider-rank-label {
    color: #10416b;
    flex: 0 0 8.5rem;
    font-size: .82rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.provider-rank-track {
    background: #eef2f7;
    border-radius: 4px;
    flex: 1 1 auto;
    height: 1.15rem;
    min-width: 0;
    overflow: hidden;
}

.provider-rank-fill {
    background: #1d6fb8;
    border-radius: 4px;
    display: block;
    height: 100%;
}

/* The leader is called out, matching the requested design. */
.provider-rank-fill.is-leader {
    background: #f59e0b;
}

.provider-rank-value {
    color: #0f1f3d;
    flex: 0 0 4rem;
    font-size: .82rem;
    font-weight: 700;
    text-align: right;
}

/* --- Snapshot --- */
.provider-snapshot-top {
    align-items: center;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
}

.provider-snapshot-identity {
    display: grid;
    gap: .15rem;
    min-width: 0;
}

.provider-snapshot-identity strong {
    color: #10416b;
    font-size: 1.15rem;
    overflow-wrap: anywhere;
}

.provider-snapshot-identity span {
    color: #1d6fb8;
    font-size: .95rem;
}

.provider-snapshot-identity b {
    font-size: 1.3rem;
    font-weight: 800;
}

.provider-snapshot-identity small {
    color: #7d8ea3;
    font-size: .72rem;
}

.provider-gauge {
    flex: 0 0 auto;
    text-align: center;
    width: 8.75rem;
}

.provider-gauge svg {
    display: block;
    width: 100%;
}

.provider-gauge-track,
.provider-gauge-fill {
    fill: none;
    stroke-linecap: round;
    stroke-width: 13;
}

.provider-gauge-track {
    stroke: #e3ebf3;
}

/* 157.08 is the arc length, pi * r with r = 50. The dash covers the whole arc
   and the offset uncovers the filled portion, so the markup sets one number. */
.provider-gauge-fill {
    stroke: #10416b;
    stroke-dasharray: 157.08;
    transition: stroke-dashoffset .3s ease;
}

.provider-gauge-caption {
    margin-top: -1.6rem;
}

.provider-gauge-caption strong {
    color: #10416b;
    display: block;
    font-size: 1.35rem;
    line-height: 1.1;
}

.provider-gauge-caption span {
    color: #7d8ea3;
    font-size: .66rem;
}

.provider-snapshot-stats {
    display: grid;
    gap: .45rem;
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}

.provider-snapshot-stats li {
    align-items: center;
    background: #f5fafe;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: .5rem .6rem;
}

.provider-stat-icon {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .7rem;
    height: 1.55rem;
    justify-content: center;
    width: 1.55rem;
}

.provider-stat-icon.tone-sky   { background: #d7ecf8; color: #0891b2; }
.provider-stat-icon.tone-green { background: #d8f0e2; color: #0f9d58; }

.provider-stat-label {
    color: #52657d;
    font-size: .78rem;
}

.provider-snapshot-stats strong {
    color: #0f1f3d;
    font-size: 1.05rem;
    margin-left: auto;
}

.provider-stat-suffix {
    color: #7d8ea3;
    font-size: .72rem;
}

@media (max-width: 1100px) {
    .provider-content-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 620px) {
    .provider-rank-label {
        flex-basis: 6rem;
    }
}


/* --- Data Hub summary row --- */

/* Job-level counts sit under the record totals they qualify: "how many FILES
   were affected", a different question from "how many records". */
.data-hub-page .summary-metric small {
    color: #7d8ea3;
    display: block;
    font-size: .66rem;
    margin-top: .1rem;
}

.data-hub-page .summary-metric .metric-icon.is-success {
    background: #0f9d58;
    border-radius: 50%;
    color: #fff;
}

.data-hub-page .count-success-text {
    color: #0f9d58;
}

.data-hub-page .data-table td.count-success {
    color: #0f9d58;
}

/* Five numeric columns now; right-aligned so they compare down the column. */
.data-hub-page .data-table td.num-cell {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

/* --- File Details summary: three metrics --- */
.file-details-page .file-summary-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.file-details-page .file-summary-metrics > div {
    min-width: 0;
}

.file-details-page .file-summary-metrics .metric-icon.is-success {
    background: #0f9d58;
    border-radius: 50%;
    color: #fff;
}

/* Replaces .count-processed-text: the metric is Accepted now, and the old
   name described a label that no longer exists. */
.file-details-page .file-summary-metrics strong.count-accepted-text {
    color: #0f9d58;
}

@media (max-width: 760px) {
    .file-details-page .file-summary-metrics {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Acceptance rate sits with the accepted-vs-rejected chart's heading, the way
   the total-errors figure does on the errors chart. */
.job-accept-rate {
    color: #0f9d58;
    font-size: 1.05rem;
    font-weight: 800;
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
}

.job-accept-rate small {
    color: #7d8ea3;
    display: block;
    font-size: .68rem;
    font-weight: 600;
}

.job-chart-header .tone-green { color: #0f9d58; }

/* Match Data Hub's input-group search presentation across Administration tabs. */
.administration-page .administration-search-group {
    width: 20rem;
    max-width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
}

.administration-page .administration-search-group .input-group-text {
    flex-shrink: 0;
    padding: .25rem .4rem;
    font-size: .75rem;
    background: #f4f8fb;
    color: #48647c;
    border-color: #c6dae9;
}

.administration-page .administration-search-group .form-control {
    min-width: 0;
    padding: .35rem .4rem;
    font-size: .875rem;
    border-color: #c6dae9;
}
