﻿/* =======================================================================
   BASE / BOILERPLATE
   ======================================================================= */
@import url('app.css');
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}


/* =======================================================================
   DESIGN TOKENS + APP CHROME BASE
   ======================================================================= */

:root {
    /* layout */
    --topbar-h: 56px;
    --page-pad: 16px;
    /* colors */
    --app-bg: #f7f8fb;
    --card-bg: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    /* CRC sizing */
    --crc-cell-w: 38px;
    --crc-crit-w: clamp(320px, 50vw, 720px);
    /* child records viewport hint (tune once if needed) */
    --fv-header-hint: 52px;
    /* Typography tokens */
    --title-size: 1.2rem;
    --title-weight: 700;
    --subtitle-size: 0.95rem;
    --subtitle-weight: 500;
}

/* App owns scrolling; avoid double-scroll */
html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--app-bg);
    color: var(--text);
}

html {
    overflow: hidden;
}

body {
    overflow: hidden;
}


/* =======================================================================
   FIX: Default Blazor layout (sidebar + main) flex overflow behavior
   - Ensures main content can shrink, so inner scroll containers can scroll
   ======================================================================= */

/* If your tab content is inside a flex row/column, this helps too */
.tab-pane,
.child-records-pane {
    min-width: 0;
}


/* =======================================================================
   TABS / UI
   ======================================================================= */
.active-tab {
    font-weight: bold;
    background-color: #d7e7fb;
    border-bottom: 2px solid #2563eb;
}

