0/* General */

h1:focus {
    outline: none;
}

/* Shared page layout helpers */

.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.page-subtitle {
    color: #6c757d;
    margin-bottom: 0;
}

.card-section {
    margin-bottom: 1.5rem;
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.table-actions {
    white-space: nowrap;
    width: 1%;
}

.status-badge {
    font-size: 0.8rem;
}

.required::after {
    content: " *";
    color: #dc3545;
}

/* Blazor validation */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #dc3545;
}

.validation-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.field-validation-error {
    color: #dc3545;
}

.input-validation-error {
    border-color: #dc3545;
}

/* Blazor error boundary */

.blazor-error-boundary {
    background-color: #b32121;
    border-radius: 0.375rem;
    color: white;
    padding: 1rem;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* Bootstrap form helpers */

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.tenant-color-swatch {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

.legacy-import-messages {
    max-height: 24rem;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
}

.password-toggle-button {
    min-width: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .password-toggle-button:focus {
        z-index: 5;
    }

/* Hide Microsoft Edge's built-in password reveal/clear controls
   because the application provides its own visibility button. */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

.authenticator-qr-wrapper {
    display: inline-block;
    padding: 1rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
}

    .authenticator-qr-wrapper img,
    .authenticator-qr-wrapper canvas {
        display: block;
    }

.authenticator-key {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    overflow-wrap: anywhere;
}


/* Identity UI polish */
.identity-page-title {
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.identity-panel {
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    background-color: #fff;
}

    .identity-panel .form-label {
        font-weight: 500;
    }

.identity-links p {
    margin-bottom: 0.5rem;
}

.identity-danger-zone {
    border: 1px solid var(--bs-danger-border-subtle);
    border-radius: 0.5rem;
    padding: 1rem;
}

.recovery-code-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.5rem;
}

.recovery-code {
    display: block;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
}

@media (max-width: 575.98px) {
    .identity-panel {
        padding: 1rem;
    }
}

/* Modern application shell */
:root {
    --shell-sidebar-width: 17rem;
    --shell-sidebar-collapsed-width: 4.75rem;
    --shell-topbar-height: 4rem;
    --shell-bg: #f4f7fb;
    --shell-sidebar-bg: #0f2742;
    --shell-sidebar-border: rgba(255, 255, 255, 0.1);
    --shell-sidebar-text: #d9e5f1;
    --shell-sidebar-muted: #92a9bf;
    --shell-accent: #2f80ed;
    --shell-accent-soft: rgba(47, 128, 237, 0.18);
}

.modern-shell {
    min-height: 100vh;
    background: var(--shell-bg);
}

.shell-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--shell-sidebar-width);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #102b49 0%, var(--shell-sidebar-bg) 100%);
    color: var(--shell-sidebar-text);
    border-right: 1px solid rgba(15, 39, 66, 0.25);
    z-index: 1040;
    transition: width 180ms ease, transform 180ms ease;
}

.shell-brand {
    min-height: var(--shell-topbar-height);
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem .7rem .75rem .85rem;
    border-bottom: 1px solid var(--shell-sidebar-border);
}

.shell-brand-link {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #fff;
    text-decoration: none;
}

.shell-brand-mark {
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3c91f7, #1862b7);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .03em;
    box-shadow: 0 .35rem 1rem rgba(0, 0, 0, .18);
}

.shell-brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.shell-brand-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 650;
    line-height: 1.2;
}

.shell-brand-subtitle {
    color: var(--shell-sidebar-muted);
    font-size: .75rem;
}

.shell-brand-attribution {
    color: #b8c9da;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
}

.shell-collapse-button,
.shell-mobile-menu {
    border: 0;
    border-radius: .55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.shell-collapse-button {
    width: 2.25rem;
    height: 2.25rem;
    color: var(--shell-sidebar-muted);
    background: rgba(255,255,255,.06);
}

    .shell-collapse-button:hover,
    .shell-collapse-button:focus-visible {
        color: #fff;
        background: rgba(255,255,255,.12);
    }

.shell-nav {
    flex: 1;
    overflow-y: auto;
    padding: .8rem .65rem 1rem;
}

.shell-nav-section + .shell-nav-section {
    margin-top: 1.25rem;
}

.shell-nav-heading {
    padding: 0 .75rem .4rem;
    color: var(--shell-sidebar-muted);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    white-space: nowrap;
}

.shell-nav-link {
    width: 100%;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .65rem .75rem;
    border: 0;
    border-radius: .65rem;
    color: var(--shell-sidebar-text);
    background: transparent;
    text-decoration: none;
    text-align: left;
    transition: color 120ms ease, background-color 120ms ease, transform 120ms ease;
}

    .shell-nav-link:hover,
    .shell-nav-link:focus-visible {
        color: #fff;
        background: rgba(255,255,255,.08);
    }

    .shell-nav-link.active {
        color: #fff;
        background: var(--shell-accent-soft);
        box-shadow: inset 3px 0 0 #62a9ff;
    }

    .shell-nav-link .shell-icon {
        flex: 0 0 1.25rem;
    }

.shell-nav-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .93rem;
    font-weight: 520;
}

.shell-sidebar-footer {
    padding: .65rem;
    border-top: 1px solid var(--shell-sidebar-border);
}

.shell-logout-form {
    margin: 0;
}

.shell-nav-button {
    cursor: pointer;
}

.shell-workspace {
    min-height: 100vh;
    margin-left: var(--shell-sidebar-width);
    transition: margin-left 180ms ease;
}

.shell-topbar {
    position: sticky;
    top: 0;
    z-index: 1025;
    height: var(--shell-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #dce4ed;
}

.shell-topbar-context {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.shell-topbar-title {
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shell-topbar-user {
    color: #6c7b8a;
    font-size: .83rem;
    white-space: nowrap;
}

.shell-role-badge {
    padding: .22rem .55rem;
    border-radius: 999px;
    background: #e9f2ff;
    color: #245d9c;
    font-size: .72rem;
    font-weight: 650;
    white-space: nowrap;
}

.shell-mobile-menu {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    color: #183650;
    background: #eef3f8;
}

.shell-main {
    width: min(100%, 1500px);
    margin: 0 auto;
    padding: 1.75rem 2rem 3rem;
}

.shell-main-tenant {
    width: min(100%, 1320px);
}

.shell-collapsed .shell-sidebar {
    width: var(--shell-sidebar-collapsed-width);
}

.shell-collapsed .shell-workspace {
    margin-left: var(--shell-sidebar-collapsed-width);
}

.shell-collapsed .shell-brand-copy,
.shell-collapsed .shell-nav-heading,
.shell-collapsed .shell-nav-text {
    display: none;
}

.shell-collapsed .shell-brand {
    padding-left: .65rem;
    padding-right: .65rem;
    justify-content: center;
    flex-direction: column;
    min-height: 7rem;
}

.shell-collapsed .shell-brand-link {
    flex: 0 0 auto;
}

.shell-collapsed .shell-collapse-button .shell-icon {
    transform: rotate(180deg);
}

.shell-collapsed .shell-nav-link {
    justify-content: center;
    padding-left: .5rem;
    padding-right: .5rem;
}

    .shell-collapsed .shell-nav-link.active {
        box-shadow: inset 3px 0 0 #62a9ff;
    }

.shell-backdrop {
    display: none;
}

.app-shell-loading {
    min-height: 100vh;
    display: grid;
    place-content: center;
    padding: 2rem;
    background: var(--shell-bg);
}

/* Application submitter workflow progress */
.application-progress {
    margin-bottom: 1.5rem;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid #dce4ed;
    border-radius: .9rem;
    box-shadow: 0 .25rem .85rem rgba(35, 55, 80, .06);
}

.application-progress-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    margin: 0;
    padding: 0;
}

.application-progress-step {
    position: relative;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    padding-right: .5rem;
}

    .application-progress-step:not(:last-child)::after {
        content: "";
        position: absolute;
        top: .9rem;
        left: calc(1.8rem + .35rem);
        right: .35rem;
        height: 2px;
        background: #d8e0e8;
        z-index: 0;
    }

    .application-progress-step.complete:not(:last-child)::after {
        background: #38a169;
    }

.application-progress-marker {
    position: relative;
    z-index: 1;
    flex: 0 0 1.8rem;
    width: 1.8rem;
    height: 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #b7c2ce;
    border-radius: 50%;
    background: #fff;
    color: #758392;
    font-size: .75rem;
    font-weight: 700;
}

.application-progress-step.complete .application-progress-marker {
    border-color: #38a169;
    background: #38a169;
    color: #fff;
}

.application-progress-step.current .application-progress-marker {
    border-color: var(--shell-accent);
    background: var(--shell-accent);
    color: #fff;
    box-shadow: 0 0 0 .25rem rgba(47,128,237,.13);
}

.application-progress-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-top: .12rem;
}

.application-progress-label {
    color: #6f7e8d;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.2;
}

.application-progress-step.complete .application-progress-label,
.application-progress-step.current .application-progress-label {
    color: #183650;
}

.application-progress-hint {
    margin-top: .25rem;
    color: #6b7785;
    font-size: .72rem;
    line-height: 1.25;
}

.application-progress-compact {
    min-width: 20rem;
    margin: 0;
    padding: .55rem .65rem;
    box-shadow: none;
}

    .application-progress-compact .application-progress-copy {
        display: none;
    }

    .application-progress-compact .application-progress-step:not(:last-child)::after {
        left: 1.45rem;
        right: .1rem;
        top: .65rem;
    }

    .application-progress-compact .application-progress-marker {
        width: 1.3rem;
        height: 1.3rem;
        flex-basis: 1.3rem;
        font-size: .62rem;
    }

@media (max-width: 991.98px) {
    .shell-sidebar {
        width: min(19rem, 88vw);
        transform: translateX(-105%);
        box-shadow: .75rem 0 2rem rgba(10, 27, 45, .25);
    }

    .shell-workspace,
    .shell-collapsed .shell-workspace {
        margin-left: 0;
    }

    .shell-mobile-open .shell-sidebar {
        transform: translateX(0);
    }

    .shell-mobile-open .shell-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(7, 20, 34, .48);
    }

    .shell-mobile-menu {
        display: inline-flex;
    }

    .shell-collapse-button {
        display: none;
    }

    .shell-main {
        padding: 1.25rem 1rem 2.5rem;
    }

    .shell-topbar {
        padding: 0 1rem;
    }

    .shell-topbar-user {
        display: none;
    }

    body.shell-no-scroll {
        overflow: hidden;
    }

    .application-progress-list {
        grid-template-columns: 1fr;
        gap: .5rem;
    }

    .application-progress-step {
        align-items: center;
        min-height: 2.5rem;
    }

        .application-progress-step:not(:last-child)::after {
            top: 1.65rem;
            bottom: -.65rem;
            left: .88rem;
            right: auto;
            width: 2px;
            height: auto;
        }

    .application-progress-copy {
        padding-top: 0;
    }

    .application-progress-label {
        font-size: .88rem;
    }

    .application-progress-compact {
        min-width: 12rem;
    }

        .application-progress-compact .application-progress-list {
            grid-template-columns: repeat(7, minmax(0, 1fr));
            gap: 0;
        }

        .application-progress-compact .application-progress-step {
            min-height: auto;
        }

            .application-progress-compact .application-progress-step:not(:last-child)::after {
                top: .65rem;
                left: 1.25rem;
                right: 0;
                bottom: auto;
                width: auto;
                height: 2px;
            }
}