.tabs button {
    border: 1px solid var(--tab-border, #ccc);
}

.tabs .active-tab {
    background: var(--tab-accent, #666);
    color: var(--tab-contrast, #fff);
    border: 1px solid var(--tab-border, #333);
    box-shadow: 0 0 0 1px var(--tab-border, #333);
}

.tabs button:hover {
    border-color: var(--tab-border);
    box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--tab-accent) 12%, transparent);
}

.tabs button:focus-visible {
    outline: 2px solid var(--tab-border);
    outline-offset: 2px;
}

.tab-heading {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 6px 0 10px;
    padding-top: 6px;
}

.tab-heading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(520px, 90%);
    border-top: 1px solid var(--border);
    opacity: 0.7;
}

.tab-heading__title {
    margin: 0;
    font-size: var(--title-size);
    font-weight: var(--title-weight);
    line-height: 1.2;
    text-align: center;
    color: var(--text);
}

.tab-pane.is-hidden {
    display: none;
}

.tab-pane.is-active {
    display: block;
}

.page-title {
    margin: 0;
    font-size: var(--title-size);
    font-weight: var(--title-weight);
    line-height: 1.2;
}

.page-subtitle {
    margin-top: 2px;
    font-size: var(--subtitle-size);
    font-weight: var(--subtitle-weight);
    color: var(--muted);
    line-height: 1.2;
}

/* Demographics Tab */
.demo-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.demo-workspace {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.demo-grid {
    display: grid;
    gap: 1rem;
}

.demo-grid--legacy-layout {
    grid-template-columns: 1fr 1fr 0.95fr;
    align-items: stretch;
}

.demo-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.demo-child-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-height: 0;
}

.demo-section {
    border: 1px solid var(--bs-border-color, #d0d7de);
    border-radius: 0.375rem;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.demo-section__header {
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    border-bottom: 1px solid var(--bs-border-color, #d0d7de);
    background: #f8f9fa;
}

.demo-section__body {
    padding: 0.75rem;
}

.demo-field {
    display: grid;
    grid-template-columns: 11.5rem 1fr;
    gap: 0.75rem;
    align-items: start;
    margin-bottom: 0.55rem;
}

    .demo-field:last-child {
        margin-bottom: 0;
    }

.demo-label {
    font-size: 0.875rem;
    font-weight: 500;
    padding-top: 0.35rem;
    margin-bottom: 0;
    line-height: 1.25;
}

.demo-label-sm {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
    display: block;
    line-height: 1.25;
}

.demo-control {
    min-width: 0;
}

.demo-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem 0.75rem;
    margin-top: 0.75rem;
}

.demo-pair {
    min-width: 0;
}

.demo-inline-2,
.demo-inline-3 {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.demo-inline-2 {
    grid-template-columns: 1fr 1fr;
}

.demo-inline-3 {
    grid-template-columns: 2fr 0.8fr 1fr;
}

.demo-dates-block + .demo-dates-block {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bs-border-color, #d0d7de);
}

.demo-dates-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    line-height: 1.2;
}

.demo-section .form-control.form-control-sm,
.demo-section .form-select.form-select-sm,
.demo-child-manager .form-control.form-control-sm,
.demo-child-manager .form-select.form-select-sm {
    min-height: 2rem;
    font-size: 0.875rem;
}

.demo-section .validation-message,
.demo-section .validation-errors,
.demo-workspace .validation-message,
.demo-workspace .validation-errors {
    font-size: 0.78rem;
}

.demo-child-manager {
    border: 1px solid var(--bs-border-color, #d0d7de);
    border-radius: 0.375rem;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    max-height: 100%;
}

.demo-child-manager__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--bs-border-color, #d0d7de);
    background: #f8f9fa;
    flex: 0 0 auto;
}

.demo-child-manager__title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    margin: 0;
}

.demo-child-manager__count {
    font-size: 0.78rem;
    color: #6c757d;
    white-space: nowrap;
}

.demo-child-manager__body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.sample-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex: 0 0 auto;
}

    .sample-tabs button {
        border: 1px solid var(--bs-border-color, #d0d7de);
        background: #fff;
        color: inherit;
        padding: 0.3rem 0.65rem;
        font-size: 0.82rem;
        line-height: 1.2;
        border-radius: 0.3rem;
    }

        .sample-tabs button.active-tab {
            border-color: var(--bs-primary, #0d6efd);
            background: rgba(13, 110, 253, 0.08);
            color: var(--bs-primary, #0d6efd);
            font-weight: 600;
        }

.demo-child-manager__layout {
    display: grid;
    grid-template-columns: 13rem 1fr;
    gap: 0.75rem;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.demo-child-actions {
    border: 1px solid var(--bs-border-color, #d0d7de);
    border-radius: 0.3rem;
    background: #fcfcfd;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    align-self: stretch;
}

.demo-child-actions__title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.55rem;
    line-height: 1.2;
}

.demo-child-actions__status {
    font-size: 0.78rem;
    margin-top: 0.45rem;
    line-height: 1.25;
}

    .demo-child-actions__status.text-danger {
        color: #b42318 !important;
    }

.demo-child-list {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.child-id-table td:first-child {
    white-space: nowrap;
}

.child-lock-toggle,
.child-lock-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    min-width: 1.25rem;
    height: 1.25rem;
    vertical-align: middle;
}

.child-lock-toggle {
    text-decoration: none;
    line-height: 1;
}

    .child-lock-toggle:hover,
    .child-lock-toggle:focus {
        text-decoration: none;
    }

    .child-lock-toggle:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: 2px;
        border-radius: 0.25rem;
    }

    .child-lock-toggle[disabled] {
        opacity: 0.6;
        pointer-events: none;
    }

.child-lock-status {
    line-height: 1;
}

.child-id-value {
    vertical-align: middle;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.child-lock-toggle,
.child-lock-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    min-width: 1.35rem;
    height: 1.35rem;
    vertical-align: middle;
}

.child-lock-toggle {
    text-decoration: none;
    line-height: 1;
}

    .child-lock-toggle:hover,
    .child-lock-toggle:focus {
        text-decoration: none;
    }

    .child-lock-toggle:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: 2px;
        border-radius: 0.25rem;
    }

    .child-lock-toggle[disabled] {
        opacity: 0.6;
        pointer-events: none;
    }

.child-lock-icon {
    position: relative;
    display: inline-block;
    width: 0.85rem;
    height: 0.9rem;
    color: currentColor;
}

    /* Lock body */
    .child-lock-icon::after {
        content: "";
        position: absolute;
        left: 0.12rem;
        right: 0.12rem;
        bottom: 0;
        height: 0.48rem;
        border: 2px solid currentColor;
        border-radius: 0.12rem;
        box-sizing: border-box;
    }

    /* Shackle base */
    .child-lock-icon::before {
        content: "";
        position: absolute;
        width: 0.42rem;
        height: 0.42rem;
        border: 2px solid currentColor;
        border-bottom: 0;
        border-radius: 0.42rem 0.42rem 0 0;
        box-sizing: border-box;
    }

/* Closed shackle */
.child-lock-icon--locked::before {
    left: 0.215rem;
    top: 0;
}

/* Open shackle, shifted and rotated */
.child-lock-icon--unlocked::before {
    left: 0.38rem;
    top: 0.02rem;
    transform: rotate(28deg);
    transform-origin: left bottom;
}

.child-lock-icon--unlocked::after {
    border-top-style: dashed;
}

.child-lock-icon--unlocked {
    opacity: 0.75;
}

.child-id-value {
    vertical-align: middle;
}

.child-id-table-wrap {
    border: 1px solid var(--bs-border-color, #d0d7de);
    border-radius: 0.25rem;
    background: #fff;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: auto;
}

.child-id-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

    .child-id-table thead th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: #f8f9fa;
        border-bottom: 1px solid var(--bs-border-color, #d0d7de);
        text-align: left;
        font-weight: 600;
        padding: 0.45rem 0.6rem;
        white-space: nowrap;
    }

    .child-id-table tbody td {
        padding: 0.45rem 0.6rem;
        border-bottom: 1px solid #eef1f4;
        vertical-align: top;
    }

    .child-id-table tbody tr {
        cursor: pointer;
    }

        .child-id-table tbody tr:hover {
            background: #f8fafc;
        }

        .child-id-table tbody tr.is-selected {
            background: rgba(13, 110, 253, 0.08);
        }

            .child-id-table tbody tr.is-selected td {
                box-shadow: inset 0 1px 0 rgba(13, 110, 253, 0.18), inset 0 -1px 0 rgba(13, 110, 253, 0.18);
            }

                .child-id-table tbody tr.is-selected td:first-child {
                    font-weight: 600;
                }

.import-section-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.2;
    color: #344054;
    margin-bottom: 0.55rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--bs-border-color, #d0d7de);
}

.import-section-meta {
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
}

@media (max-width: 1300px) {
    .demo-grid--legacy-layout {
        grid-template-columns: 1fr 1fr;
    }

    .demo-child-column {
        grid-column: 1 / -1;
    }

    .demo-child-manager__layout {
        grid-template-columns: 14rem 1fr;
    }
}

@media (max-width: 992px) {
    .demo-grid--legacy-layout {
        grid-template-columns: 1fr;
    }

    .demo-field {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .demo-inline-2,
    .demo-inline-3,
    .demo-subgrid,
    .demo-child-manager__layout {
        grid-template-columns: 1fr;
    }

    .demo-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .demo-toolbar__actions {
        display: flex;
        justify-content: flex-start;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
}


/* =======================================================================
   PANELS / VIEWPORT LOCK FOR CHILD RECORDS
   ======================================================================= */

/* CR panel fills remaining viewport inside the scroller */
.cr-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: calc(100vh - var(--topbar-h) - (2 * var(--page-pad)) - var(--fv-header-hint));
}

.cr-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    padding-top: 0.25rem;
}

/* Only applies when Child Records tab is active */
.cr-tab-viewport {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    height: calc(100vh - var(--topbar-h) - (2 * var(--page-pad)) - var(--fv-header-hint));
}

/* Child Records tab: remove extra bottom spacing */
.tab-pane.child-records-pane {
    padding-bottom: 0;
    margin-bottom: 0;
    --fv-header-hint: 185px;
}

/* =======================================================================
   GRID LEGEND FOOTER (pinned to bottom of grid region)
   ======================================================================= */
.grid-legend-footer {
    flex: 0 0 auto;
    background: #fff;
    border-top: 1px solid #e3e3e3;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    z-index: 5;
}

.corner-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .5rem;
}

.legend-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.legend-score {
    display: flex;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.crc-score-pill {
    display: inline-flex;
    align-items: baseline;
    padding: .18rem .55rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    font-weight: 700;
    white-space: nowrap;
}

.cr-panel .crc-score-pill,
.child-records-pane .crc-score-pill {
    color: #0f172a; /* dark slate */
}

/* =========================
   CRC GRID (single table)
   ========================= */

/* The Child Records viewport should constrain the grid area */
.child-records-pane .cr-tab-viewport {
    min-height: 0;
    min-width: 0; /* IMPORTANT in flex layouts */
    overflow: hidden; /* keep scrolling inside the grid */
}

/* GridComponent internal layout: legend pinned at bottom */
.grid-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    min-width: 0; /* IMPORTANT: allow inner scroller to size properperly */
}

/* THIS must be the scroll container */
.grid-scroll {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0; /* IMPORTANT: allows horizontal overflow to become a scrollbar */
    max-width: 100%;
    max-height: 100%;
    overflow: auto; /* both axes */
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Table sizes to its column sum; .grid-scroll decides when to scroll */
.grid-table {
    border-collapse: collapse;
    table-layout: fixed; /* honor colgroup widths */
    width: max-content; /* sum of columns -> enables horizontal overflow */
    min-width: max-content; /* do NOT stretch to container width */
}

    /* Column widths via colgroup */
    .grid-table col.crc-col {
        width: var(--crc-crit-w);
    }

    .grid-table col.child-col {
        width: var(--crc-cell-w);
    }

    /* Cell base styling */
    .grid-table th,
    .grid-table td {
        padding: 0;
        margin: 0;
        border: 1.5px solid #c0c0c0;
        text-align: center;
        vertical-align: middle;
    }

    /* Ensure sticky layers render in the right order */
    .grid-table thead th.sticky-head {
        z-index: 20; /* header row */
    }

    /* Sticky header row */
    .grid-table thead th {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 20;
        vertical-align: bottom;
    }

        /* Keep child columns fixed (belt + suspenders) */
        .grid-table thead th[data-col],
        .grid-table tbody td[data-col] {
            width: var(--crc-cell-w);
            min-width: var(--crc-cell-w);
            max-width: var(--crc-cell-w);
        }

    /* Criterion cell wraps; no inner scrollbar */
    .grid-table th.criteria {
        text-align: left;
        padding: 0 4px;
        white-space: normal;
        word-break: break-word;
        overflow: hidden;
    }

    /* Sticky first column + corner */
    .grid-table th.sticky-col {
        position: sticky;
        left: 0;
        background: #fff;
        z-index: 25;
    }

    .grid-table th.sticky-corner {
        position: sticky;
        top: 0;
        left: 0;
        background: #fff;
        z-index: 30;
    }

    /* Button fills td */
    .grid-table td > button.grid-cell {
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
    }

    /* If your highlight classes change background, ensure sticky items still look solid */
    .grid-table th.sticky-col,
    .grid-table th.sticky-head,
    .grid-table th.sticky-corner {
        background: #fff;
        background-clip: padding-box;
    }

/* =========================
   Responsive tuning
   ========================= */

@media (max-width: 1200px) {
    :root {
        --crc-crit-w: clamp(300px, 52vw, 640px);
    }
}

@media (max-width: 992px) {
    :root {
        --crc-crit-w: clamp(280px, 58vw, 560px);
    }
}

@media (max-width: 768px) {
    :root {
        --crc-crit-w: clamp(260px, 70vw, 520px);
        --crc-cell-w: 36px; /* optional */
    }
}

@media (max-width: 576px) {
    :root {
        --crc-crit-w: clamp(240px, 80vw, 480px);
        --crc-cell-w: 34px; /* optional */
    }
}


/* =======================================================================
   GRID CELL VISUALS
   ======================================================================= */
.grid-cell {
    font-size: 1.45em;
    font-weight: bold;
    border-radius: 7px;
    border: 2px solid transparent;
    cursor: pointer;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    position: relative;
}

    .grid-cell:focus {
        outline: none;
        box-shadow: none;
    }

    .grid-cell.has-note {
        border: 2px solid #2196f3 !important;
        border-color: #2196f3;
    }

.cell-state {
    display: inline-block;
    width: 1.25em;
    height: 1.25em;
    line-height: 1.25em;
    text-align: center;
    font-weight: bold;
    font-size: 1.35em;
    border-radius: 4px;
    user-select: none;
    margin: 0;
    padding: 0;
    vertical-align: middle;
}

.meets-green {
    color: #1bb15d;
}

.doesnotmeet-red {
    color: #f44336;
}

.doesnotapply-blue {
    color: #2077d8;
}

.noresponse-empty {
    color: #aaa;
}

.child-header-black {
    color: black;
    font-weight: bold;
}

.child-header-orange {
    color: orange;
    font-weight: bold;
}

/* Screen-reader-only utility */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Restore a clear focus indicator for grid cells (WCAG focus visible) */
.grid-table td > button.grid-cell:focus {
    outline: none; /* keep your current reset */
    box-shadow: none;
}

/* Prefer focus-visible so mouse users don't always see a ring */
.grid-table td > button.grid-cell:focus-visible {
    outline: 3px solid #000;
    outline-offset: -3px; /* keeps ring inside fixed cell bounds */
}

/* If a cell has a note border, keep focus ring dominant */
.grid-table td > button.grid-cell.has-note:focus-visible {
    outline: 3px solid #000;
    outline-offset: -3px;
}

/* =======================================================================
   NOTE MODAL
   ======================================================================= */
.note-indicator {
    cursor: pointer;
    color: blue;
    margin-left: 0.3em;
}

.note-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
}

.note-modal {
    position: fixed;
    top: 50vh;
    left: 50vw;
    transform: translate(-50%,-50%);
    background: white;
    border: 1px solid #aaa;
    padding: 2em;
    z-index: 1001;
    min-width: 280px;
    min-height: 160px;
    box-shadow: 0 0 30px #3334;
    border-radius: 12px;
}

.grid-cell span.filled-red {
    color: #f44336;
    font-size: 1.4em;
    vertical-align: middle;
    display: inline-block;
    width: 1em;
    text-align: center;
}

/* =======================================================================
   HOVER HIGHLIGHTS
   ======================================================================= */
.cell-highlight-row {
    background: #e3f2fd !important;
}

.cell-highlight-col {
    background: #f1f8e9 !important;
}

.cell-highlight-both {
    background: #fffde7 !important;
}

.cell-btn-highlight {
    background: #fffde7 !important;
    box-shadow: 0 0 4px #ffecb3;
}

.cell-btn-row {
    background: #e3f2fd !important;
}

.cell-btn-col {
    background: #f1f8e9 !important;
}

.header-highlight-col {
    background: #e1f5fe !important;
    color: #1976d2 !important;
}

.header-highlight-row {
    background: #e8f5e9 !important;
    color: #388e3c !important;
}

    .header-highlight-col.header-highlight-row,
    .header-highlight-row.header-highlight-col {
        background: #fffde7 !important;
        color: #fbc02d !important;
    }

/* Tooltip */
.custom-tooltip {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.15s;
    position: absolute;
    left: 50%;
    top: -1.8em;
    transform: translateX(-50%);
    background: #444;
    color: #fff;
    padding: 0.18em 0.7em;
    border-radius: 4px;
    z-index: 1200;
    font-size: 0.95em;
    pointer-events: none;
    white-space: pre-line;
    min-width: 90px;
    text-align: center;
    box-shadow: 0 2px 8px #2223;
}

.grid-cell:hover .custom-tooltip {
    visibility: visible;
    opacity: 1;
}

/* =======================================================================
   LEGEND
   ======================================================================= */
.cell-legend {
    display: flex;
    gap: 1.7em;
    align-items: center;
    justify-content: flex-start;
    margin: 0.75rem 0 0.5rem 0;
    padding-top: 0.25rem;
    flex-wrap: wrap;
    font-size: 1.05em;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.3em;
    cursor: pointer;
    padding: 0.18em 0.35em;
    border-radius: 7px;
    border: 2px solid transparent;
    transition: background 0.18s, border 0.18s;
    font-weight: 500;
}

.legend-label {
    font-size: 1em;
    margin-left: 0.18em;
}

.legend-highlight {
    background: #fffde7;
    border: 2px solid #fbc02d;
}

.legend-note {
    border: 2px solid #2196f3;
    padding: 0.19em 0.6em;
    border-radius: 7px;
    background: #e3f2fd22;
    position: relative;
}

.legend-note-border {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    border: 2px solid #2196f3;
    border-radius: 8px;
    background: transparent;
    margin-right: 0.36em;
    vertical-align: middle;
}

.legend-hover,
.legend-item.legend-highlight {
    box-shadow: 0 0 6px #fbc02d66;
    background: #fffde7;
    border-color: #fbc02d !important;
}

    .legend-hover-note,
    .legend-item.legend-highlight.legend-note {
        box-shadow: 0 0 8px #2196f355;
        border-color: #2196f3 !important;
        background: #e3f2fd;
    }

/* =======================================================================
   CHILD ID HEADER
   ======================================================================= */
.child-id-header {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 70px;
    box-sizing: border-box;
}

.child-id-number {
    writing-mode: vertical-rl;
    transform: rotate(-180deg);
    text-align: center;
    font-size: 1em;
    padding-top: 4px;
    padding-bottom: 4px;
    display: inline-block;
    min-height: 1.7em;
    box-sizing: border-box;
}

/* =======================================================================
   NAV / DESCRIPTION
   ======================================================================= */
.nav-row {
    display: flex;
    align-items: center;
    margin: 0.25em 0;
    gap: 0.25em;
}

.desc-row {
    margin: 0 0 1em 2em;
    font-size: 1.06em;
    color: #333;
}

/* =======================================================================
   HIERARCHICAL MENU
   ======================================================================= */
.hier-menu-root {
    display: inline-block;
    position: relative;
}

.hier-menu-trigger {
    min-width: 180px;
    background: #fff;
    font-size: 1.07em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35em;
    justify-content: space-between;
    transition: border-color 0.16s;
}

    .hier-menu-trigger .chevron {
        font-size: 1.15em;
        margin-left: 0.3em;
        color: #888;
    }

.hier-menu-dropdown {
    position: absolute;
    top: 105%;
    left: 0;
    background: #fff;
    min-width: 210px;
    box-shadow: 0 5px 30px #2223;
    border: 1.5px solid #bbb;
    border-radius: 9px;
    z-index: 120;
    padding: 0.25em 0.12em;
    animation: fadeInMenu 0.18s;
}

@keyframes fadeInMenu {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hier-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hier-menu-item {
    padding: 0;
    margin: 0;
    position: relative;
}

.hier-menu-label.parent {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.24em 0.8em 0.24em 0.5em;
    user-select: none;
    font-weight: 500;
    transition: background 0.13s;
}

    .hier-menu-label.parent:hover {
        background: #f2f6fd;
    }

.chevron-right {
    margin-left: auto;
    color: #aaa;
    font-size: 1.15em;
}

.hier-menu-select-btn {
    border: none;
    background: none;
    color: #333;
    width: 100%;
    text-align: left;
    padding: 0.48em 1.6em 0.48em 2.2em;
    font-size: 1.02em;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.13s;
}

    .hier-menu-select-btn:hover {
        background: #e3eefc;
    }

.hier-menu-item.disabled,
.hier-menu-label.disabled {
    color: #ccc !important;
    pointer-events: none;
}

.hier-menu-item ul {
    position: absolute;
    top: 0;
    left: 99%;
    background: #fff;
    min-width: 200px;
    border: 1.5px solid #bbb;
    border-radius: 8px;
    box-shadow: 0 3px 20px #2222;
    padding: 0.2em 0;
    z-index: 130;
    display: none;
}

.hier-menu-item:hover > ul {
    display: block;
}

/* =======================================================================
   EVIDENCE GRID NAV
   ======================================================================= */
.evidence-grid-nav .nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.evidence-grid-nav-label {
    font-weight: 500;
    white-space: nowrap;
}

    .evidence-grid-nav-label .title {
        font-weight: 400;
        color: #666;
    }

/* =======================================================================
   CHILD RESULT MODAL / UI
   ======================================================================= */
.cr-modal-body {
    max-width: 900px;
    min-width: 520px;
}

.cr-modal-header {
    margin-bottom: .6rem;
}

.cr-breadcrumb {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    color: #555;
}

    .cr-breadcrumb .crumb {
        white-space: nowrap;
    }

.cr-title {
    font-size: 1.05rem;
    color: #333;
    margin-top: .25rem;
}

.cr-context {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem 1rem;
    margin: .6rem 0 1.0rem;
}

.cr-field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

    .cr-field.small {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        gap: .6rem;
        flex-direction: row;
    }

.cr-status {
    margin-bottom: .8rem;
}

.cr-radio-row {
    display: flex;
    gap: 1.1rem;
    flex-wrap: wrap;
}

.cr-radio {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .25rem .5rem;
    border-radius: 7px;
}

.cr-notes textarea {
    width: 100%;
}

.crx-footer {
    margin-top: 1.1rem;
    display: flex;
    gap: .6rem;
    justify-content: flex-end;
}

.cr-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
}

    .cr-footer .left {
        display: flex;
        align-items: center;
        gap: .5rem;
    }

    .cr-footer .right {
        display: flex;
        gap: .5rem;
    }

.muted {
    color: #6b7280;
    font-size: .92em;
}

.picker-row {
    display: flex;
    align-items: center;
    gap: .5rem;
}

    .picker-row .form-select {
        min-width: 280px;
    }

.picker-btn {
    border: 1px solid #bbb;
    background: #fff;
    border-radius: 6px;
    padding: .25rem .5rem;
    line-height: 1;
    cursor: pointer;
}

    .picker-btn:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

.cr-modal-body:focus {
    outline: none;
    box-shadow: 0 0 0 2px #88b3e6aa;
    border-radius: 6px;
}

.cr-lock-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 1.5rem;
}

    .cr-lock-status.is-locked {
        font-weight: 600;
    }

    .cr-lock-status.is-unlocked {
        color: inherit;
    }

/* =======================================================================
   SUMMARY / EVIDENCE HEADER
   ======================================================================= */
.summary-scroll:focus-within {
    outline: 2px solid #9ec9ff;
    outline-offset: 2px;
}

.evidence-header {
    margin: 0.5rem 0 0.75rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    background: #fafafa;
}

.eh-indicator {
    font-weight: 600;
    margin-bottom: 0.35rem;
    line-height: 1.25;
}

.eh-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem 1rem;
}

@media (min-width: 720px) {
    .eh-row {
        grid-template-columns: 1fr !important;
    }
}

.eh-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.eh-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.15rem;
}