@media (max-width: 575.98px) {
    .shell-role-badge {
        display: none;
    }

    .application-progress {
        padding: .85rem;
    }
}

.application-progress-step.optional .application-progress-marker {
    border-style: dashed;
    background: #f7f9fb;
    color: #7a8794;
}

.application-progress-step.optional .application-progress-label {
    color: #6f7e8d;
}

/* Application workflow editing and navigation standardization */
.application-workflow-navigation {
    display: grid;
    grid-template-columns: minmax(7rem, 1fr) minmax(8rem, auto) minmax(7rem, 1fr);
    align-items: center;
    gap: 1rem;
    padding: .875rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background: var(--bs-body-bg);
    box-shadow: 0 .125rem .35rem rgba(15, 23, 42, .06);
}

    .application-workflow-navigation > :last-child {
        text-align: right;
    }

.application-workflow-navigation-status {
    text-align: center;
}

.application-stage-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--bs-border-color);
}

.application-edit-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .75rem;
}

.application-edit-fieldset {
    min-width: 0;
    padding: 0;
    margin: 0;
    border: 0;
}

    .application-edit-fieldset:disabled .form-control,
    .application-edit-fieldset:disabled .form-select {
        background-color: var(--bs-secondary-bg);
        opacity: 1;
    }

@media (max-width: 575.98px) {
    .application-workflow-navigation {
        grid-template-columns: 1fr 1fr;
    }

    .application-workflow-navigation-status {
        grid-column: 1 / -1;
        grid-row: 1;
        margin-bottom: .25rem;
    }

    .application-workflow-navigation > :first-child {
        grid-column: 1;
        grid-row: 2;
    }

    .application-workflow-navigation > :last-child {
        grid-column: 2;
        grid-row: 2;
    }

    .application-workflow-navigation .btn {
        width: 100%;
    }
}

/* Version 1.0 native responsive table standard
   Contains wide tables within the application viewport and uses browser-native
   horizontal scrolling. No mouse-drag emulation or proxy scrollbar is used. */
.modern-shell,
.shell-workspace,
.shell-main,
.shell-main > *,
.shell-main .container,
.shell-main .container-fluid,
.shell-main .row,
.shell-main [class*="col-"],
.shell-main .card,
.shell-main .card-body {
    min-width: 0;
    max-width: 100%;
}