.eh-text {
    line-height: 1.25;
    word-break: break-word;
    max-height: 12rem;
    overflow: auto;
    border-top: 1px dashed #e3e3e3;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
}

    .eh-text:focus-within {
        outline: 2px solid #9ec9ff;
        outline-offset: 2px;
    }

/* =======================================================================
   VISUAL INDICATORS
   ======================================================================= */
.pill {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.3;
}

.pill-staged {
    background: #fff3cd;
    border: 1px solid #f0ad4e;
    color: #8a6d3b;
}

.dot-staged {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f0ad4e;
    margin-left: .4rem;
    vertical-align: middle;
}

.field-staged {
    box-shadow: inset 0 0 0 2px #f0ad4e66;
    border-radius: 8px;
}

.footer-count {
    margin-left: .4rem;
    font-weight: 600;
}

/* =======================================================================
   FV LIST PAGE / FV DETAIL PAGE
   ======================================================================= */
.list-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 10px;
}

.table-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

/* Optional: slightly calmer header row */
.fv-table thead th {
    font-weight: 700;
    color: #334155;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.fv-page-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.fv-page-top__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.fv-header {
    margin: 2px 0 8px;
}

.fv-header__left {
    min-width: 0;
}

.fv-header__left .page-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 75vw;
}

.fv-header__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
    flex-shrink: 0;
}