.table-responsive,
.responsive-table-region,
.native-table-scroll {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
}

    .table-responsive:focus-visible,
    .responsive-table-region:focus-visible,
    .native-table-scroll:focus-visible {
        outline: 3px solid rgba(13, 110, 253, .28);
        outline-offset: -3px;
    }

    .table-responsive > .table,
    .responsive-table-region > .table,
    .native-table-scroll > .table {
        width: max-content;
        min-width: 100%;
        max-width: none;
        margin-bottom: 0;
    }

        .table-responsive > .table th,
        .responsive-table-region > .table th,
        .native-table-scroll > .table th {
            white-space: nowrap;
        }

        .table-responsive > .table td,
        .responsive-table-region > .table td,
        .native-table-scroll > .table td {
            overflow-wrap: anywhere;
        }

    /* Keep action groups usable without forcing the full page beyond the viewport. */
    .table-responsive .btn-group,
    .responsive-table-region .btn-group,
    .native-table-scroll .btn-group,
    .table-responsive .text-nowrap,
    .responsive-table-region .text-nowrap,
    .native-table-scroll .text-nowrap {
        white-space: nowrap;
    }

/* Keep application list date/time values readable without making
   the column sticky. Horizontal overflow remains handled by the
   responsive table container. */
.application-datetime-column {
    min-width: 9rem;
    white-space: nowrap;
    overflow-wrap: normal;
}

.application-submitted-column {
    min-width: 9.5rem;
}

.my-applications-table thead .application-created-column {
    z-index: 5;
    background-color: var(--bs-tertiary-bg);
    box-shadow: none;
}

/* Version 1.0 row-action standard
   One visible primary action plus a viewport-level More actions popover. */
.table-actions {
    width: 1%;
    min-width: 10.75rem;
    white-space: nowrap;
}

.row-action-cluster {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    white-space: nowrap;
}

.row-action-primary, .row-action-more {
    min-height: 2rem;
}

.row-action-popover {
    position: fixed;
    inset: auto;
    width: max-content;
    min-width: 13rem;
    max-width: min(20rem, calc(100vw - 1rem));
    margin: 0;
    padding: .375rem;
    border: 1px solid rgba(15,23,42,.14);
    border-radius: .65rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    box-shadow: 0 .75rem 2rem rgba(15,23,42,.18);
}

    .row-action-popover::backdrop {
        background: transparent;
    }

.row-action-menu-item {
    display: block;
    width: 100%;
    padding: .55rem .7rem;
    border-radius: .4rem;
    color: var(--bs-body-color);
    font-size: .925rem;
    line-height: 1.25;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
}

    .row-action-menu-item:hover, .row-action-menu-item:focus-visible {
        background: var(--bs-tertiary-bg);
        color: var(--bs-body-color);
        outline: none;
    }

.row-action-menu-item-danger {
    color: var(--bs-danger-text-emphasis);
}

.row-action-divider {
    height: 1px;
    margin: .35rem .25rem;
    background: var(--bs-border-color);
}

@media (max-width:575.98px) {
    .table-actions {
        min-width: 9.75rem;
    }

    .row-action-cluster {
        gap: .375rem;
    }
}


/* Version 1.0 persistent row-action visibility
   Keep the compact primary + More controls visible while data columns scroll.
   Preserve Bootstrap striped-row and hover-state colors inside sticky cells. */
.table-responsive .row-action-sticky,
.responsive-table-region .row-action-sticky,
.native-table-scroll .row-action-sticky {
    position: sticky;
    right: 0;
    z-index: 4;
    white-space: nowrap;
    background-color: var(--bs-table-bg);
    background-clip: padding-box;
    border-left: 1px solid var(--bs-border-color);
    box-shadow: inset 0 0 0 9999px var( --bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-accent-bg)) ), -0.45rem 0 0.65rem -0.65rem rgba(15, 23, 42, 0.55);
}

.table-responsive thead .row-action-sticky,
.responsive-table-region thead .row-action-sticky,
.native-table-scroll thead .row-action-sticky {
    z-index: 6;
    background-color: var(--bs-tertiary-bg);
    box-shadow: none;
}

@media (max-width: 575.98px) {
    .row-action-sticky {
        min-width: 9.75rem;
    }
}

/* Tenant Applications: keep Created visible immediately to the left of the
   sticky Actions column while preserving Bootstrap striped-row and hover colors. */
.responsive-table-region .application-created-column {
    position: sticky;
    right: 10.75rem;
    z-index: 3;
    min-width: 14rem;
    width: 14rem;
    white-space: nowrap;
    overflow-wrap: normal;
    background-color: var(--bs-table-bg);
    background-clip: padding-box;
    border-left: 1px solid var(--bs-border-color);
    box-shadow: inset 0 0 0 9999px var( --bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-accent-bg)) );
}

.responsive-table-region thead .application-created-column {
    z-index: 5;
    background-color: var(--bs-tertiary-bg);
    box-shadow: none;
}

@media (max-width: 575.98px) {
    .responsive-table-region .application-created-column {
        right: 9.75rem;
        min-width: 12.5rem;
        width: 12.5rem;
    }
}