/* Header with inline tabs: left | tabs (centered) | right */
.fv-header--tabs {
    display: grid;
    grid-template-columns: 1fr minmax(0, max-content) 1fr;
    align-items: end;
    column-gap: 16px;
}

.fv-header__tabs {
    justify-self: center;
    min-width: 0;
}

/* Inline tabs */
.fv-tabs--inline {
    margin: 0 !important;
    border-bottom: 1px solid var(--border);
}

.fv-tabs--inline .nav-link {
    padding: .45rem .85rem;
}

.fv-tabs--inline .nav-link.active {
    border-color: var(--border) var(--border) var(--card-bg);
}

.fv-sep {
    margin: 0 .35rem;
    opacity: .75;
}

.fv-tabs {
    margin-bottom: 10px !important;
}

.fv-tabs .nav-link {
    padding: .5rem .9rem;
}

.fv-filters label {
    font-weight: 500;
}

.fv-table tbody tr:hover {
    background-color: #f5f7fa;
}

.fv-table td, .fv-table th {
    vertical-align: middle;
}

.fv-demo fieldset {
    background-color: #f8f9fa;
}

.fv-demo legend {
    width: auto;
    padding: 0 0.35rem;
    margin-bottom: 0.4rem;
}

.form-label-sm {
    font-size: 0.85rem;
    margin-bottom: 0.1rem;
}

/* Presence Indicators */
.fv-presence {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    max-width: 22rem;
    text-align: right;
    font-size: .875rem;
}

.fv-presence__summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem;
    font-weight: 600;
    flex-wrap: wrap;
}

.fv-presence__live-dot {
    width: .55rem;
    height: .55rem;
    border-radius: 999px;
    background: #2ea043;
    display: inline-block;
    flex: 0 0 auto;
}

.fv-presence__counts {
    font-weight: 400;
    color: #666;
}

.fv-presence__list {
    margin-top: .25rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    align-items: flex-end;
    max-width: 100%;
}

.fv-presence__item {
    font-size: .8rem;
    color: #555;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fv-presence__user {
    font-weight: 600;
}

.nav-row--presence {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.nav-row__main {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}

.nav-row__presence {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-row__presence--floating {
    position: absolute;
    top: -0.7rem;
    right: 0;
    z-index: 4;
}

.presence-viewing {
    box-shadow: inset 0 0 0 2px rgba(54, 116, 181, 0.18);
    background-color: rgba(54, 116, 181, 0.06);
}

.presence-editing {
    box-shadow: inset 0 0 0 2px rgba(191, 87, 0, 0.28);
    background-color: rgba(191, 87, 0, 0.09);
}

.presence-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .1rem .45rem;
    border-radius: 999px;
    font-size: .72rem;
    background: rgba(54, 116, 181, 0.10);
    color: #2f5f93;
    vertical-align: middle;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.presence-badge--editing {
    background: rgba(191, 87, 0, 0.12);
    color: #8a4700;
}

.criteria-header-wrap {
    position: relative;
    display: block;
    overflow: visible !important;
    padding-top: 0.1rem;
}

.criteria-presence-badge {
    position: absolute;
    top: 0.28rem;
    right: 0.35rem;
    transform: none;
    z-index: 20;
    white-space: nowrap;
    background: #fff;
    padding: 0 .4rem;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(0,0,0,.18);
    line-height: 1.1;
}

.criteria.sticky-col {
    position: sticky;
}

    .criteria.sticky-col.presence-viewing {
        box-shadow: inset 0 0 0 2px rgba(54, 116, 181, 0.18);
        background-color: rgba(54, 116, 181, 0.06);
    }

    .criteria.sticky-col.presence-editing {
        box-shadow: inset 0 0 0 2px rgba(191, 87, 0, 0.28);
        background-color: rgba(191, 87, 0, 0.09);
    }

.criterion-presence-overlay {
    position: absolute;
    top: .2rem;
    left: .35rem;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    max-width: 12rem;
    padding: .08rem .4rem;
    border-radius: 999px;
    font-size: .68rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(255, 255, 255, 0.96);
    background: #eef5fc;
    color: #2f5f93;
    border: 1px solid rgba(54, 116, 181, 0.28);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
    pointer-events: none;
}

.criterion-presence-overlay--editing {
    background: rgba(255, 248, 240, 0.98);
    background: #fff3e8;
    color: #8a4700;
    border: 1px solid rgba(191, 87, 0, 0.32);
}

.criterion-label-text {
    position: relative;
    z-index: 1;
}

.crc-top-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin: 0.5rem 0 1rem 0;
    min-width: 0;
}

.crc-top-left {
    flex: 0 0 360px;
}

.crc-top-right {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 900px) {
    .crc-top-row {
        flex-direction: column;
    }

    .crc-top-left {
        flex-basis: auto;
    }
}

.comments-editor__header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
    flex-wrap: wrap;
}

.comments-editor__label {
    font-weight: 600;
}

/* FV user management */

.fv-user-manager {
    margin-top: 1rem;
}

.fv-user-manager__header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.fv-user-manager__title {
    margin-bottom: 0.25rem;
}

.fv-user-manager__search {
    margin-bottom: 1rem;
    max-width: 56rem;
}

.fv-user-search-results {
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    overflow: hidden;
}

.fv-user-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eee;
}

.fv-user-search-result:last-child {
    border-bottom: 0;
}

.fv-user-search-result__main {
    min-width: 0;
}

.fv-user-table-wrap {
    overflow-x: auto;
}

.fv-user-table th,
.fv-user-table td {
    vertical-align: middle;
}

.fv-user-table__row--inactive {
    opacity: 0.75;
}

.fv-user-table__row--main {
    background: rgba(13, 110, 253, 0.05);
}

.fv-user-main-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: calc(1.5em + 0.5rem + 2px);
    min-width: 4.75rem;
}

/* FV Creation */

.selected-chairperson-card,
.create-fv-user-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.selected-chairperson-card {
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
}

.create-fv-user-search-results {
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    overflow: hidden;
}

.create-fv-user-search-result {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eee;
}

.create-fv-user-search-result:last-child {
    border-bottom: 0;
}

/* =======================================================================
   APP CHROME: TOP NAV + FULL WIDTH CONTENT
   ======================================================================= */
.app-shell-top {
    height: 100vh;
    display: grid;
    grid-template-rows: var(--topbar-h) 1fr;
    min-width: 0;
}

.app-topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    height: var(--topbar-h);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    min-width: 0;
}

.app-topbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.app-topbar__center {
    justify-self: center;
    min-width: 0;
    max-width: 60vw;
}

.app-topbar__right {
    justify-self: end;
    min-width: 0;
}
.app-brand {
    font-weight: 800;
    letter-spacing: .2px;
    text-decoration: none;
    color: var(--text);
    white-space: nowrap;
}

.app-topnav {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.app-topnav__link {
    text-decoration: none;
    color: #334155;
    padding: 8px 10px;
    border-radius: 10px;
    white-space: nowrap;
}

.app-topnav__link:hover {
    background: rgba(15,23,42,0.05);
}

.app-topnav__link.active {
    background: rgba(37,99,235,0.10);
    color: #1d4ed8;
    font-weight: 600;
}

.app-content-full {
    overflow: auto;
    scrollbar-gutter: stable;
    padding: 16px;
    min-width: 0;
}

/* Verification Requirements */

.tab-content {
    padding-top: 0.5rem; /* tweak: 0.4–0.75rem */
}

.verification-tabs-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

    .verification-tabs-row .tabs {
        flex: 1 1 auto;
    }

.evidence-assignment {
    flex: 0 1 18rem;
    min-width: 14rem;
}

.evidence-assignment-select {
    width: 100%;
}

.evidence-assignment-display {
    font-size: 0.875rem;
    color: #555;
    padding: 0.25rem 0;
}

/* Performance Rating (non-CRC) */

.perf-rating {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.perf-radio {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    cursor: pointer;
}

.perf-radio input[type="radio"] {
    margin-top: 0.15rem; /* aligns with first line of text */
}

/* Account Pages */
.account-page {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4rem 1.5rem;
    background: #f6f7fb;
}

.account-card {
    width: min(100%, 440px);
    background: #fff;
    border: 1px solid #d9dee8;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    padding: 2rem;
}

.account-card__header {
    margin-bottom: 1.5rem;
}

    .account-card__header h1 {
        margin: 0 0 0.35rem;
        font-size: 1.65rem;
    }

    .account-card__header p {
        margin: 0;
        color: #5f6b7a;
    }

.account-form {
    display: grid;
    gap: 1rem;
}

.account-field {
    display: grid;
    gap: 0.35rem;
}

    .account-field label {
        font-weight: 600;
    }

    .account-field input {
        box-sizing: border-box;
        width: 100%;
        padding: 0.7rem 0.8rem;
        border: 1px solid #bcc5d3;
        border-radius: 8px;
        font: inherit;
    }

        .account-field input:focus {
            outline: 2px solid #9bbcf9;
            border-color: #5f8fe8;
        }

    .account-field span,
    .account-validation {
        color: #b42318;
        font-size: 0.9rem;
    }

.account-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #344054;
}

.account-button {
    margin-top: 0.25rem;
    border: 0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-weight: 700;
    background: #1f5fbf;
    color: #fff;
    cursor: pointer;
}

    .account-button:hover {
        background: #184f9f;
    }
