.bg-body-secondary {
    background: radial-gradient(circle at 76% 26%,
            #e9f0f5 0,
            #f2f0f4 57%,
            #f5f5f5 100%);
}

.payment-stage-shell,
.payment-action-stack {
    display: grid;
    gap: 0.75rem;
}

.payment-stage-panel,
.payment-action-panel {
    overflow: hidden;
}

.payment-stage-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.payment-stage-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
}

.payment-detail-panel {
    padding: 1rem 1.05rem;
    height: 100%;
    border: 1px solid #dce6f3;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.payment-table-wrap {
    border: 1px solid #dce6f3;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.payment-stage-table {
    margin-bottom: 0;
}

.payment-stage-table thead th {
    background: #f7fbff;
    vertical-align: middle;
}

.payment-stage-table tfoot td {
    background: #fbfdff;
}

.payment-action-alert {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border: 1px solid #dce7f4;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #f8fbfe 0%, #f1f7ff 100%);
}

.payment-action-alert-danger {
    border-color: #efc2c9;
    background: linear-gradient(180deg, #fff7f8 0%, #fff0f2 100%);
    color: #8f2335;
}

.payment-action-panel {
    padding: 0.9rem 1rem;
    border: 1px solid #dce6f3;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.payment-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.payment-modal-alert {
    border-radius: var(--radius-lg);
}

.application-meta-chip,
.application-meta-chip-success {
    display: inline-flex;
    align-items: center;
    min-height: 1.85rem;
    padding: 0.2rem 0.7rem;
    border: 1px solid #d6e3f2;
    border-radius: 999px;
    background: #f7fbff;
    color: #234666;
    font-size: 0.83rem;
    font-weight: 500;
}

.application-meta-chip-success {
    background: #e9f8f0;
    color: #167a4d;
    border-color: #bee7cf;
}

.application-meta-chip-danger {
    background: #fdecea;
    color: #a3271f;
    border-color: #f3c6c1;
}

.application-meta-chip-warning {
    background: #fff6e6;
    color: #8a5a00;
    border-color: #f5ddab;
}

.workspace-surface,
.process-step-panel {
    border-radius: var(--radius-lg);
}

@media (max-width: 767.98px) {

    .payment-stage-head,
    .payment-action-alert {
        align-items: stretch;
        flex-direction: column;
    }

    .payment-stage-chips {
        justify-content: flex-start;
    }

    .payment-action-row .btn {
        flex: 1 1 auto;
    }
}

.application-products-panel,
.application-dependency-panel,
.application-link-document-panel {
    padding: 1rem 1.05rem;
}

.application-shared-table {
    margin-bottom: 0;
}

.application-shared-table thead th {
    background: #f7fbff;
    vertical-align: middle;
}

.application-identity-shell {
    display: grid;
    gap: 0.75rem;
}

.application-identity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.application-identity-card {
    padding: 0.95rem 1rem;
    border: 1px solid #dce6f3;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.application-identity-label {
    margin-bottom: 0.35rem;
    color: #526a86;
    font-size: 0.82rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.application-identity-value {
    color: #163451;
    font-weight: 400;
}

.process-form-shell {
    display: grid;
    gap: 1rem;
}

.process-form-panel {
    overflow: hidden;
}

.process-form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.process-form-progress {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
}

.application-meta-chip-success {
    background: #e9f8f0;
    color: #167a4d;
    border-color: #bee7cf;
}

.process-form-products {
    border: 1px solid rgba(17, 119, 210, 0.08);
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}

.process-form-tab-shell .tab-content {
    padding: 1.25rem 0 0;
}

.process-form-tabs .nav-tabs {
    gap: 0.75rem;
    border-bottom: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.2rem;
}

.process-form-tabs .nav-item {
    float: none;
    margin-right: 5px;
}

.process-form-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 15rem;
    padding: 0.85rem 1rem;
    border: 1px solid #dbe6f3;
    border-radius: var(--radius-lg);
    background: #f8fbfe;
    color: #173453;
    box-shadow: 0 8px 18px rgba(14, 41, 74, 0.04);
}

.process-form-tabs .nav-link:hover,
.process-form-tabs .nav-link:focus,
.process-form-tabs .nav-link.active {
    border-color: rgba(17, 119, 210, 0.24);
    background: #ffffff;
    color: #0f5fa8;
}

.process-form-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #e6eef8;
    color: #34506e;
    font-weight: 600;
    flex: 0 0 auto;
}

.process-form-tab-badge.is-active {
    background: #d9ebff;
    color: #0f63b5;
}

.process-form-tab-badge.is-done {
    background: #e7f7ee;
    color: #188252;
}

.process-form-tab-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.process-form-tab-title {
    font-weight: 500;
    line-height: 1.35;
}

.process-form-tab-status {
    font-size: 0.8rem;
    color: #61758f;
}

.process-form-body {
    display: grid;
    gap: 1rem;
}

.process-form-intro {
    border: 1px solid #dce7f4;
    background: linear-gradient(180deg, #f8fbfe 0%, #f1f7ff 100%);
}

.process-form-intro-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4d6580;
    margin-bottom: 0.35rem;
}

.process-form-intro-copy>*:last-child {
    margin-bottom: 0;
}

.process-form-fields {
    padding: 1rem 1.05rem;
    border: 1px solid #dce6f3;
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.process-form-alert {
    border-radius: var(--radius-lg);
}

.process-form-foot {
    gap: 1rem;
}

.process-form-shell {
    gap: 0.5rem;
}

.process-form-panel.process-step-panel {
    padding: 0.2rem;
    border: 0;
}

.process-form-panel.process-step-panel .tabs-x .nav-tabs {
    padding-bottom: 10px;
}

.process-form-head-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem !important;
}

.process-form-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 0.75rem;
    flex: 1;
    min-width: 0;
}

.process-form-title-row .workspace-title {
    font-size: 1.15rem;
}

.process-form-progress {
    gap: 0.45rem;
}

.process-form-products-compact {
    padding: 0.75rem 0.9rem;
}

.process-form-products-head-compact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
}

.process-form-products-body.mt-2 {
    margin-top: 0.5rem !important;
}

.process-form-tab-shell .tab-content {
    padding: 0.8rem 0 0;
}

.process-form-tabs-compact .nav-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.6rem;
    margin: 0;
    padding: 0.1rem 0 0.2rem;
    list-style: none;
}

.process-form-tabs-compact .nav-tabs>li,
.process-form-tabs-compact .nav-tabs>.nav-item {
    display: flex;
    align-items: center;
    margin: 0;
    float: none;
}

.process-form-tabs-compact .nav-tabs>li>a,
.process-form-tabs-compact .nav-tabs>.nav-item>.nav-link {
    margin: 0;
}

.process-form-tabs-compact .nav-link,
.process-form-tabs-compact .nav-link.active,
.process-form-tabs-compact .nav-item.active .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 11rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-md);
    box-shadow: none;
    white-space: nowrap;
}

.process-form-tabs-compact .nav-link.active,
.process-form-tabs-compact .nav-item.active .nav-link {
    border-color: #1177d2;
    background: #eaf4ff;
    color: #0f5fa8;
    box-shadow: inset 0 0 0 1px rgba(17, 119, 210, 0.08);
}

.process-form-tabs-compact .process-form-tab-badge {
    width: 1.6rem;
    height: 1.6rem;
    font-size: 0.82rem;
}

.process-form-tabs-compact .nav-link .process-form-tab-copy,
.process-form-tabs-compact .nav-link.active .process-form-tab-copy,
.process-form-tabs-compact .nav-item.active .nav-link .process-form-tab-copy {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.process-form-tabs-compact .process-form-tab-title {
    font-size: 0.88rem;
    line-height: 1.2;
    margin-left: 5px;
}

.process-form-tabs-compact .nav-link.active .process-form-tab-badge,
.process-form-tabs-compact .nav-item.active .nav-link .process-form-tab-badge {
    background: #1177d2;
    color: #fff;
}

.process-form-tab-status {
    display: none;
}

.process-form-body-compact {
    gap: 0.75rem;
}

.process-form-intro-compact {
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.75rem !important;
    font-size: 0.93rem;
    line-height: 1.5;
}

.process-form-fields-compact {
    padding: 0.8rem 0.9rem;
}

/* inside the form panel the fields are not a card of their own: the panel is the card, and the
   fields line up with its heading and tabs */
.process-form-panel .process-form-fields {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.process-form-foot-compact {
    margin-top: 0.75rem !important;
    min-height: 0;
}

.process-form-foot-compact .process-inline-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 0.5rem;
}

.process-form-foot-compact .btn {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.process-declaration-panel {
    overflow: hidden;
}

.process-declaration-head {
    align-items: center;
}

.process-declaration-alert {
    border-radius: var(--radius-lg);
}

.process-declaration-note {
    border: 1px solid #b8d3f0;
    border-left: 4px solid #1177d2;
    background: linear-gradient(180deg, #f4f9ff 0%, #eaf4ff 100%);
    color: #123f6b;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(17, 119, 210, 0.08);
}

.process-declaration-copy {
    padding: 1rem 1.05rem;
    border: 1px solid #dce6f3;
    border-radius: var(--radius-lg);
    background: #fff;
    color: #22384f;
    line-height: 1.75;
    box-shadow: var(--shadow-sm);
}

.process-declaration-copy>*:last-child {
    margin-bottom: 0;
}

.process-declaration-check {
    padding: 0.85rem 1rem;
    border: 1px solid #dce6f3;
    border-radius: var(--radius-lg);
    background: #fbfdff;
}

.process-declaration-check .form-group,
.process-declaration-check .checkbox,
.process-declaration-check .form-check {
    margin-bottom: 0;
}

.process-declaration-check label {
    margin-bottom: 0;
    font-weight: 600;
    color: #173453;
}

.process-declaration-foot {
    min-height: 0;
}

.process-declaration-foot .process-inline-actions {
    width: 100%;
    justify-content: flex-end;
}

.process-declaration-success {
    border: 1px solid #cde9d9;
    background: linear-gradient(180deg, #f0fbf5 0%, #e7f7ee 100%);
    color: #176b45;
    font-weight: 600;
}

.application-products-panel,
.application-dependency-panel,
.application-link-document-panel {
    padding: 1rem 1.05rem;
}

.application-shared-table {
    margin-bottom: 0;
}

.application-shared-table thead th {
    background: #f7fbff;
    vertical-align: middle;
}

.application-identity-shell {
    display: grid;
    gap: 0.75rem;
}

.application-identity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.application-identity-card {
    padding: 0.95rem 1rem;
    border: 1px solid #dce6f3;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.application-identity-label {
    margin-bottom: 0.35rem;
    color: #526a86;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.application-identity-value {
    color: #163451;
    font-weight: 600;
}

.payment-stage-shell,
.payment-action-stack {
    display: grid;
    gap: 0.75rem;
}

.payment-stage-panel,
.payment-action-panel {
    overflow: hidden;
}

.payment-stage-head {
    align-items: center;
}

.payment-stage-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
}

.payment-detail-panel {
    padding: 1rem 1.05rem;
    height: 100%;
}

.payment-table-wrap {
    border: 1px solid #dce6f3;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.payment-stage-table {
    margin-bottom: 0;
}

.payment-stage-table thead th {
    background: #f7fbff;
    vertical-align: middle;
}

.payment-stage-table tfoot td {
    background: #fbfdff;
}

.payment-action-alert {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid #dce7f4;
    background: linear-gradient(180deg, #f8fbfe 0%, #f1f7ff 100%);
}

.payment-action-alert-danger {
    border-color: #efc2c9;
    background: linear-gradient(180deg, #fff7f8 0%, #fff0f2 100%);
    color: #8f2335;
}

.payment-action-panel {
    padding: 0.9rem 1rem;
}

.payment-action-row {
    gap: 0.65rem;
}

.payment-modal-alert {
    border-radius: var(--radius-lg);
}

@media (max-width: 767.98px) {

    .payment-stage-head,
    .payment-action-alert {
        align-items: stretch;
    }

    .payment-stage-chips {
        justify-content: flex-start;
    }

    .payment-action-row .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 767.98px) {
    .process-declaration-head {
        align-items: stretch;
    }

    .process-declaration-foot .process-inline-actions {
        justify-content: stretch;
    }

    .process-declaration-foot .btn {
        flex: 1 1 auto;
    }
}

.process-view-shell {
    display: grid;
    gap: 0.75rem;
}

/* Submit banner */
.process-view-submit-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(31, 122, 85, 0.25);
    background: linear-gradient(135deg, rgba(31, 122, 85, 0.06) 0%, rgba(31, 122, 85, 0.02) 100%);
    box-shadow: 0 1px 4px rgba(31, 122, 85, 0.08);
}

.process-view-submit-banner-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(31, 122, 85, 0.12);
    color: #1f7a55;
}

.process-view-submit-banner-body {
    flex: 1;
    min-width: 0;
}

.process-view-submit-banner-kicker {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1f7a55;
    margin-bottom: 0.15rem;
}

.process-view-submit-banner-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--backend-process-heading, #1e293b);
    margin: 0 0 0.2rem;
}

.process-view-submit-banner-text {
    font-size: 0.88rem;
    color: var(--backend-process-muted, #64748b);
    line-height: 1.45;
}

.process-view-submit-banner-action {
    flex-shrink: 0;
}

.process-view-submit-btn {
    white-space: nowrap;
    padding: 0.55rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

@media (max-width: 767.98px) {
    .process-view-submit-banner {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .process-view-submit-banner-action {
        width: 100%;
    }
    .process-view-submit-btn {
        width: 100%;
    }
}

/* Process page title bar */
.process-page-title-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem 0.75rem 0 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 251, 253, 0.94) 100%) !important;
    border-bottom: none;
    flex-wrap: nowrap;
}

.process-page-title-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 0.6rem;
    background: var(--backend-process-accent-soft, #e6f0f7);
    color: var(--backend-process-accent, #2c6d9e);
    font-size: 1.1rem;
}

.process-page-title-body {
    flex: 1;
    min-width: 0;
}

.process-page-title-heading {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--backend-process-heading, #1f3448);
    margin: 0;
    line-height: 1.3;
}

.process-page-title-sub {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--backend-process-muted, #667a90);
    margin-top: 0.1rem;
}

.process-page-title-ref {
    font-weight: 400;
    color: var(--backend-process-muted, #667a90);
    opacity: 0.7;
}

.process-page-card {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

/* ── Process content layout ── */
.process-content {
    margin-top: 0.25rem;
}

.process-content > .col-md-9 > .card {
    border: none;
    box-shadow: none;
    background: transparent;
}

.process-content > .col-md-9 > .card > .card-body {
    padding: 0;
}

/* ── Stage-action toolbar ── */
.stage-action-toolbar {
    background: #f4f6f8 !important;
    border: 1px solid #e2e7ed !important;
    border-radius: 0.6rem !important;
    padding: 0.5rem 0.85rem !important;
    margin-bottom: 0.65rem !important;
    font-size: 0.84rem;
}

.stage-action-toolbar .badge {
    font-weight: 500;
    font-size: 0.8rem;
}

.stage-action-toolbar .btn-sm {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
}

.stage-action-toolbar .text-muted {
    opacity: 0.4;
}

/* Entity badge beside toolbar */
.process-instance-stage-action-widget > .d-inline-flex > .badge {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.3rem 0.65rem;
    border-radius: 0.4rem;
}

/* ── Process sidebar ── */
.process-sidebar-accordion {
    position: sticky;
    top: 1rem;
}

.process-sidebar-accordion .process-view-accordion-title {
    font-weight: 500;
    font-size: 0.85rem;
}

.process-sidebar-accordion .accordion-body {
    font-size: 0.87rem;
}

.process-sidebar-accordion .small.text-muted {
    font-weight: 500;
}

.process-sidebar-accordion .fw-semibold {
    font-weight: 500 !important;
}

.process-sidebar-accordion .accordion-button {
    gap: 0.4rem !important;
    padding: 0.6rem 0.65rem !important;
    font-size: 0.83rem;
}

.process-sidebar-accordion .process-view-accordion-badge {
    width: 1.35rem;
    height: 1.35rem;
    font-size: 0.65rem;
}

.process-sidebar-accordion .accordion-button::after {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.process-sidebar-accordion .accordion-body {
    padding: 0.75rem !important;
    font-size: 0.83rem;
}

/* the badges move under the title when the line is too narrow; the title keeps its room */
.process-page-title-bar {
    flex-wrap: wrap;
    row-gap: 0.65rem;
}

.process-page-title-body {
    flex: 1 1 14rem;
}

/* phones: the icon stays beside the title (smaller), the badges take their own line */
@media (max-width: 575.98px) {
    .process-page-title-bar {
        gap: 0.65rem;
        padding: 0.85rem 1rem;
    }
    .process-page-title-icon {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }
    .process-page-title-heading {
        font-size: 1.05rem;
    }
    .process-page-title-bar .timing-badges-row {
        flex-basis: 100%;
        margin-left: 0;
        flex-wrap: wrap;
    }
}

/* ── Process layout overrides ── */
.is-process-layout .app-header {
    border: none;
    padding-bottom: 0;
}

.is-process-layout .app-main-wrapper {
    background: #fff;
}

.process-content .card {
    box-shadow: unset;
}

.process-content > .process-main-content {
    padding: 0;
}

/* one gap everywhere: between the columns as between the cards, so no wider channel runs down the page */
.process-content > .process-side-column {
    padding-left: 0.75rem;
}

.process-content .process-view-accordion {
    gap: 0.75rem;
}

/* Form section header */
.process-view-form-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--backend-process-border, #c7d3df);
    background: linear-gradient(135deg, rgba(44, 109, 158, 0.06) 0%, rgba(44, 109, 158, 0.02) 100%);
}

.process-view-form-header-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(44, 109, 158, 0.12);
    color: var(--backend-process-accent, #2c6d9e);
    margin-top: 0.1rem;
}

.process-view-form-header-body {
    flex: 1;
    min-width: 0;
}

.process-view-form-header-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--backend-process-heading, #1f3448);
    margin: 0 0 0.2rem;
}

.process-view-form-header-text {
    font-size: 0.88rem;
    color: var(--backend-process-muted, #667a90);
    line-height: 1.45;
}

.process-view-form-header-action {
    flex-shrink: 0;
}

@media (max-width: 767.98px) {
    .process-view-form-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .process-view-form-header-action {
        width: 100%;
    }
    .process-view-form-header-action .btn {
        width: 100%;
    }
}

.process-view-products-panel,
.process-view-panel {
    overflow: hidden;
}

/* the step's sections are cards already: the panel holding them only groups them, so a card is not
   drawn around cards and the sections line up with the accordions above the panel */
.process-step-panel.process-view-panel {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
}

.process-view-head,
.process-view-section-head {
    align-items: center;
}

.process-view-progress {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
    align-items: center;
}

.process-view-accordion {
    display: grid;
    gap: 0.5rem;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}

.process-view-accordion-item {
    overflow: hidden;
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.process-view-accordion-item:first-child {
    border-top: 0;
}

.process-view-accordion-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.process-view-accordion .accordion-button {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.875rem 1.25rem;
    background: transparent;
    color: #18365a;
    box-shadow: none;
}

.process-view-accordion .accordion-button:hover {
    background: #f8f9fa;
}

.process-view-accordion .accordion-button:not(.collapsed),
.process-view-accordion .accordion-item .accordion-button:not(.collapsed),
.process-view-accordion .accordion-header .accordion-button:not(.collapsed) {
    background: #f8f9fa !important;
    color: #18365a !important;
    border-bottom: 1px solid #e9ecef !important;
    box-shadow: none !important;
}

.process-view-accordion .accordion-button:not(.collapsed) .process-view-accordion-title,
.process-view-accordion .accordion-item .accordion-button:not(.collapsed) .process-view-accordion-title,
.process-view-accordion .accordion-header .accordion-button:not(.collapsed) .process-view-accordion-title {
    color: #18365a !important;
}

.process-view-accordion .accordion-button::after {
    width: 1.5rem;
    height: 1.5rem;
    margin-left: auto;
    border-radius: 999px;
    background-color: #f1f3f5;
    background-position: center;
    background-size: 0.7rem;
}

.process-view-accordion .accordion-button:not(.collapsed)::after {
    background-color: #e9ecef;
    filter: none;
}

.process-view-accordion-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: #e9ecef;
    color: #495057;
    font-size: 0.8rem;
    font-weight: 600;
    flex: 0 0 auto;
}

.process-view-accordion-badge i {
    font-size: 0.75rem;
}

.process-view-accordion .accordion-button:not(.collapsed) .process-view-accordion-badge {
    background: #0d6efd;
    color: #fff;
    box-shadow: none;
}

.process-view-accordion-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.process-view-accordion-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.35;
}

.process-view-accordion-status {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #d1e7dd;
    color: #0f5132;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.process-view-accordion-body {
    padding: 1rem 1.25rem;
    background: #fff;
}

/* the comments panel shows the start of the latest comments; "View all" opens the whole trail */
.stage-comment-trail-item {
    --comment-accent: #6c757d;
    --comment-tint: #f4f5f7;
    margin-bottom: 1rem;
    overflow-wrap: anywhere;
}

.stage-comment-trail-item:last-child {
    margin-bottom: 0;
}

.stage-comment-return { --comment-accent: #b58105; --comment-tint: #fff8e6; }
.stage-comment-reject { --comment-accent: #dc3545; --comment-tint: #fdeeef; }
.stage-comment-recommendation,
.stage-comment-test { --comment-accent: #0a8fa8; --comment-tint: #e9f8fb; }
.stage-comment-approval { --comment-accent: #0d6efd; --comment-tint: #edf3ff; }

/* who said it and when, then where along the application */
.stage-comment-head {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin-bottom: .5rem;
}

.stage-comment-avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--comment-tint);
    color: var(--comment-accent);
    font-weight: 700;
    font-size: .85rem;
}

.stage-comment-who {
    min-width: 0;
    flex: 1 1 auto;
}

.stage-comment-author {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0 .5rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
}

.stage-comment-time {
    font-weight: 400;
    font-size: .8rem;
    color: #6c757d;
    white-space: nowrap;
}

.stage-comment-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .15rem .4rem;
    margin-top: .1rem;
    font-size: .8rem;
    color: #6c757d;
}

/* a dot between the step and what happened there; the tag before them needs none */
.stage-comment-context > span:not(.stage-comment-label) + span::before {
    content: "·";
    margin-right: .4rem;
}

.stage-comment-label {
    padding: .05rem .45rem;
    border-radius: 1rem;
    background: var(--comment-tint);
    color: var(--comment-accent);
    font-weight: 600;
    font-size: .75rem;
}

.stage-comment-stage-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: #adb5bd;
    text-underline-offset: 2px;
}

.stage-comment-stage-link:hover {
    color: #0d6efd;
    text-decoration-color: currentColor;
}

.stage-comment-stage-link .fa-external-link-alt {
    font-size: .65rem;
    margin-left: .15rem;
}

/* what was said: the part to read */
.stage-comment-text {
    padding: .6rem .8rem;
    border-left: 3px solid var(--comment-accent);
    border-radius: 0 .4rem .4rem 0;
    background: var(--comment-tint);
    color: #212529;
    font-size: .95rem;
    line-height: 1.5;
}

.stage-comment-text > :last-child {
    margin-bottom: 0;
}

/* three lines, ending in an ellipsis where the browser can; cut at their height where it cannot */
.stage-comment-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    max-height: calc(4.5em + 1.2rem);
    overflow: hidden;
}

/* under the side panel's preview: the way to the whole trail, and how much of it is this step's */
.stage-comment-more {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    margin-top: .5rem;
}

.stage-comment-own-count {
    font-size: .8rem;
    color: #6c757d;
}

.stage-comment-day {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.25rem 0 .75rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #6c757d;
}

.stage-comment-day::after {
    content: "";
    flex: 1 1 auto;
    border-top: 1px solid #dee2e6;
}

.stage-comment-day:first-child {
    margin-top: 0;
}

/* records other components keep on a step, a row each which opens to the record */
.process-attached-components {
    display: grid;
    gap: 0.6rem;
}

.process-attached-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.process-attached-list {
    display: grid;
    gap: 0.5rem;
}

.process-attached-list .process-view-accordion-item:first-child {
    border-top: 1px solid #e9ecef;
}

.process-attached-kind {
    display: block;
    color: var(--clr-muted);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.process-attached-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.process-attached-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
}

@media (max-width: 767.98px) {
    .process-attached-chips .application-meta-chip:not(.process-attached-status) {
        display: none;
    }
}

@media (max-width: 767.98px) {

    .process-view-head,
    .process-view-section-head {
        align-items: stretch;
    }

    .process-view-progress {
        justify-content: flex-start;
    }

    .process-view-accordion .accordion-button {
        padding: 0.85rem 0.9rem;
        gap: 0.6rem;
    }

    .process-view-accordion-status {
        display: none;
    }

    .process-view-accordion-body {
        padding: 0.9rem;
    }
}

@media (max-width: 767.98px) {
    .process-form-head-compact {
        align-items: stretch;
    }

    .process-form-title-row {
        align-items: flex-start;
    }

    .process-form-tabs-compact .nav-link {
        min-width: 9.5rem;
    }

    .process-form-foot-compact .process-inline-actions {
        justify-content: stretch;
    }

    .process-form-foot-compact .btn {
        flex: 1 1 auto;
    }
}

.extension-shell {
    display: grid;
    gap: 0.75rem;
}

.extension-panel {
    overflow: hidden;
}

.extension-head {
    align-items: center;
}

.extension-alert {
    border-radius: var(--radius-lg);
}

.extension-summary-panel,
.extension-detail-panel {
    padding: 1rem 1.05rem;
}

.extension-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.extension-summary-label {
    color: #5b718c;
    font-weight: 700;
}

.extension-summary-value {
    color: #173453;
    font-weight: 700;
}

.extension-foot {
    min-height: 0;
}

.extension-foot .process-inline-actions {
    width: 100%;
    justify-content: flex-end;
}

@media (max-width: 767.98px) {

    .extension-head,
    .extension-summary-row {
        align-items: stretch;
        flex-direction: column;
    }

    .extension-foot .process-inline-actions {
        justify-content: flex-start;
    }

    .extension-foot .btn {
        flex: 1 1 auto;
    }
}

.signature-shell {
    display: grid;
    gap: 0.75rem;
}

.signature-panel {
    overflow: hidden;
}

.signature-note {
    border: 1px solid #dce7f4;
    background: linear-gradient(180deg, #f8fbfe 0%, #f1f7ff 100%);
}

.signature-note-danger {
    border-color: #efc2c9;
    background: linear-gradient(180deg, #fff7f8 0%, #fff0f2 100%);
    color: #8f2335;
}

.signature-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.05rem;
    border: 1px solid #dce6f3;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.signature-profile-art {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 5.5rem;
    min-width: 5.5rem;
    height: 5.5rem;
    border-radius: var(--radius-lg);
    background: #f8fbfe;
    border: 1px solid #dce6f3;
}

.signature-profile-art img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.signature-profile-label {
    color: #5b718c;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}

.signature-profile-name {
    color: #173453;
    font-weight: 700;
}

.signature-profile-role {
    color: #5b718c;
}

.signature-pdf-shell {
    border: 1px solid #dce6f3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

/* Signature stage: who signs, and whether the document was read, beside the decisions */
.signature-signer {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.signature-signer-art {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 42px;
    padding: 2px 4px;
    border: 1px solid #dce6f3;
    border-radius: 6px;
    background: #f8fbfe;
}

.signature-signer-art img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.signature-signer-copy {
    min-width: 0;
    line-height: 1.3;
}

.signature-signer-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.signature-signer-name {
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.signature-signer-role {
    color: #64748b;
    font-weight: 400;
}

.signature-context-muted {
    color: #64748b;
    font-weight: 400;
}

.signature-context-comment {
    flex: 1 1 100%;
}

@media (max-width: 767.98px) {
    .signature-profile {
        align-items: stretch;
        flex-direction: column;
    }
}

.basic-process-shell,
.subdocument-shell,
.review-shell {
    display: grid;
    gap: 0.75rem;
}

.basic-process-panel,
.subdocument-panel,
.review-panel,
.review-status-panel {
    overflow: hidden;
}

.basic-process-head,
.subdocument-head,
.review-head {
    align-items: center;
}

.subdocument-detail {
    border: 1px solid #dce6f3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.basic-process-detail,
.subdocument-detail {
    padding: 1rem 1.05rem;
}

.review-status-note {
    border: 1px solid #dce7f4;
}

.review-status-success {
    background: linear-gradient(180deg, #f0fbf5 0%, #e7f7ee 100%);
    color: #176b45;
}

.review-status-danger {
    background: linear-gradient(180deg, #fff7f8 0%, #fff0f2 100%);
    color: #8f2335;
}

.review-status-info {
    background: linear-gradient(180deg, #f8fbfe 0%, #f1f7ff 100%);
    color: #234666;
}

.review-tab-pane {
    padding-top: 0.5rem;
}

.review-checklist {
    margin-bottom: 0;
    color: #173453;
}

.review-checklist ul {
    margin-top: 0.35rem;
}

@media (max-width: 767.98px) {

    .basic-process-head,
    .subdocument-head,
    .review-head {
        align-items: stretch;
    }

}

.inspection-summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.inspection-summary-card,
.review-support-item,
.review-support-row {
    border: 1px solid #d7e4f4;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    padding: 14px 16px;
}

.inspection-summary-label,
.review-support-label {
    display: block;
    color: #6b7a90;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.inspection-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.inspection-form-grid-tight {
    align-items: start;
}

.inspection-field-note {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.inspection-section-head,
.review-support-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.inspection-testing-card,
.review-support-panel {
    border-radius: 18px;
}

.review-support-shell,
.review-stage-shell {
    display: grid;
    gap: 16px;
}

.review-support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.review-support-stack {
    display: grid;
    gap: 12px;
}

.review-support-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
}

.review-support-table-wrap,
.inspection-table-wrap {
    border: 1px solid #d7e4f4;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.review-support-table thead th,
.inspection-table thead th {
    background: #eef5fc;
    border-bottom: 1px solid #d7e4f4;
    color: #33506f;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.review-support-table tbody td,
.inspection-table tbody td {
    vertical-align: middle;
}

.review-support-note {
    margin: 0;
}

.review-support-foot,
.inspection-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.review-terms-stack {
    display: grid;
    gap: 12px;
}

.review-term-card {
    border: 1px solid #d7e4f4;
    border-radius: 16px;
    background: #f8fbff;
    padding: 16px 18px;
}

.review-term-title {
    margin: 0 0 8px;
    color: #1f3b57;
    font-size: 16px;
    font-weight: 700;
}

.review-term-content {
    color: #44556b;
    line-height: 1.6;
}

.review-stage-accordion .accordion-item {
    margin-bottom: 14px;
}

.review-stage-content {
    display: grid;
    gap: 16px;
}

@media (max-width: 767px) {

    .review-support-foot,
    .inspection-foot,
    .inspection-section-head,
    .review-support-head {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS — Unified design system
   All visual values flow from these variables.
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* ── Palette ── */
    --clr-primary: #245f8f;
    --clr-primary-soft: #e8f0f6;
    --clr-primary-hover: #1d4f78;
    --clr-accent: #2c6d9e;

    --clr-success: #1f7a55;
    --clr-success-soft: #e8f4ee;
    --clr-warning: #9a6422;
    --clr-warning-soft: #fbf2e5;
    --clr-danger: #9d3b47;
    --clr-danger-soft: #faecef;

    /* ── Surfaces ── */
    --clr-bg: #edf1f5;
    --clr-surface: #ffffff;
    --clr-surface-alt: #f7f9fb;
    --clr-surface-raised: #ffffff;

    /* ── Borders ── */
    --clr-border: #c9d3de;
    --clr-border-strong: #a8b7c7;

    /* ── Text ── */
    --clr-heading: #111d2b;
    --clr-text: #2b3a4a;
    --clr-muted: #556575;

    /* ── Sidebar ── */
    --clr-sidebar: #0f2c50;
    --clr-sidebar-alt: #123c68;
    --clr-sidebar-text: #dbe8fb;
    --clr-sidebar-muted: #8aabc8;

    /* ── Typography scale ── */
    --fs-xs: 0.75rem;    /* 12px */
    --fs-sm: 0.8125rem;  /* 13px */
    --fs-base: 0.875rem; /* 14px */
    --fs-md: 1rem;       /* 16px */
    --fs-lg: 1.125rem;   /* 18px */
    --fs-xl: 1.25rem;    /* 20px */
    --fs-2xl: 1.5rem;    /* 24px */

    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* ── Spacing (4px grid) ── */
    --sp-1: 0.25rem;  /* 4px */
    --sp-2: 0.5rem;   /* 8px */
    --sp-3: 0.75rem;  /* 12px */
    --sp-4: 1rem;     /* 16px */
    --sp-5: 1.25rem;  /* 20px */
    --sp-6: 1.5rem;   /* 24px */
    --sp-8: 2rem;     /* 32px */

    /* ── Border Radius ── */
    --radius-sm: 0.375rem;  /* 6px  */
    --radius-md: 0.5rem;    /* 8px  */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 0.75rem;   /* 12px — tightened from 16px for enterprise feel */
    --radius-pill: 999px;

    /* ── Shadows ── */
    --shadow-sm: 0 1px 2px rgba(21, 38, 55, 0.04),
                0 1px 3px rgba(21, 38, 55, 0.06);
    --shadow-md: 0 4px 8px -2px rgba(21, 38, 55, 0.08),
                0 2px 4px -2px rgba(21, 38, 55, 0.04);
    --shadow-lg: 0 12px 24px -4px rgba(21, 38, 55, 0.12),
                0 4px 8px -2px rgba(21, 38, 55, 0.04);

    /* ── Legacy aliases (backward compat for process views) ── */
    --backend-process-bg: var(--clr-bg);
    --backend-process-surface: var(--clr-surface);
    --backend-process-surface-alt: var(--clr-surface-alt);
    --backend-process-border: var(--clr-border-strong);
    --backend-process-border-strong: #aebecd;
    --backend-process-heading: var(--clr-heading);
    --backend-process-text: var(--clr-text);
    --backend-process-muted: var(--clr-muted);
    --backend-process-accent: var(--clr-accent);
    --backend-process-accent-soft: var(--clr-primary-soft);
    --backend-process-success: var(--clr-success);
    --backend-process-success-soft: var(--clr-success-soft);
    --backend-process-warning: var(--clr-warning);
    --backend-process-warning-soft: var(--clr-warning-soft);
    --backend-process-danger: var(--clr-danger);
    --backend-process-danger-soft: var(--clr-danger-soft);
    --backend-process-shadow: var(--shadow-md);
}

body {
    background: var(--backend-process-bg);
}

.workspace-surface,
.process-step-panel,
.process-view-accordion-item,
.application-identity-card,
.subdocument-detail,
.review-term-card,
.review-support-item,
.review-support-row,
.inspection-summary-card,
.review-support-table-wrap,
.inspection-table-wrap {
    border-color: var(--backend-process-border);
    box-shadow: var(--backend-process-shadow);
}

.workspace-surface,
.process-step-panel {
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, var(--backend-process-surface) 0%, var(--backend-process-surface-alt) 100%);
}

.workspace-kicker,
.application-identity-label,
.inspection-summary-label,
.review-support-label,
.process-view-accordion-status,
.application-meta-chip,
.application-meta-chip-success {
    letter-spacing: 0.05em;
}

.workspace-title,
.process-view-accordion-title,
.review-term-title,
.process-main-title,
.process-step-head h4,
.process-view-head h4,
.process-view-section-head h4 {
    color: var(--backend-process-heading);
}

.workspace-subtitle,
.review-term-content,
.process-view-accordion-copy,
.process-inline-hint,
.inspection-field-note {
    color: var(--backend-process-muted);
}

.process-main-head,
.process-step-head,
.process-view-head,
.process-view-section-head,
.inspection-head,
.review-head,
.review-support-head,
.inspection-section-head,
.basic-process-head,
.subdocument-head {
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(174, 190, 205, 0.7);
}

.process-inline-actions {
    gap: 0.55rem;
}

.process-form-panel.process-step-panel,
.process-view-panel,
.process-view-products-panel,
.review-panel,
.review-status-panel,
.basic-process-panel,
.subdocument-panel,
.inspection-panel,
.inspection-modal-panel,
.review-support-panel,
.inspection-testing-card {
    padding: 0.95rem 1rem;
}

.process-detail-panel,
.basic-process-detail,
.subdocument-detail,
.process-view-accordion-body,
.application-products-panel,
.application-dependency-panel,
.application-link-document-panel {
    background: rgba(255, 255, 255, 0.78);
}

.process-inline-hint,
.review-status-note,
.inspection-note,
.review-support-note {
    border-width: 1px;
    border-style: solid;
    border-radius: var(--radius-md);
    background: #f3f7fb;
    border-color: #cfd9e3;
    color: var(--backend-process-text);
    box-shadow: none;
}

.review-status-success,
.process-review-chip.is-approved,
.process-view-accordion-status {
    background: var(--backend-process-success-soft);
    color: var(--backend-process-success);
    border-color: #bfd8c9;
}

.review-status-danger {
    background: var(--backend-process-danger-soft);
    color: var(--backend-process-danger);
    border-color: #e0b8c0;
}

.review-status-info,
.inspection-note,
.review-support-note {
    background: var(--backend-process-accent-soft);
    color: #29506b;
    border-color: #c5d7e4;
}

.application-meta-chip,
.process-view-accordion-badge {
    background: #e7edf3;
    color: #3f556b;
    border-color: #ccd7e2;
}

.application-meta-chip-success {
    background: var(--backend-process-success-soft);
    color: var(--backend-process-success);
    border-color: #bfd8c9;
}

.process-form-tabs .nav-tabs,
.tabs-x .nav-tabs {
    gap: 0.45rem;
    border-bottom:0;
}

.process-form-tabs .nav-tabs>li>a,
.tabs-x .nav-tabs>li>a {
    border-radius: 0.7rem;
    border: 1px solid #cad6e2;
    background: #f3f7fa;
}

.process-form-tabs .nav-tabs>li.active>a,
.process-form-tabs .nav-tabs>li.active>a:hover,
.process-form-tabs .nav-tabs>li.active>a:focus,
.tabs-x .nav-tabs>li.active>a,
.tabs-x .nav-tabs>li.active>a:hover,
.tabs-x .nav-tabs>li.active>a:focus {
    background: #e6f0f7;
    border-color: #91aec5;
    color: #244b67;
}

.process-view-accordion-item {
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* Bootstrap's accordion-flush squares the cards and drops their side borders; these sections are cards */
.process-view-accordion.accordion-flush > .process-view-accordion-item {
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
}

.process-view-accordion .accordion-button:not(.collapsed),
.process-view-accordion .accordion-item .accordion-button:not(.collapsed),
.process-view-accordion .accordion-header .accordion-button:not(.collapsed) {
    border-bottom-color: var(--clr-border) !important;
}

/* A section's answers read like the associated documents above them: the card is the only box, rows split by a thin line */
#accordionForm .process-view-accordion-body > .table {
    margin: 0;
    --bs-table-striped-bg: transparent;
    --bs-table-hover-bg: var(--clr-surface-alt);
}

#accordionForm .process-view-accordion-body > .table > tbody > tr.row {
    margin: 0;
}

#accordionForm .process-view-accordion-body > .table > tbody > tr > td {
    padding: 0.7rem 0.85rem;
    border-width: 1px 0 0;
    border-style: solid;
    border-color: #e9ecef;
    background: #fff;
    vertical-align: top;
}

/* lines go above the rows: hidden rows at the end leave no line under the last one shown */
#accordionForm .process-view-accordion-body > .table > tbody > tr:first-child > td {
    border-top-width: 0;
}

/* the label takes what it needs, the answer the rest */
#accordionForm .process-view-accordion-body > .table > tbody > tr > td.field-label {
    flex: 0 0 clamp(9rem, 30%, 15rem);
    max-width: none;
    text-align: left !important;
}

#accordionForm .process-view-accordion-body > .table > tbody > tr > td.field-label + td {
    flex: 1 1 0;
    max-width: none;
    min-width: 0;
}

/* one chosen item is not a list: no bullet, no list margins */
#accordionForm .process-view-accordion-body .value ul:has(> li:only-child) {
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (max-width: 575.98px) {
    #accordionForm .process-view-accordion-body > .table > tbody > tr > td.field-label,
    #accordionForm .process-view-accordion-body > .table > tbody > tr > td.field-label + td {
        flex: 0 0 100%;
    }

    #accordionForm .process-view-accordion-body > .table > tbody > tr > td.field-label {
        padding-bottom: 0.15rem;
        font-size: 0.85rem;
    }

    #accordionForm .process-view-accordion-body > .table > tbody > tr > td.field-label + td {
        padding-top: 0;
        border-top-width: 0;
    }
}

#accordionForm .process-view-accordion-body > .table > tbody > tr:hover > td {
    background: var(--clr-surface-alt);
}


/* the labels read like the column titles of the documents table: quieter than the answers */
#accordionForm .process-view-accordion-body > .table td.field-label strong {
    font-weight: 500;
    color: var(--clr-muted);
}

/* On the step page a card is marked out by its white surface and a soft shadow, not a line:
   gaps between cards are plain background, not two borders facing each other */
.process-content .process-view-accordion > .process-view-accordion-item {
    border: 0;
    box-shadow: 0 1px 2px rgba(16, 40, 70, 0.05), 0 2px 8px rgba(16, 40, 70, 0.06);
}

.process-content .process-view-accordion > .process-view-accordion-item:hover {
    box-shadow: 0 1px 3px rgba(16, 40, 70, 0.07), 0 4px 12px rgba(16, 40, 70, 0.08);
}

/* the stage's own bar at the head of the page is a card like the rest */
.process-content .stage-actions {
    border: 0;
    border-radius: var(--radius-md);
    box-shadow: 0 1px 2px rgba(16, 40, 70, 0.05), 0 2px 8px rgba(16, 40, 70, 0.06);
}

/* the sidebar is one panel: its parts follow each other, split by a thin line */
.process-content .process-view-accordion.process-sidebar-accordion {
    gap: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 40, 70, 0.05), 0 2px 8px rgba(16, 40, 70, 0.06);
}

.process-content .process-view-accordion.process-sidebar-accordion > .process-view-accordion-item,
.process-content .process-view-accordion.process-sidebar-accordion > .process-view-accordion-item:hover {
    border-radius: 0;
    box-shadow: none;
}

.process-content .process-view-accordion.process-sidebar-accordion > .process-view-accordion-item + .process-view-accordion-item {
    border-top: 1px solid var(--clr-border);
}

/* the sidebar cards keep the same side spacing as the cards beside them */
.process-sidebar-accordion .accordion-button {
    padding: 0.9rem 0.95rem !important;
}

.process-sidebar-accordion .accordion-body {
    padding: 0.9rem 0.95rem !important;
}

.process-view-accordion-item:hover {
    transform: none;
    border-color: var(--backend-process-border-strong);
    box-shadow: 0 10px 20px rgba(24, 42, 61, 0.08);
}

.process-view-accordion .accordion-button {
    padding: 0.9rem 0.95rem;
    color: var(--backend-process-heading);
}

.process-view-accordion .accordion-button:hover {
    background: rgba(227, 237, 245, 0.72);
}

.process-view-accordion .accordion-button:not(.collapsed),
.process-view-accordion .accordion-item .accordion-button:not(.collapsed),
.process-view-accordion .accordion-header .accordion-button:not(.collapsed) {
    background: linear-gradient(180deg, #dde9f2 0%, #edf3f8 100%) !important;
    color: #204562 !important;
    border-bottom: 1px solid rgba(93, 123, 148, 0.28) !important;
    box-shadow: none !important;
}

.process-view-accordion .accordion-button:not(.collapsed) .process-view-accordion-title,
.process-view-accordion .accordion-item .accordion-button:not(.collapsed) .process-view-accordion-title,
.process-view-accordion .accordion-header .accordion-button:not(.collapsed) .process-view-accordion-title {
    color: #204562 !important;
}

.process-view-accordion .accordion-button::after {
    width: 1.65rem;
    height: 1.65rem;
    background-color: #e4ebf2;
}

.process-view-accordion .accordion-button:not(.collapsed)::after {
    background-color: #cfdce8;
}

.process-view-accordion-badge {
    width: 1.85rem;
    height: 1.85rem;
    box-shadow: none;
}

.process-view-accordion .accordion-button:not(.collapsed) .process-view-accordion-badge {
    background: #2c6d9e;
}

.review-support-table thead th,
.inspection-table thead th,
.application-shared-table thead th {
    background: #e8eff5;
    color: #35506a;
    border-bottom-color: #cad5e0;
}

.review-support-table tbody tr:nth-child(even),
.inspection-table tbody tr:nth-child(even),
.application-shared-table tbody tr:nth-child(even) {
    background: rgba(244, 248, 251, 0.8);
}

.review-support-table tbody td,
.inspection-table tbody td,
.application-shared-table tbody td {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

.inspection-summary-row,
.review-support-grid,
.application-identity-grid {
    gap: 0.7rem;
}

.inspection-summary-card,
.review-support-item,
.review-support-row,
.application-identity-card,
.review-term-card {
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.review-support-row,
.review-support-item,
.inspection-summary-card {
    padding: 12px 14px;
}

.review-stage-content,
.review-support-shell,
.review-stage-shell,
.inspection-shell,
.basic-process-shell,
.subdocument-shell,
.review-shell,
.process-form-shell,
.process-view-shell {
    gap: 0.8rem;
}

.modal-content {
    border: 1px solid #d0d9e8;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(10, 26, 50, 0.18), 0 8px 18px rgba(10, 26, 50, 0.08);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(180deg, #f6f8fb 0%, #eef2f7 100%);
    border-bottom: 1px solid #d8e0ec;
    padding: 0.9rem 1.15rem;
}

.modal-title {
    color: #17324d;
    font-size: 0.96rem;
    font-weight: 700;
}

.modal-footer {
    background: #f6f8fb;
    border-top: 1px solid #d8e0ec;
}

@media (max-width: 767.98px) {

    .process-form-panel.process-step-panel,
    .process-view-panel,
    .process-view-products-panel,
    .review-panel,
    .review-status-panel,
    .basic-process-panel,
    .subdocument-panel,
    .inspection-panel,
    .inspection-modal-panel,
    .review-support-panel,
    .inspection-testing-card {
        padding: 0.85rem;
    }
}

.backend-admin-theme {
    --admin-shell-bg: var(--clr-bg);
    --admin-shell-surface: var(--clr-surface);
    --admin-shell-surface-alt: var(--clr-surface-alt);
    --admin-shell-border: var(--clr-border);
    --admin-shell-border-strong: var(--clr-border-strong);
    --admin-shell-heading: var(--clr-heading);
    --admin-shell-text: var(--clr-text);
    --admin-shell-muted: var(--clr-muted);
    --admin-shell-accent: var(--clr-primary);
    --admin-shell-accent-soft: var(--clr-primary-soft);
    --admin-shell-sidebar: var(--clr-sidebar);
    --admin-shell-sidebar-alt: var(--clr-sidebar-alt);
    --admin-shell-sidebar-text: var(--clr-sidebar-text);
    --admin-shell-sidebar-muted: var(--clr-sidebar-muted);
    --admin-shell-success: var(--clr-success);
    --admin-shell-warning: var(--clr-warning);
    --admin-shell-danger: var(--clr-danger);
    --admin-shell-shadow: var(--shadow-md);
}

.backend-admin-theme body,
body.backend-admin-theme {
    background: var(--admin-shell-bg);
    color: var(--admin-shell-text);
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.backend-admin-shell {
    min-height: 100vh;
    background: linear-gradient(180deg, #f4f7fa 0%, #edf1f5 100%);
}

.backend-admin-sidebar {
    background: linear-gradient(180deg, var(--admin-shell-sidebar) 0%, var(--admin-shell-sidebar-alt) 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.backend-admin-brand {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.backend-admin-brand .brand-link {
    min-height: 68px;
    padding: 0.95rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.backend-admin-brand .brand-image {
    width: 2.25rem;
    max-height: 2.25rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.2rem;
}

.backend-admin-brand .brand-text {
    color: #fff;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
}

.backend-admin-nav {
    padding: 0.25rem 0.7rem 1rem;
}

.backend-admin-sidebar .nav-header,
.backend-admin-sidebar .sidebar-menu>li>a,
.backend-admin-sidebar .nav-link,
.backend-admin-sidebar .nav-icon,
.backend-admin-sidebar .nav-treeview>.nav-item>.nav-link {
    color: var(--admin-shell-sidebar-text);
}

.backend-admin-sidebar .nav-header {
    padding: 0.8rem 0.9rem 0.45rem;
    color: var(--admin-shell-sidebar-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.backend-admin-sidebar .nav-link {
    border-radius: var(--radius-md);
    margin-bottom: 0.15rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.8125rem;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.backend-admin-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e8f0f8;
}

.backend-admin-sidebar .nav-link.active,
.backend-admin-sidebar .nav-item.menu-open>.nav-link {
    background: rgba(99, 148, 210, 0.12);
    color: #fff;
    box-shadow: inset 3px 0 0 #5b9bd5;
}

.backend-admin-sidebar .nav-link.active {
    font-weight: 600;
}

.backend-admin-sidebar .nav-icon {
    width: 1.25rem;
    font-size: 0.875rem;
    text-align: center;
    opacity: 0.7;
    transition: opacity 0.18s ease;
}

.backend-admin-sidebar .nav-link:hover .nav-icon,
.backend-admin-sidebar .nav-link.active .nav-icon {
    opacity: 1;
}

.backend-admin-sidebar .nav-treeview {
    position: relative;
    padding: 0.2rem 0 0.35rem 0.45rem;
    margin-left: 1.35rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.backend-admin-sidebar .nav-treeview .nav-link {
    padding: 0.45rem 0.75rem;
    font-size: 0.8125rem;
    color: #9aacbd;
}

.backend-admin-sidebar .nav-treeview .nav-link:hover,
.backend-admin-sidebar .nav-treeview .nav-link.active {
    color: #fff;
}

.backend-admin-main {
    background: transparent !important;
    min-height: 100vh;
}

.backend-admin-header {
    position: sticky;
    top: 0;
    z-index: 1035;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--admin-shell-border);
    box-shadow: 0 1px 3px rgba(21, 38, 55, 0.04), 0 1px 0 rgba(255, 255, 255, 0.65);
}

.backend-admin-header-bar {
    min-height: 68px;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
}

.backend-admin-mobile-tools {
    transition: max-height 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 767.98px) {
    .backend-admin-header-bar {
        min-height: 56px;
        padding-left: 0.7rem;
        padding-right: 0.7rem;
        gap: 0.35rem;
        flex-wrap: wrap;
    }

    .backend-admin-mobile-tools {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        padding-top: 0;
    }

    .backend-admin-mobile-tools.is-open {
        max-height: 120px;
        opacity: 1;
        padding-top: 0.35rem;
        border-top: 1px solid var(--admin-shell-border);
        /* The collapsed bar clips itself; once open, the notification and
           account dropdowns have to be able to escape it, or their items
           (including Logout) are invisible and untappable. */
        overflow: visible;
    }

    /* Popper anchors these to their icon, which pushes a 360px notification
       panel off the left edge. Make the sticky header the positioned ancestor
       so they drop as a full-width sheet beneath it instead. */
    .backend-admin-header .nav-item.dropdown {
        position: static;
    }

    .backend-admin-header .dropdown-menu.show {
        position: absolute !important;
        inset: auto !important;
        top: 100% !important;
        right: 0.5rem !important;
        bottom: auto !important;
        left: 0.5rem !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        transform: none !important;
    }

    /* Long lists scroll instead of running off the bottom of the screen */
    .backend-notification-list {
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .backend-admin-user-menu .dropdown-menu {
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .backend-admin-mobile-tools .nav-link {
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

.backend-admin-header .nav-link {
    color: var(--admin-shell-heading);
    border-radius: 0.7rem;
    padding: 0.55rem 0.75rem;
}

.backend-admin-header .nav-link:hover,
.backend-admin-header .nav-link:focus {
    background: var(--admin-shell-accent-soft);
    color: var(--admin-shell-accent);
}

.backend-admin-header .nav-link:focus-visible,
.backend-admin-user-menu > .nav-link:focus-visible {
    outline: 2px solid rgba(36, 95, 143, 0.45);
    outline-offset: 2px;
}

.backend-admin-user-menu>.nav-link {
    border: 1px solid var(--admin-shell-border);
    background: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

.backend-admin-content {
    background: transparent;
}

.backend-admin-content-inner {
    display: grid;
    gap: 1rem;
    padding: 1rem 1rem 1.2rem;
}

.backend-admin-banner,
.backend-admin-flash .alert {
    margin: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--admin-shell-shadow);
}

/* a notice kept to one line: the page under it starts almost where it does without it */
.backend-admin-banner.backend-admin-banner-slim {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: none;
}

.backend-admin-banner-slim .backend-admin-banner-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backend-admin-banner-slim .alert-link {
    flex: none;
    white-space: nowrap;
}

.backend-admin-context-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-md);
}

.backend-admin-context-toggle-item {
    display: none;
}

.backend-admin-context-collapse {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--admin-shell-border);
    border-radius: 999px;
    background: #f4f8fb;
    color: var(--admin-shell-muted);
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.backend-admin-context-collapse:hover {
    background: #eef5fa;
    border-color: rgba(36, 95, 143, 0.18);
    color: var(--admin-shell-heading);
}

@media (min-width: 768px) {
    .backend-context-bar-hidden .backend-admin-context-bar {
        display: none;
    }

    .backend-context-bar-hidden .backend-admin-context-toggle-item {
        display: block;
    }
}

.backend-admin-context-office {
    min-width: 0;
}

.backend-admin-context-kicker {
    margin-bottom: 0.35rem;
    color: var(--admin-shell-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.backend-admin-context-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
    gap: 0.65rem;
}

.backend-admin-context-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.6rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: 999px;
    background: #f4f8fb;
    color: var(--admin-shell-heading);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.backend-admin-context-link:hover {
    background: #eef5fa;
    border-color: rgba(36, 95, 143, 0.18);
    color: var(--admin-shell-heading);
    transform: translateY(-1px);
}

.backend-admin-context-link.is-active {
    background: linear-gradient(180deg, #245f8f 0%, #1f537b 100%);
    border-color: rgba(36, 95, 143, 0.28);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(36, 95, 143, 0.16);
}

.backend-admin-context-link i {
    color: var(--admin-shell-accent);
}

.backend-admin-context-link.is-active i {
    color: #ffffff;
}

.backend-admin-context-link.is-danger {
    background: #fdf1f2;
    border-color: rgba(220, 53, 69, 0.35);
    color: #b02a37;
}

.backend-admin-context-link.is-danger:hover {
    background: #fbe4e6;
    border-color: rgba(220, 53, 69, 0.55);
    color: #b02a37;
}

.backend-admin-context-link.is-danger i {
    color: #dc3545;
}

.backend-admin-context-link.is-danger .backend-admin-context-badge {
    background: #dc3545;
}

.backend-admin-context-link.is-danger.is-active {
    background: linear-gradient(180deg, #dc3545 0%, #b02a37 100%);
    border-color: rgba(220, 53, 69, 0.4);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(220, 53, 69, 0.18);
}

.backend-admin-context-link.is-danger.is-active i {
    color: #ffffff;
}

.backend-admin-context-link.is-danger.is-active .backend-admin-context-badge {
    background: #ffffff;
    color: #b02a37;
}

.backend-admin-context-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--admin-shell-accent, #245f8f);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.backend-admin-context-link.is-active .backend-admin-context-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* The role the user holds in the current office, shown inside the office pill
   so the two always read as one fact rather than two competing labels. */
.backend-admin-office-role {
    margin-left: 0.5rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--admin-shell-border);
    color: var(--admin-shell-muted);
    font-weight: 500;
}

.backend-admin-office {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--admin-shell-heading);
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 6px 14px rgba(21, 38, 55, 0.04);
}

.backend-page-shell {
    display: grid;
    gap: 1rem;
    padding: 0.1rem 0 0;
}

.backend-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.05rem;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-xl);
    background: var(--clr-surface-raised);
    box-shadow: var(--shadow-md);
}

.backend-page-head-main {
    min-width: 0;
    display: grid;
    gap: 0.4rem;
}

.backend-page-breadcrumbs {
    min-width: 0;
}

.backend-page-kicker {
    color: var(--admin-shell-muted);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.backend-page-title,
.backend-page-breadcrumbs .breadcrumb,
.backend-page-breadcrumbs .breadcrumb a,
.backend-page-breadcrumbs .breadcrumb-item.active {
    color: var(--admin-shell-heading);
}

.backend-page-title {
    margin: 0;
    font-size: clamp(1.45rem, 2vw, 1.8rem);
    font-weight: var(--fw-semibold);
    line-height: 1.2;
}

.backend-page-summary {
    max-width: 70ch;
    color: var(--admin-shell-muted);
    line-height: 1.55;
}

.backend-page-breadcrumbs .breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    background: transparent;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
}

.backend-page-breadcrumbs .breadcrumb-item {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.backend-page-breadcrumbs .breadcrumb-item+.breadcrumb-item {
    padding-left: 0;
}

.backend-page-breadcrumbs .breadcrumb-item+.breadcrumb-item::before {
    float: none;
    padding-right: 0.35rem;
    color: var(--clr-muted);
}

.backend-page-breadcrumbs .breadcrumb a,
.backend-page-breadcrumbs .breadcrumb-item.active {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.backend-page-breadcrumbs .breadcrumb a {
    color: var(--admin-shell-muted);
    text-decoration: none;
}

.backend-page-breadcrumbs .breadcrumb a:hover {
    color: var(--admin-shell-heading);
}

.backend-page-breadcrumbs .breadcrumb-item.active {
    color: var(--admin-shell-heading);
}

.backend-page-actions-wrap {
    display: flex;
    justify-content: flex-end;
}

.backend-page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.6rem;
}

.backend-page-actions > .btn,
.backend-page-actions .btn-group,
.backend-page-actions .btn-toolbar {
    margin: 0;
}

.backend-page-surface {
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--shadow-md);
    padding: 0.45rem 0.55rem;
}

/* Flush table surfaces — remove padding when page surface directly wraps a grid */

.backend-page-body {
    padding: 0;
}

.backend-page-surface-flush {
    padding: 0;
}

.backend-page-body-flush {
    padding: 0;
}

.backend-page-surface.card {
    box-shadow: var(--admin-shell-shadow);
}

.backend-admin-footer {
    padding: 0.85rem 1.1rem 1rem;
    color: var(--admin-shell-muted);
    background: transparent !important;
    border-top: 1px solid rgba(188, 201, 213, 0.55);
}

.backend-admin-footer a {
    color: var(--admin-shell-heading);
    text-decoration: none;
}

.backend-admin-theme .dropdown-menu {
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 32px rgba(24, 42, 61, 0.12);
}

.backend-admin-theme .card,
.backend-admin-theme .modal-content,
.backend-admin-theme .alert,
.backend-admin-theme .table,
.backend-admin-theme .form-control,
.backend-admin-theme .form-select {
    border-color: var(--admin-shell-border);
}

.backend-admin-theme .card,
.backend-admin-theme .form-control,
.backend-admin-theme .form-select {
    box-shadow: none;
}

.backend-admin-theme .form-control,
.backend-admin-theme .form-select {
    border-radius: var(--radius-md);
    min-height: 42px;
}

.backend-admin-theme .form-control:focus,
.backend-admin-theme .form-select:focus {
    border-color: var(--clr-accent);
    box-shadow: 0 0 0 0.2rem rgba(36, 95, 143, 0.12);
}

@media (max-width: 991.98px) {
    .backend-page-head {
        flex-direction: column;
        align-items: stretch;
        padding: 0.95rem;
    }

    .backend-page-actions-wrap,
    .backend-page-actions {
        justify-content: flex-start;
    }

    .backend-admin-content-inner {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .backend-admin-context-bar {
        position: relative;
        flex-direction: column;
        align-items: stretch;
        padding-right: 3.4rem;
    }

    .backend-admin-context-actions {
        justify-content: flex-start;
        margin-left: 0;
    }

    .backend-admin-context-collapse {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
    }
}

/* A link keeps focus after a click (e.g. collapsing a group). AdminLTE colours a
   focused link with its light-theme --lte-sidebar-color, which is dark on our dark
   sidebar, so give AdminLTE our sidebar colours. */
.app-sidebar.backend-admin-sidebar {
    --lte-sidebar-color: var(--admin-shell-sidebar-text);
    --lte-sidebar-hover-color: #ffffff;
    --lte-sidebar-active-color: #ffffff;
    --lte-sidebar-menu-active-color: #ffffff;
    --lte-sidebar-submenu-color: #9aacbd;
    --lte-sidebar-submenu-hover-color: #ffffff;
    --lte-sidebar-submenu-active-color: #ffffff;
    --lte-sidebar-header-color: var(--admin-shell-sidebar-muted);
}

.backend-admin-sidebar .nav-link:focus,
.backend-admin-sidebar .nav-link:focus p,
.backend-admin-sidebar .nav-link:focus .nav-icon,
.backend-admin-sidebar .nav-link:focus .right {
    color: var(--admin-shell-sidebar-text);
}

.backend-admin-sidebar .nav-treeview .nav-link:focus,
.backend-admin-sidebar .nav-treeview .nav-link:focus p {
    color: #9aacbd;
}

.backend-admin-sidebar .nav-link:hover,
.backend-admin-sidebar .nav-link:hover p,
.backend-admin-sidebar .nav-link:hover span,
.backend-admin-sidebar .nav-link:hover .nav-icon,
.backend-admin-sidebar .nav-link:hover .right,
.backend-admin-sidebar .nav-link:hover .bi,
.backend-admin-sidebar .nav-link:hover .far,
.backend-admin-sidebar .nav-link:hover .fas,
.backend-admin-sidebar .nav-link.active,
.backend-admin-sidebar .nav-link.active p,
.backend-admin-sidebar .nav-link.active span,
.backend-admin-sidebar .nav-link.active .nav-icon,
.backend-admin-sidebar .nav-link.active .right,
.backend-admin-sidebar .nav-item.menu-open>.nav-link,
.backend-admin-sidebar .nav-item.menu-open>.nav-link p,
.backend-admin-sidebar .nav-item.menu-open>.nav-link span,
.backend-admin-sidebar .nav-item.menu-open>.nav-link .nav-icon,
.backend-admin-sidebar .nav-item.menu-open>.nav-link .right {
    color: #ffffff !important;
}

.backend-admin-sidebar .nav-treeview .nav-link:hover,
.backend-admin-sidebar .nav-treeview .nav-link:hover p,
.backend-admin-sidebar .nav-treeview .nav-link:hover span,
.backend-admin-sidebar .nav-treeview .nav-link:hover .nav-icon,
.backend-admin-sidebar .nav-treeview .nav-link.active,
.backend-admin-sidebar .nav-treeview .nav-link.active p,
.backend-admin-sidebar .nav-treeview .nav-link.active span,
.backend-admin-sidebar .nav-treeview .nav-link.active .nav-icon {
    color: #ffffff !important;
}

.backend-admin-theme .grid-view,
.backend-admin-theme .table-responsive,
.backend-admin-theme .kv-grid-table,
.backend-admin-theme .table {
    border-radius: var(--radius-lg);
}

.backend-admin-theme .grid-view {
    background: #ffffff;
}

.backend-admin-theme .grid-view .summary,
.backend-admin-theme .dataTables_wrapper .dataTables_info {
    margin-bottom: 0.65rem;
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.backend-admin-theme .table-responsive,
.backend-admin-theme .grid-view table,
.backend-admin-theme .kv-grid-table {
    overflow: hidden;
    border: 1px solid var(--clr-border);
    background: var(--clr-surface);
    box-shadow: var(--shadow-sm);
}

/* A collapsed table draws no border round rounded corners; keep the cells apart so the frame closes.
   The table draws the frame, the cells only the lines between rows (and columns, when bordered).
   A grid nested in a section's answer (a list of requirements) gets the same frame. */
.backend-admin-theme .grid-view table,
.backend-admin-theme .kv-grid-table,
.process-view-accordion-body td .table {
    border-collapse: separate;
    border-spacing: 0;
}

.process-view-accordion-body td .table {
    margin-bottom: 0;
    overflow: hidden;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
}

.backend-admin-theme .grid-view table > :not(caption) > tr > *,
.backend-admin-theme .kv-grid-table > :not(caption) > tr > *,
.process-view-accordion-body td .table > :not(caption) > tr > * {
    border-width: 0 0 1px 0;
}

.backend-admin-theme .grid-view table.table-bordered > :not(caption) > tr > * + *,
.backend-admin-theme .kv-grid-table.table-bordered > :not(caption) > tr > * + *,
.process-view-accordion-body td .table.table-bordered > :not(caption) > tr > * + * {
    border-left-width: 1px;
}

.backend-admin-theme .grid-view table > :not(caption):last-child > tr:last-child > *,
.backend-admin-theme .kv-grid-table > :not(caption):last-child > tr:last-child > *,
.process-view-accordion-body td .table > :not(caption):last-child > tr:last-child > * {
    border-bottom-width: 0;
}

/* Strip inner table border when already inside a bordered surface */
.backend-admin-module-surface .table-responsive,
.backend-admin-module-surface .kv-grid-table,
.backend-admin-module-surface .grid-view table,
.backend-page-surface .table-responsive,
.backend-page-surface .kv-grid-table,
.backend-page-surface .grid-view table,
.workspace-surface .table-responsive,
.workspace-surface .kv-grid-table,
.workspace-surface .process-detail-panel,
.process-view-accordion-item .table-responsive {
    border: none;
    box-shadow: none;
}

.backend-admin-theme .table,
.backend-admin-theme .grid-view table,
.backend-admin-theme .kv-grid-table {
    margin-bottom: 0;
    color: var(--admin-shell-text);
}

.backend-admin-theme .table thead,
.backend-admin-theme .grid-view table thead,
.backend-admin-theme .kv-grid-table thead {
    background: linear-gradient(180deg, #f6f6f6 0%, #e8e8e8 100%);
    border-bottom: 1px solid #c8c8c8;
}

.backend-admin-theme .table thead th,
.backend-admin-theme .grid-view table thead th,
.backend-admin-theme .kv-grid-table thead th {
    padding: 0.5rem 0.75rem;
    border: none;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    background: transparent;
    color: #4a4a4a;
    font-size: var(--fs-sm);
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    vertical-align: middle;
    white-space: nowrap;
}

.backend-admin-theme .table thead th:last-child,
.backend-admin-theme .grid-view table thead th:last-child,
.backend-admin-theme .kv-grid-table thead th:last-child {
    border-right: none;
}

.backend-admin-theme .table thead th a,
.backend-admin-theme .grid-view table thead th a,
.backend-admin-theme .kv-grid-table thead th a {
    color: #4a4a4a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.backend-admin-theme .table thead th a:hover,
.backend-admin-theme .grid-view table thead th a:hover,
.backend-admin-theme .kv-grid-table thead th a:hover {
    color: #1a1a1a;
}

.backend-admin-theme .table tbody td,
.backend-admin-theme .table tbody th,
.backend-admin-theme .grid-view table tbody td,
.backend-admin-theme .kv-grid-table tbody td {
    padding: 0.58rem 0.75rem;
    border-color: var(--clr-border);
    vertical-align: middle;
    font-size: var(--fs-base);
    color: var(--clr-heading);
    line-height: 1.45;
}

.backend-admin-theme .table tbody tr,
.backend-admin-theme .grid-view table tbody tr,
.backend-admin-theme .kv-grid-table tbody tr {
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.backend-admin-theme .table tbody tr:nth-child(even),
.backend-admin-theme .grid-view table tbody tr:nth-child(even),
.backend-admin-theme .kv-grid-table tbody tr:nth-child(even) {
    background: var(--clr-surface-alt);
}

.backend-admin-theme .table-hover tbody tr:hover,
.backend-admin-theme .grid-view table tbody tr:hover,
.backend-admin-theme .kv-grid-table tbody tr:hover {
    background: var(--clr-primary-soft);
}

.backend-admin-theme .grid-view table tbody tr.rowclicable,
.backend-admin-theme .kv-grid-table tbody tr.rowclicable {
    cursor: pointer;
}

.backend-admin-theme .grid-view table tbody tr.rowclicable:hover,
.backend-admin-theme .kv-grid-table tbody tr.rowclicable:hover {
    box-shadow: inset 3px 0 0 var(--admin-shell-accent);
}

.backend-admin-theme .table a,
.backend-admin-theme .grid-view table a {
    font-weight: 600;
}

.backend-admin-theme .pagination {
    gap: 0.35rem;
    margin-top: 0.9rem;
}

.backend-admin-theme .page-link {
    min-width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--admin-shell-border);
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--admin-shell-heading);
    font-weight: 600;
    box-shadow: none;
}

.backend-admin-theme .page-link:hover {
    background: var(--clr-primary-soft);
    border-color: var(--clr-border-strong);
    color: var(--clr-primary);
}

.backend-admin-theme .page-item.active .page-link {
    background: var(--admin-shell-accent);
    border-color: var(--admin-shell-accent);
    color: #fff;
}

.backend-admin-theme .page-item.disabled .page-link {
    background: var(--clr-surface-alt);
    color: var(--clr-muted);
}

@media (max-width: 767.98px) {

    .backend-admin-theme .table thead th,
    .backend-admin-theme .grid-view table thead th,
    .backend-admin-theme .kv-grid-table thead th,
    .backend-admin-theme .table tbody td,
    .backend-admin-theme .table tbody th,
    .backend-admin-theme .grid-view table tbody td,
    .backend-admin-theme .kv-grid-table tbody td {
        padding-left: 0.7rem;
        padding-right: 0.7rem;
    }
}

.backend-admin-theme form,
.backend-admin-theme .kv-editable-form,
.backend-admin-theme .search-form,
.backend-admin-theme .filters {
    color: var(--admin-shell-text);
}

.backend-admin-theme .form-group,
.backend-admin-theme .mb-3,
.backend-admin-theme .field-model,
.backend-admin-theme .field-search,
.backend-admin-theme .kv-fieldset-inline .form-group {
    margin-bottom: 0.95rem;
}

.backend-admin-theme label,
.backend-admin-theme .form-label,
.backend-admin-theme .control-label {
    margin-bottom: 0.4rem;
    color: var(--clr-text);
    font-size: var(--fs-sm);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.backend-admin-theme .help-block,
.backend-admin-theme .hint-block,
.backend-admin-theme .text-muted,
.backend-admin-theme .form-text,
.backend-admin-theme .help-inline {
    color: var(--admin-shell-muted) !important;
}

.backend-admin-theme textarea.form-control {
    min-height: 110px;
}

.backend-admin-theme .form-control,
.backend-admin-theme .form-select,
.backend-admin-theme .form-control-plaintext {
    border-radius: var(--radius-md);
    min-height: 42px;
    background: var(--clr-surface);
}

.backend-admin-theme .form-control::placeholder,
.backend-admin-theme .form-select::placeholder {
    color: var(--clr-muted);
}

.backend-admin-theme .form-control:focus,
.backend-admin-theme .form-select:focus {
    border-color: var(--clr-accent);
    box-shadow: 0 0 0 0.2rem rgba(36, 95, 143, 0.12);
}

.backend-admin-theme .input-group {
    border-radius: 0.75rem;
}

.backend-admin-theme .input-group>.form-control,
.backend-admin-theme .input-group>.form-select,
.backend-admin-theme .input-group>.input-group-text,
.backend-admin-theme .input-group>.btn {
    min-height: 42px;
}

.backend-admin-theme .input-group-text {
    border-color: var(--clr-border);
    background: var(--clr-surface-alt);
    color: var(--clr-muted);
}

.backend-admin-theme .select2-container {
    width: 100% !important;
}

/* An open dropdown hangs from the page itself: at full width it would run past the right edge and bring a scrollbar. */
.backend-admin-theme > .select2-container {
    width: auto !important;
}

.backend-admin-theme .select2-container .select2-selection--single,
.backend-admin-theme .select2-container .select2-selection--multiple {
    min-height: 42px;
    border: 1px solid var(--admin-shell-border);
    border-radius: 0.7rem;
}

.backend-admin-theme .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--admin-shell-text);
    line-height: 40px;
    padding-left: 0.85rem;
}

.backend-admin-theme .select2-container--default .select2-selection--multiple {
    padding: 0.25rem 0.35rem;
}

.backend-admin-theme .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-left: 0;
}

.backend-admin-theme .select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin-top: 0;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-pill);
    background: var(--clr-primary-soft);
    color: var(--clr-primary);
    padding: 0.22rem 0.6rem;
}

.backend-admin-theme .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 0.5rem;
}

.backend-admin-theme .select2-container--default.select2-container--focus .select2-selection--multiple,
.backend-admin-theme .select2-container--default.select2-container--focus .select2-selection--single,
.backend-admin-theme .select2-container--open .select2-selection--single,
.backend-admin-theme .select2-container--open .select2-selection--multiple {
    border-color: var(--clr-accent);
    box-shadow: 0 0 0 0.2rem rgba(36, 95, 143, 0.12);
}

.backend-admin-theme .select2-dropdown {
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 14px 28px rgba(24, 42, 61, 0.12);
}

.backend-admin-theme .select2-results__option {
    padding: 0.55rem 0.8rem;
}

.backend-admin-theme .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #2c6d9e;
}

.backend-admin-theme .select2-search--dropdown,
.backend-admin-theme .select2-search--inline {
    padding: 0.55rem;
}

.backend-admin-theme .select2-search--dropdown .select2-search__field,
.backend-admin-theme .select2-search--inline .select2-search__field {
    border: 1px solid var(--admin-shell-border);
    border-radius: 0.65rem;
}

.backend-admin-theme .card-header,
.backend-admin-theme .box-header {
    background: linear-gradient(180deg, #fbfcfd 0%, #f3f7fa 100%);
    border-bottom: 1px solid var(--admin-shell-border);
}

.backend-admin-theme .modal-header {
    background: linear-gradient(180deg, #f6f8fb 0%, #eef2f7 100%);
    border-bottom: 1px solid #d8e0ec;
}

.backend-admin-theme .card-header,
.backend-admin-theme .box-header {
    padding: 0.9rem 1rem;
}

.backend-admin-theme .card-title,
.backend-admin-theme .box-title,
.backend-admin-theme .modal-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
}

.backend-admin-theme .card-body,
.backend-admin-theme .box-body,
.backend-admin-theme .modal-body {
    padding: 1rem;
}

.backend-admin-theme .card-footer,
.backend-admin-theme .box-footer {
    background: #fbfcfd;
    border-top: 1px solid var(--admin-shell-border);
}

.backend-admin-theme .modal-footer {
    background: #f6f8fb;
    border-top: 1px solid #d8e0ec;
}

.backend-admin-theme .btn-toolbar,
.backend-admin-theme .toolbar,
.backend-admin-theme .kv-panel-before,
.backend-admin-theme .kv-panel-after {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.backend-admin-theme .kv-panel-before,
.backend-admin-theme .kv-panel-after {
    padding: 0.75rem 0;
}

.backend-admin-theme .filters td,
.backend-admin-theme .filters th,
.backend-admin-theme .grid-view .filters input,
.backend-admin-theme .grid-view .filters select {
    background: #f8fafc;
}

.backend-admin-theme .filters td {
    border-bottom: 1px solid #e0e8f0;
}

.backend-admin-theme .filters input,
.backend-admin-theme .filters select,
.backend-admin-theme .filters .form-control,
.backend-admin-theme .filters .form-select {
    min-height: 36px;
    border-radius: 0.65rem;
    border-color: rgba(21, 38, 55, 0.18);
    font-size: 0.88rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.backend-admin-theme .filters input:focus,
.backend-admin-theme .filters select:focus,
.backend-admin-theme .filters .form-control:focus,
.backend-admin-theme .filters .form-select:focus {
    border-color: var(--admin-shell-accent);
    box-shadow: 0 0 0 2px rgba(36, 95, 143, 0.1);
}

.backend-admin-theme .alert {
    border-radius: var(--radius-lg);
    border-width: 1px;
    box-shadow: 0 8px 18px rgba(21, 38, 55, 0.05);
}

.backend-admin-theme .alert-success {
    background: var(--clr-success-soft);
    color: var(--clr-success);
    border-color: #c8e3d4;
}

.backend-admin-theme .alert-warning {
    background: var(--clr-warning-soft);
    color: var(--clr-warning);
    border-color: #ead7bb;
}

.backend-admin-theme .alert-danger {
    background: var(--clr-danger-soft);
    color: var(--clr-danger);
    border-color: #e8c4ca;
}

.backend-admin-theme .alert-info,
.backend-admin-theme .alert-primary {
    background: var(--clr-primary-soft);
    color: var(--clr-primary);
    border-color: #c9d9e6;
}

.backend-admin-theme .badge,
.backend-admin-theme .label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.7rem;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.backend-admin-theme .badge.bg-success,
.backend-admin-theme .badge.text-bg-success,
.backend-admin-theme .label-success {
    background: var(--clr-success-soft) !important;
    color: var(--clr-success) !important;
    border: 1px solid #bfd8c9;
}

.backend-admin-theme .badge.bg-danger,
.backend-admin-theme .badge.text-bg-danger,
.backend-admin-theme .label-danger {
    background: var(--clr-danger-soft) !important;
    color: var(--clr-danger) !important;
    border: 1px solid #e0b8c0;
}

.backend-admin-theme .badge.bg-warning,
.backend-admin-theme .badge.text-bg-warning,
.backend-admin-theme .label-warning {
    background: var(--clr-warning-soft) !important;
    color: var(--clr-warning) !important;
    border: 1px solid #ead7bb;
}

.backend-admin-theme .badge.bg-info,
.backend-admin-theme .badge.text-bg-info,
.backend-admin-theme .badge.bg-primary,
.backend-admin-theme .badge.text-bg-primary,
.backend-admin-theme .label-info,
.backend-admin-theme .label-primary {
    background: var(--clr-primary-soft) !important;
    color: var(--clr-primary) !important;
    border: 1px solid #c9d9e6;
}

/* Rows of separate buttons get a gap. A .btn-group is one joined control (split button,
   segmented choice): no gap, and Bootstrap squares the inner corners. */
.backend-admin-theme .btn-toolbar,
.backend-admin-theme .toolbar,
.backend-admin-theme .backend-page-actions,
.backend-admin-theme .kv-panel-before,
.backend-admin-theme .kv-panel-after {
    gap: 0.55rem;
}

.backend-admin-theme .dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.9rem;
    color: var(--admin-shell-text);
    font-weight: 500;
}

.backend-admin-theme .dropdown-menu .dropdown-item:hover,
.backend-admin-theme .dropdown-menu .dropdown-item:focus {
    background: #eef4f9;
    color: var(--admin-shell-heading);
}

.backend-admin-theme .dropdown-divider {
    border-top-color: var(--admin-shell-border);
}

.backend-admin-theme .empty,
.backend-admin-theme .text-empty,
.backend-admin-theme .grid-view .empty {
    padding: 1rem 1.1rem;
    border: 1px dashed #c7d3df;
    border-radius: var(--radius-lg);
    background: #f8fafc;
    color: var(--admin-shell-muted);
    font-weight: 600;
    text-align: center;
}

.backend-admin-theme .kv-panel-pager,
.backend-admin-theme .pagination-container {
    margin-top: 0.9rem;
}

.backend-admin-theme .nav-pills .nav-link {
    border-radius: 0.75rem;
    color: #35506a;
    font-weight: 600;
}

.backend-admin-theme .nav-pills .nav-link.active,
.backend-admin-theme .nav-pills .show>.nav-link {
    background: var(--admin-shell-accent);
    color: #fff;
}

.backend-admin-theme .list-group-item {
    border-color: var(--admin-shell-border);
    padding: 0.85rem 1rem;
}

.backend-admin-theme .progress {
    height: 0.65rem;
    border-radius: 999px;
    background: #e8eef3;
}

.backend-admin-theme .progress-bar {
    background: linear-gradient(90deg, #2c6d9e 0%, #3d7cac 100%);
}

.backend-admin-theme .backend-admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.backend-admin-theme .backend-admin-stat {
    padding: 0.95rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--shadow-md);
}

.backend-admin-theme .backend-admin-stat-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--admin-shell-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.backend-admin-theme .backend-admin-stat-value {
    color: var(--admin-shell-heading);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

.backend-admin-module {
    display: grid;
    gap: 0.9rem;
}

.backend-admin-module-surface,
.backend-admin-filter-card {
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-xl);
    background: var(--clr-surface-raised);
    box-shadow: var(--shadow-md);
}

/* Strip module-surface border when already inside a page-surface, a modal or a side panel:
   it has no padding of its own, so its content would sit against the border */
.backend-page-surface .backend-admin-module-surface,
.backend-panel-surface .backend-admin-module-surface,
.modal .backend-admin-module-surface {
    border: none;
    box-shadow: none;
}

.backend-admin-module-surface {
    padding: 0;
}

.backend-admin-filter-card {
    padding: 0.95rem 1rem 1rem;
}

.backend-admin-filter-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.8rem;
    margin-bottom: 0.9rem;
    border-bottom: 1px solid var(--admin-shell-border);
}

.backend-admin-filter-kicker {
    margin-bottom: 0.3rem;
    color: var(--admin-shell-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.backend-admin-filter-title {
    margin: 0;
    color: var(--admin-shell-heading);
    font-size: 1rem;
    font-weight: 700;
}

.backend-admin-filter-form {
    display: grid;
    gap: 0.95rem;
}

.backend-admin-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem 1rem;
}

.backend-admin-filter-grid .form-group,
.backend-admin-filter-grid .mb-3 {
    margin-bottom: 0;
}

.backend-admin-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    justify-content: flex-end;
    padding-top: 0.2rem;
}

.backend-admin-module .kv-panel-before,
.backend-admin-module .kv-panel-after,
.backend-admin-module .btn-toolbar,
.backend-admin-module .toolbar {
    justify-content: space-between;
}

@media (max-width: 767.98px) {

    .backend-admin-module-surface,
    .backend-admin-filter-card {
        padding: 0.85rem;
        border-radius: var(--radius-lg);
    }

    .backend-admin-module-surface > .backend-admin-filter-head {
        padding: 0.75rem 0.85rem 0.65rem;
        margin-bottom: 0;
    }

    .backend-admin-filter-head {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding-bottom: 0.6rem;
        margin-bottom: 0.6rem;
    }

    .backend-admin-filter-actions {
        justify-content: flex-start;
    }

    .backend-admin-filter-actions .btn {
        flex: 1 1 auto;
        min-height: 44px;
    }

    .backend-admin-filter-title {
        font-size: 0.95rem;
    }
}

.backend-admin-form-surface {
    padding-bottom: 1rem;
}

.backend-admin-form-grid {
    display: grid;
    gap: 1rem;
}

.backend-admin-form-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem 1.2rem;
}

.backend-admin-form-divider {
    height: 1px;
    background: var(--admin-shell-border);
    margin: 0.1rem 0;
}

.backend-admin-inline-preview {
    padding: 0.65rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-md);
    background: #fbfcfd;
}

.backend-admin-inline-preview img {
    max-width: 100%;
    height: auto;
    display: block;
}
.backend-auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at top right, rgba(36, 95, 143, 0.12), transparent 28%),
        radial-gradient(circle at bottom left, rgba(31, 122, 85, 0.08), transparent 24%),
        linear-gradient(180deg, #eef3f7 0%, #e7edf3 100%);
}

.backend-auth-box {
    width: 100%;
    max-width: 440px;
}

.backend-auth-card {
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(21, 38, 55, 0.12);
}

.backend-auth-head {
    padding: 1.4rem 1.25rem 1rem;
    background: linear-gradient(180deg, #fbfcfd 0%, #f1f6fa 100%);
}

.backend-auth-brand-mark {
    margin-bottom: 0.8rem;
}

.backend-auth-kicker {
    margin-bottom: 0.35rem;
    color: var(--admin-shell-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.backend-auth-title {
    color: var(--admin-shell-heading);
    font-size: 1.6rem;
    font-weight: 700;
}

.backend-auth-subtitle {
    color: var(--admin-shell-muted);
}

.backend-auth-body {
    padding: 1.2rem 1.25rem 1.3rem;
}

.backend-auth-form {
    display: grid;
    gap: 0.95rem;
}

.backend-auth-meta .form-group,
.backend-auth-meta .mb-3 {
    margin-bottom: 0;
}

.backend-auth-actions {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 575.98px) {
    .backend-auth-shell {
        padding: 1rem 0.85rem;
    }
}

.backend-identity-surface .backend-page-actions {
    align-items: center;
}

.backend-identity-surface .backend-admin-filter-head {
    align-items: flex-start;
}

.backend-admin-form-grid {
    width: min(100%, 720px);
}

.backend-identity-surface .backend-admin-form-grid {
    width: min(100%, 640px);
}

.backend-admin-form-grid > .form-group,
.backend-admin-form-grid > .mb-3,
.backend-admin-form-grid > .backend-admin-form-columns,
.backend-admin-form-grid > .backend-admin-form-divider,
.backend-admin-form-grid > .backend-admin-filter-actions {
    width: 100%;
}

.backend-admin-form-columns {
    width: 100%;
}

@media (max-width: 767.98px) {
    .backend-admin-form-grid,
    .backend-identity-surface .backend-admin-form-grid {
        width: 100%;
    }
}

body.login-page {
    background: linear-gradient(180deg, #eef3f7 0%, #e7edf3 100%);
}

body.login-page .app-wrapper,
body.login-page .app-main-wrapper,
body.login-page .app-main {
    min-height: 100vh;
    background: transparent !important;
}

body.login-page .app-sidebar,
body.login-page .app-header,
body.login-page .app-footer {
    display: none !important;
}

body.login-page .backend-admin-content,
body.login-page .backend-admin-content-inner {
    padding: 0;
    background: transparent;
}

.backend-auth-actions .btn {
    min-width: 180px;
}

.backend-notification-toggle {
    position: relative;
    font-size: 1.2rem;
}

.backend-notification-badge {
    position: absolute;
    top: 0.2rem;
    right: 0.1rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.28rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f1b900;
    color: #24384d;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.backend-notification-dropdown {
    width: min(24rem, calc(100vw - 2rem));
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.backend-notification-header {
    padding: 0.9rem 1rem;
    background: var(--clr-surface-alt);
    border-bottom: 1px solid var(--clr-border);
}

.backend-notification-title {
    color: var(--admin-shell-heading);
    font-size: 0.95rem;
    font-weight: 700;
}

.backend-notification-subtitle {
    color: var(--admin-shell-muted);
    font-size: 0.76rem;
}

.backend-notification-list {
    max-height: 23rem;
    overflow-y: auto;
}

.backend-notification-item {
    display: block;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--admin-shell-border);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.backend-notification-item:hover {
    background: var(--clr-primary-soft);
}

.backend-notification-item-title {
    color: var(--admin-shell-heading);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 0.35rem;
}

.backend-notification-item-meta {
    color: var(--admin-shell-muted);
    font-size: 0.74rem;
}

.backend-notification-item-text {
    color: var(--admin-shell-muted);
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 0.2rem;
}

.backend-notification-mark-read {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}

.backend-notification-status.is-failed {
    background: #fdecec;
    color: #9b1c1c;
    border: 1px solid #f3c2c2;
}

.backend-notification-status.is-muted {
    background: #f7f8fb;
    color: var(--admin-shell-muted);
    border: 1px solid var(--admin-shell-border);
}

.backend-notification-delivery-error {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #9b1c1c;
    overflow-wrap: anywhere;
}

.backend-notification-empty {
    padding: 1.4rem 1rem;
    color: var(--admin-shell-muted);
    text-align: center;
}

.backend-notification-empty-icon {
    font-size: 1.2rem;
    color: var(--admin-shell-muted);
    margin-bottom: 0.45rem;
}

.backend-notification-footer {
    display: block;
    padding: 0.8rem 1rem;
    text-align: center;
    color: var(--clr-primary);
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    text-decoration: none;
    background: var(--clr-surface-alt);
    border-top: 1px solid var(--clr-border);
}

.backend-notification-footer:hover {
    background: var(--clr-primary-soft);
    color: var(--clr-primary);
}

@media (max-width: 767.98px) {
    .backend-auth-actions .btn,
    .backend-identity-surface .backend-page-actions .btn,
    .backend-identity-surface .backend-admin-filter-actions .btn {
        width: 100%;
    }

    .backend-identity-surface .backend-page-actions,
    .backend-identity-surface .backend-admin-filter-actions {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .backend-auth-shell {
        padding: 1rem 0.85rem;
    }

    .backend-notification-dropdown {
        width: min(92vw, 360px);
    }
}

.backend-notification-surface .backend-admin-filter-actions {
    margin-top: 1rem;
}

.backend-notification-surface .detail-view th,
.backend-notification-surface .detail-view td {
    vertical-align: top;
}

.backend-auth-shell {
    width: 100%;
    background: transparent;
}

.backend-auth-box {
    max-width: 500px;
}

.backend-admin-user-menu > .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.backend-admin-user-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #edf4f9;
    color: var(--admin-shell-accent);
    font-size: 1rem;
}

.backend-admin-user-label {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backend-admin-impersonation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.backend-admin-impersonation-copy {
    display: grid;
    gap: 0.25rem;
}

.backend-admin-impersonation-copy strong {
    font-size: 0.95rem;
}

.backend-admin-impersonation-actions {
    display: flex;
    flex-shrink: 0;
}

.backend-admin-inline-dialog {
    display: grid;
    gap: 0.95rem;
}

.backend-admin-inline-dialog .backend-admin-filter-head {
    margin-bottom: 0;
}

.backend-admin-inline-dialog-copy {
    color: var(--admin-shell-text);
    line-height: 1.6;
}

@media (max-width: 767.98px) {
    .backend-admin-user-label {
        display: none;
    }

    .backend-admin-impersonation {
        flex-direction: column;
        align-items: stretch;
    }

    .backend-admin-context-link {
        justify-content: center;
        width: 100%;
    }

    .backend-page-actions {
        width: 100%;
    }

    .backend-page-actions > .btn,
    .backend-page-actions .btn,
    .backend-page-actions .btn-group {
        width: 100%;
    }

    .backend-admin-impersonation-actions {
        width: 100%;
    }

    .backend-admin-impersonation-actions .btn {
        width: 100%;
    }
}

.dashboard-landing {
    gap: 1.25rem;
}

/* ── Welcome ── */
.dashboard-welcome {
    display: grid;
    gap: 0.2rem;
}

.dashboard-welcome-title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--clr-heading);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.dashboard-welcome-subtitle {
    margin: 0;
    font-size: var(--fs-base);
    color: var(--clr-muted);
    font-weight: 400;
}

/* ── Section titles ── */
.dashboard-section-title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--clr-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Stats row (4 cards across) ── */
.dashboard-stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.dashboard-stat-card {
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-stat-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: rgba(36, 95, 143, 0.2);
    color: inherit;
}

/* ── Value slot + spinner ── */
.dashboard-value-slot {
    display: flex;
    align-items: center;
}

.dashboard-stat-card.is-overdue .rbac-role-summary-label,
.dashboard-stat-card.is-overdue .rbac-role-summary-value {
    color: #b02a37;
}

.dashboard-stat-note {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: var(--bs-secondary-color, #6c757d);
}

.dashboard-stat-note[hidden] {
    display: none;
}

.dashboard-value-pending {
    display: inline-block;
    width: 3.5rem;
    height: 1.1rem;
    border-radius: 0.35rem;
    background: linear-gradient(90deg, rgba(108, 117, 125, 0.14) 25%, rgba(108, 117, 125, 0.3) 50%, rgba(108, 117, 125, 0.14) 75%);
    background-size: 200% 100%;
    animation: dashboard-value-pending 1.4s ease-in-out infinite;
}

@keyframes dashboard-value-pending {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-value-pending {
        animation: none;
    }
}

.dashboard-pending-notice {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
    padding: 0.6rem 0.9rem;
    border: 1px solid rgba(36, 95, 143, 0.2);
    border-radius: 0.6rem;
    background: rgba(36, 95, 143, 0.06);
    color: var(--admin-shell-accent, #245f8f);
    font-size: 0.875rem;
}

.dashboard-pending-notice[hidden] {
    display: none;
}

.dashboard-pending-notice.is-error {
    border-color: rgba(157, 59, 71, 0.25);
    background: var(--clr-danger-soft);
    color: var(--clr-danger);
}

.dashboard-pending-notice .btn-link {
    color: inherit;
    font-weight: 600;
}

.dashboard-value-error {
    color: var(--clr-muted);
}

.dashboard-value-slot .spinner-border,
.dashboard-value-slot .spinner-grow {
    width: 1.1rem;
    height: 1.1rem;
    border-width: 0.14rem;
    opacity: 0.55;
}

/* ── Panels (side by side) ── */
.dashboard-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    align-items: start;
}

.dashboard-panel {
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-xl);
    background: var(--clr-surface-raised);
    overflow: hidden;
}

.dashboard-panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 0.75rem;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--clr-border);
}

.dashboard-panel-updated {
    font-size: 0.75rem;
    color: var(--clr-muted);
}

.dashboard-panel-item-hint {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--clr-muted);
}

.dashboard-panel-title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--clr-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dashboard-panel-body {
    display: grid;
}

/* ── Panel items (rows inside panels) ── */
.dashboard-panel-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.15rem;
    border-bottom: 1px solid var(--clr-surface-alt);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.dashboard-panel-item:last-child {
    border-bottom: none;
}

.dashboard-panel-item.is-link:hover {
    background: var(--clr-surface-alt);
    color: inherit;
}

.dashboard-panel-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-lg);
    font-size: 0.82rem;
    flex-shrink: 0;
}

.dashboard-panel-item.is-info .dashboard-panel-item-icon {
    background: #eef4f9;
    color: #3c698b;
}

.dashboard-panel-item.is-success .dashboard-panel-item-icon {
    background: var(--clr-success-soft);
    color: var(--clr-success);
}

.dashboard-panel-item.is-neutral .dashboard-panel-item-icon {
    background: var(--clr-primary-soft);
    color: var(--clr-primary);
}

.dashboard-panel-item-label {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--clr-text);
    min-width: 0;
}

.dashboard-panel-item-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--clr-heading);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.dashboard-panel-item-chevron {
    color: var(--clr-muted);
    font-size: 0.65rem;
    opacity: 0.4;
    flex-shrink: 0;
}

/* ── Revenue dots ── */
.dashboard-panel-item-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

#revenue-today .dashboard-panel-item-dot { background: #cda76b; }
#revenue-year .dashboard-panel-item-dot { background: var(--clr-success); }
#revenue-expected .dashboard-panel-item-dot { background: #5b87a6; }

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .dashboard-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-panels {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .dashboard-stats-row {
        grid-template-columns: 1fr;
    }
}

/* Quick Access panel */
.dashboard-quicklinks-panel {
    display: grid;
    gap: 0;
}

.dashboard-quicklinks-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 1.1rem;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-xl);
    background: var(--clr-surface-raised);
    color: var(--clr-text);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-quicklinks-bar:hover {
    background: var(--clr-primary-soft);
    border-color: rgba(36, 95, 143, 0.2);
}

.dashboard-quicklinks-bar:not(.collapsed) {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom-color: var(--clr-surface-alt);
}

.dashboard-quicklinks-bar-left {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.dashboard-quicklinks-bar-left > i {
    color: var(--clr-primary);
    font-size: 0.85rem;
}

.dashboard-quicklinks-bar-right {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.dashboard-quicklinks-bar-hint {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--clr-muted);
}

.dashboard-quicklinks-bar:not(.collapsed) .dashboard-quicklinks-bar-hint {
    display: none;
}

.dashboard-quicklinks-bar-chevron {
    font-size: 0.65rem;
    color: var(--clr-muted);
    transition: transform 0.18s ease;
}

.dashboard-quicklinks-bar:not(.collapsed) .dashboard-quicklinks-bar-chevron {
    transform: rotate(180deg);
}

#dashboard-quicklinks-body {
    border: 1px solid var(--clr-border);
    border-top: none;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    background: var(--clr-surface-raised);
    padding: 0.85rem 1.1rem;
}

.dashboard-quicklinks-search-wrap {
    margin-bottom: 0.6rem;
}

.dashboard-quicklinks-search-field {
    position: relative;
    max-width: 300px;
}

.dashboard-quicklinks-search-field i {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
    color: var(--clr-muted);
    pointer-events: none;
    font-size: 0.8rem;
}

.dashboard-quicklinks-search-field .form-control {
    min-height: 2.15rem;
    padding-left: 2.1rem;
    border-radius: var(--radius-pill);
    background: var(--clr-surface-alt);
    border-color: var(--clr-border);
    font-size: 0.82rem;
}

.dashboard-quicklinks-stack {
    display: grid;
    gap: 0.8rem;
}

.dashboard-quicklinks-group {
    display: grid;
    gap: 0.55rem;
}

.dashboard-quicklinks-group-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-quicklinks-group-title {
    color: var(--clr-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard-quicklinks-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    min-height: 1.6rem;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-pill);
    background: var(--clr-surface-alt);
    color: var(--clr-muted);
    font-size: var(--fs-xs);
    font-weight: 600;
    flex-shrink: 0;
}

.dashboard-quicklinks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.7rem;
}

.dashboard-quicklinks-grid.is-admin {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.dashboard-quicklink-card {
    display: grid;
    gap: 0.4rem;
    padding: 0.8rem;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-xl);
    background: var(--clr-surface-raised);
    box-shadow: var(--shadow-sm);
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.dashboard-quicklink-card:hover {
    background: var(--clr-primary-soft);
    color: inherit;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.dashboard-quicklink-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
}

.dashboard-quicklink-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.05rem;
    height: 2.05rem;
    border-radius: var(--radius-lg);
    background: var(--clr-primary-soft);
    color: var(--clr-primary);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.dashboard-quicklink-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.6rem;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-pill);
    background: var(--clr-surface-alt);
    color: var(--clr-muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dashboard-quicklink-label {
    color: var(--clr-heading);
    font-weight: 600;
    line-height: 1.3;
    font-size: 0.88rem;
}

.dashboard-quicklink-copy {
    color: var(--clr-muted);
    line-height: 1.35;
    font-size: 0.82rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dashboard-quicklink-card.is-compact {
    gap: 0.45rem;
    padding: 0.85rem;
}

.dashboard-quicklink-card.is-compact .dashboard-quicklink-copy {
    font-size: 0.9rem;
}

.dashboard-quicklinks-empty {
    padding: 1rem 1.1rem;
    border: 1px dashed var(--clr-border);
    border-radius: var(--radius-xl);
    background: var(--clr-surface-alt);
    color: var(--clr-muted);
    text-align: center;
}

@media (max-width: 767.98px) {
    .dashboard-quicklinks-group-count {
        align-self: flex-start;
    }

    .dashboard-quicklinks-grid,
    .dashboard-quicklinks-grid.is-admin {
        grid-template-columns: 1fr;
    }
}

.backend-business-workspace {
    display: grid;
    gap: 1rem;
}

.backend-admin-theme .app-tabs-widget.nav-tabs,
.backend-admin-theme .tabs-x .app-tabs-widget.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0 0 0;
    padding: 0.2rem;
    border-bottom: 0;
    align-items: center;
    background: var(--admin-shell-bg, #edf1f5);
    border-radius: 0.7rem;
}

.backend-admin-theme .app-tabs-widget.nav-tabs > li,
.backend-admin-theme .tabs-x .app-tabs-widget.nav-tabs > li,
.backend-admin-theme .app-tabs-widget.nav-tabs > .nav-item {
    float: none;
    margin: 0;
}

.backend-admin-theme .app-tabs-widget.nav-tabs > li > a,
.backend-admin-theme .tabs-x .app-tabs-widget.nav-tabs > li > a,
.backend-admin-theme .app-tabs-widget.nav-tabs > .nav-item > .nav-link {
    margin: 0;
    border: 1px solid transparent;
    border-radius: 0.55rem;
    background: transparent;
    color: var(--admin-shell-muted, #6d7f92);
    font-weight: 600;
    font-size: 0.84rem;
    line-height: 1.3;
    padding: 0.52rem 1rem;
    box-shadow: none;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.backend-admin-theme .app-tabs-widget.nav-tabs > li > a:hover,
.backend-admin-theme .tabs-x .app-tabs-widget.nav-tabs > li > a:hover,
.backend-admin-theme .app-tabs-widget.nav-tabs > .nav-item > .nav-link:hover,
.backend-admin-theme .app-tabs-widget.nav-tabs > li > a:focus,
.backend-admin-theme .tabs-x .app-tabs-widget.nav-tabs > li > a:focus,
.backend-admin-theme .app-tabs-widget.nav-tabs > .nav-item > .nav-link:focus {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.6);
    color: var(--admin-shell-heading, #203446);
    box-shadow: none;
    transform: none;
}

.backend-admin-theme .app-tabs-widget.nav-tabs > li.active > a,
.backend-admin-theme .app-tabs-widget.nav-tabs > li.active > a:hover,
.backend-admin-theme .app-tabs-widget.nav-tabs > li.active > a:focus,
.backend-admin-theme .tabs-x .app-tabs-widget.nav-tabs > li.active > a,
.backend-admin-theme .tabs-x .app-tabs-widget.nav-tabs > li.active > a:hover,
.backend-admin-theme .tabs-x .app-tabs-widget.nav-tabs > li.active > a:focus,
.backend-admin-theme .app-tabs-widget.nav-tabs > .nav-item.show > .nav-link,
.backend-admin-theme .app-tabs-widget.nav-tabs > .nav-item > .nav-link.active {
    border-color: transparent;
    background: #ffffff;
    color: var(--admin-shell-accent, #245f8f);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    transform: none;
    font-weight: 700;
}

.backend-admin-theme .tabs-x > .tab-content,
.backend-admin-theme .app-tabs-widget.nav-tabs + .tab-content {
    position: relative;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-top: 0;
    background: var(--clr-surface);
    padding: 1.15rem;
    margin-top: 0.5rem;
}

/* a form's tabs sit in the form panel, which pads them already: the fields line up with the tab strip */
.backend-admin-theme .process-form-panel .tabs-x > .tab-content {
    padding-left: 0;
    padding-right: 0;
}

.backend-admin-theme .tabs-x > .tab-content::before,
.backend-admin-theme .app-tabs-widget.nav-tabs + .tab-content::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

.backend-admin-theme .tabs-x > .tab-content > .tab-pane,
.backend-admin-theme .app-tabs-widget.nav-tabs + .tab-content > .tab-pane {
    min-width: 0;
}

.backend-business-overview,
.backend-business-documents-panel,
.backend-business-users-panel {
    display: grid;
    gap: 1rem;
}

.backend-business-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.backend-business-summary-card {
    padding: 0.9rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: #f9fbfc;
}

.backend-business-summary-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--admin-shell-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.backend-business-summary-value {
    color: var(--admin-shell-heading);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.backend-business-summary-meta {
    display: block;
    margin-top: 0.3rem;
    color: var(--admin-shell-muted);
    font-size: 0.78rem;
    font-weight: 500;
}

/* --- Stacked sections layout --- */

.backend-business-sections {
    display: grid;
    gap: 1rem;
}

.backend-business-section {
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.backend-business-section-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1.15rem 0.8rem;
    border-bottom: 1px solid var(--admin-shell-border);
}

.backend-business-section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    flex-shrink: 0;
    border-radius: 0.65rem;
    font-size: 0.95rem;
    background: rgba(100, 116, 139, 0.08);
    color: #64748b;
}

.backend-business-section-kicker {
    margin-bottom: 0.15rem;
    color: var(--admin-shell-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.backend-business-section-title {
    margin: 0;
    color: var(--admin-shell-heading);
    font-size: 0.95rem;
    font-weight: 700;
}

/* --- Field grid inside each section --- */

.backend-business-fields {
    display: grid;
    gap: 0;
    padding: 0;
}

.backend-business-fields--col-3 {
    grid-template-columns: repeat(3, 1fr);
}

.backend-business-fields--col-4 {
    grid-template-columns: repeat(4, 1fr);
}

.backend-business-field {
    padding: 0.7rem 1.15rem;
    border-bottom: 1px solid var(--admin-shell-border);
    border-right: 1px solid var(--admin-shell-border);
    transition: background 0.15s;
}

.backend-business-field:hover {
    background: rgba(59, 130, 246, 0.03);
}

/* Remove right border on last column items */
.backend-business-fields--col-3 .backend-business-field:nth-child(3n),
.backend-business-fields--col-4 .backend-business-field:nth-child(4n) {
    border-right: none;
}

/* Remove bottom border on last row */
.backend-business-fields .backend-business-field:last-child {
    border-bottom: none;
}

.backend-business-field-label {
    display: block;
    margin: 0 0 0.25rem;
    color: var(--admin-shell-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.backend-business-field-value {
    margin: 0;
    color: var(--admin-shell-heading);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
}

.backend-business-field-empty {
    color: var(--admin-shell-muted);
}

@media (max-width: 991.98px) {
    .backend-business-fields--col-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .backend-business-fields--col-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575.98px) {
    .backend-business-fields--col-4,
    .backend-business-fields--col-3 {
        grid-template-columns: 1fr;
    }
    .backend-business-field {
        border-right: none;
    }
}

/* --- Documents panel (grid-view kept) --- */

.backend-business-documents-panel .grid-view,
.backend-business-users-table-wrap {
    margin: 0;
}

.backend-business-files-list {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 1rem;
}

.backend-business-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: #f9fbfc;
}

.backend-business-file-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
}

.backend-business-file-copy {
    color: var(--admin-shell-muted);
    font-size: 0.9rem;
}

.backend-business-file-action {
    flex-shrink: 0;
}

.backend-business-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: #edf4fa;
    color: #2d587b;
    font-size: 0.78rem;
    font-weight: 700;
}

.backend-business-status {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.backend-business-status.is-confirmed {
    background: rgba(34, 139, 97, 0.12);
    color: #1c6f4e;
}

.backend-business-status.is-pending {
    background: rgba(207, 145, 34, 0.14);
    color: #9a6a13;
}

.backend-business-user-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.backend-business-users-table {
    margin: 0;
}

.backend-business-empty {
    padding: 1rem;
    border: 1px dashed var(--admin-shell-border);
    border-radius: var(--radius-lg);
    color: var(--admin-shell-muted);
    background: #fbfcfd;
}

/* --- Entity page: identity line, linked figures, needs attention --- */

.backend-business-identity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.9rem;
    padding: 0.85rem 1rem 0.25rem;
    color: var(--admin-shell-heading);
    font-size: 0.86rem;
}

.backend-business-identity-item > span {
    color: var(--admin-shell-muted);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.backend-business-profile {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    align-items: start;
    gap: 1rem;
}

.backend-business-profile-side {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.backend-business-profile .backend-business-section-head {
    padding: 0.7rem 1rem;
}

.backend-business-profile .backend-business-section-icon {
    width: 2rem;
    height: 2rem;
    font-size: 0.85rem;
}

.backend-business-dl {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.85rem 1.25rem;
    margin: 0;
    padding: 0.9rem 1.15rem 1rem;
}

.backend-business-dl > .is-wide {
    grid-column: span 2;
}

.backend-business-dl dt {
    margin: 0 0 0.2rem;
    color: var(--admin-shell-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.backend-business-dl dd {
    margin: 0;
    color: var(--admin-shell-heading);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.backend-business-group-title {
    padding: 0.55rem 1.15rem;
    border-top: 1px solid var(--admin-shell-border);
    border-bottom: 1px solid var(--admin-shell-border);
    background: #f6f8fa;
    color: var(--admin-shell-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.backend-business-side-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.8rem 1rem;
}

.backend-business-side-line {
    color: var(--admin-shell-heading);
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.backend-business-profile-side .backend-business-attention-list > li {
    align-items: center;
}

.backend-business-part-title {
    margin: 0.5rem 0 -0.25rem;
    color: var(--admin-shell-heading);
    font-size: 1rem;
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .backend-business-profile {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .backend-business-dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0.8rem 0.9rem;
    }
    .backend-business-profile .backend-business-section-head {
        flex-direction: row;
        align-items: center;
    }
    .backend-business-profile-side .backend-business-attention-list > li {
        flex-direction: row;
        text-align: left;
    }
}

.backend-business-summary-card--link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.backend-business-summary-card--link:hover,
.backend-business-summary-card--link:focus-visible {
    border-color: #9db8cf;
    box-shadow: var(--shadow-md);
    color: inherit;
}

.backend-business-summary-card.is-warning {
    border-left: 3px solid #cf9122;
}

.backend-business-activity-note {
    margin-top: -0.35rem;
    color: var(--admin-shell-muted);
    font-size: 0.8rem;
}

.backend-business-attention {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: start;
    gap: 1rem;
}

.backend-business-attention-toggle {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
}

.backend-business-attention-caret {
    color: var(--admin-shell-muted);
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.backend-business-attention-toggle:not(.collapsed) .backend-business-attention-caret {
    transform: rotate(180deg);
}

.backend-business-attention-head:has(+ .collapse:not(.show)) {
    border-bottom: none;
}

.backend-business-attention-box {
    min-width: 0;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: #fff;
}

.backend-business-attention-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--admin-shell-border);
}

.backend-business-attention-head h3 {
    margin: 0;
    color: var(--admin-shell-heading);
    font-size: 0.9rem;
    font-weight: 700;
}

.backend-business-attention-head h3 > i {
    margin-right: 0.35rem;
    color: var(--admin-shell-muted);
}

.backend-business-attention-head h3 > span {
    margin-left: 0.3rem;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    background: #edf4fa;
    color: #2d587b;
    font-size: 0.75rem;
}

.backend-business-attention-more {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.backend-business-attention-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.backend-business-attention-list > li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--admin-shell-border);
}

.backend-business-attention-list > li:last-child {
    border-bottom: none;
}

.backend-business-attention-main,
.backend-business-attention-side {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 0.85rem;
}

.backend-business-attention-side {
    flex-shrink: 0;
    max-width: 50%;
    align-items: flex-end;
    text-align: right;
}

.backend-business-attention-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
    overflow-wrap: anywhere;
}

a.backend-business-attention-title:hover {
    text-decoration: underline;
}

.backend-business-attention-sub {
    color: var(--admin-shell-muted);
    font-size: 0.78rem;
}

.backend-business-attention-empty {
    padding: 0.9rem 1rem;
    color: var(--admin-shell-muted);
    font-size: 0.85rem;
}

.backend-business-files-list--grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

@media (max-width: 575.98px) {
    .backend-business-attention {
        grid-template-columns: 1fr;
    }
    .backend-business-attention-list > li {
        flex-direction: column;
        gap: 0.2rem;
    }
    .backend-business-attention-side {
        max-width: none;
        align-items: flex-start;
        text-align: left;
    }
}

@media (max-width: 767.98px) {
    .backend-admin-theme .app-tabs-widget .tab-content {
        padding: 0.85rem;
    }

    .backend-business-section-head,
    .backend-business-file-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .backend-business-user-actions {
        justify-content: flex-start;
    }
}

.backend-admin-theme .pg-bill-payment-view .backend-admin-module-surface,
.backend-admin-theme .pg-bill-payment-index .backend-admin-module-surface,
.backend-admin-theme .pg-bill-payment-form .backend-admin-module-surface {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.backend-admin-theme .pg-bill-payment-view .backend-admin-stat-grid {
    margin-top: 0;
    margin-bottom: 0;
}

.backend-admin-theme .pg-bill-payment-view .row.g-3 {
    margin-top: 0;
}

.backend-admin-theme .pg-bill-payment-form .backend-admin-filter-head {
    padding-bottom: 0.75rem;
    margin-bottom: 0.85rem;
}

.backend-admin-theme .pg-bill-gfs-code-index .backend-admin-module-surface,
.backend-admin-theme .pg-bill-gfs-code-view .backend-admin-module-surface,
.backend-admin-theme .pg-bill-gfs-code-form .backend-admin-module-surface {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.backend-admin-theme .pg-bill-gfs-code-form .backend-admin-filter-head {
    padding-bottom: 0.75rem;
    margin-bottom: 0.85rem;
}

.backend-admin-theme .document-type-form-grid {
    gap: 1.25rem;
}

.backend-admin-theme .document-type-form-section {
    display: grid;
    gap: 0.95rem;
}

.backend-admin-theme .document-type-form .backend-admin-filter-head {
    padding-bottom: 0.75rem;
    margin-bottom: 0;
}

.backend-admin-theme .document-type-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.45rem 1rem;
}

.backend-admin-theme .document-type-checkbox-grid .form-group,
.backend-admin-theme .document-type-checkbox-grid .mb-3 {
    margin-bottom: 0;
}

.backend-admin-theme .document-type-overview {
    display: grid;
    gap: 1rem;
}

.backend-admin-theme .document-type-branding-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.backend-admin-theme .document-type-branding-card {
    display: grid;
    gap: 0.75rem;
    padding: 0.95rem;
    border: 1px dashed #cdd8e3;
    border-radius: var(--radius-lg);
    background: #fbfcfd;
}

.backend-admin-theme .document-type-branding-label {
    color: var(--admin-shell-heading);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.backend-admin-theme .document-type-branding-media {
    min-height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.backend-admin-theme .document-type-branding-media img {
    max-width: 100%;
    max-height: 170px;
    object-fit: contain;
}

.backend-admin-theme .document-type-richtext {
    color: var(--admin-shell-text);
    line-height: 1.7;
}

.backend-admin-theme .document-type-richtext > *:last-child {
    margin-bottom: 0;
}

.backend-admin-theme .document-type-richtext-preview {
    position: relative;
    overflow: hidden;
    transition: max-height 0.2s ease;
}

.backend-admin-theme .document-type-richtext-preview.is-collapsed {
    max-height: 14rem;
}

.backend-admin-theme .document-type-richtext-preview.is-collapsed::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 4rem;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, #f8fafc 100%);
    pointer-events: none;
}

.backend-admin-theme .document-type-richtext-preview.is-expanded {
    max-height: none;
}

.backend-admin-theme .document-type-expand-action {
    display: flex;
    justify-content: flex-start;
    margin-top: 0.85rem;
}

.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs {
    gap: 0.7rem;
    margin-bottom: 1.15rem;
}

.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > li > a,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .tabs-x .nav-tabs > li > a,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > .nav-item > .nav-link {
    border-color: #d5e0ea;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
    color: #466176;
    padding: 0.72rem 1.05rem;
    box-shadow: var(--shadow-md);
}

.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > li > a:hover,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .tabs-x .nav-tabs > li > a:hover,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > .nav-item > .nav-link:hover {
    border-color: #b8cad9;
    background: linear-gradient(180deg, #ffffff 0%, #edf4f9 100%);
    color: #243848;
}

.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > li.active > a,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > li.active > a:hover,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > li.active > a:focus,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .tabs-x .nav-tabs > li.active > a,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .tabs-x .nav-tabs > li.active > a:hover,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .tabs-x .nav-tabs > li.active > a:focus,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > .nav-item.show > .nav-link,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > .nav-item > .nav-link.active {
    border-color: rgba(44, 109, 158, 0.28);
    background: linear-gradient(180deg, rgba(44, 109, 158, 0.18) 0%, rgba(44, 109, 158, 0.1) 100%);
    color: #1f3548;
    box-shadow: inset 0 0 0 1px rgba(44, 109, 158, 0.08), 0 10px 20px rgba(44, 109, 158, 0.08);
}

.backend-admin-theme .backend-business-workspace .app-tabs-widget .tab-content {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 1rem;
}

.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs {
    gap: 0.8rem;
    margin-bottom: 1.25rem;
    padding: 0.45rem;
    border: 1px solid #d7e2eb;
    border-radius: 1.2rem;
    background: linear-gradient(180deg, #fbfcfd 0%, #f1f6fa 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > li > a,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .tabs-x .nav-tabs > li > a,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > .nav-item > .nav-link {
    border-color: transparent;
    background: transparent;
    color: #5b7185;
    padding: 0.82rem 1.15rem;
    box-shadow: none;
}

.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > li > a:hover,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .tabs-x .nav-tabs > li > a:hover,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > .nav-item > .nav-link:hover {
    border-color: rgba(44, 109, 158, 0.08);
    background: rgba(255, 255, 255, 0.78);
    color: #243848;
    box-shadow: 0 6px 16px rgba(21, 38, 55, 0.06);
}

.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > li.active > a,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > li.active > a:hover,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > li.active > a:focus,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .tabs-x .nav-tabs > li.active > a,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .tabs-x .nav-tabs > li.active > a:hover,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .tabs-x .nav-tabs > li.active > a:focus,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > .nav-item.show > .nav-link,
.backend-admin-theme .backend-business-workspace .app-tabs-widget .nav-tabs > .nav-item > .nav-link.active {
    border-color: rgba(44, 109, 158, 0.14);
    background: linear-gradient(180deg, #ffffff 0%, #eef5fb 100%);
    color: #173247;
    box-shadow: 0 12px 24px rgba(44, 109, 158, 0.12);
}

.backend-admin-theme .backend-business-workspace .app-tabs-widget .tab-content {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 1rem;
}

.backend-admin-theme .backend-business-panel .kv-detail-view.table-responsive,
.backend-admin-theme .backend-business-panel .detail-view.table-responsive {
    border-radius: 0;
}

.backend-admin-theme .document-type-config-process {
    display: grid;
    gap: 1rem;
}

.backend-admin-theme .document-type-config-head {
    display: grid;
    gap: 1rem;
}

.backend-admin-theme .document-type-config-stage-form {
    margin: 0;
}

.backend-admin-theme .document-type-config-alert {
    margin-bottom: 0;
}

.backend-admin-theme .document-type-stage-config-card {
    display: grid;
    gap: 1rem;
}

.backend-admin-theme .document-type-config-stage-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.backend-admin-theme .document-type-config-meta-item {
    padding: 0.9rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--shadow-md);
}

.backend-admin-theme .document-type-config-meta-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--admin-shell-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.backend-admin-theme .document-type-config-actions {
    margin-top: 0.5rem;
}

@media (max-width: 767.98px) {
    .backend-admin-theme .document-type-config-head .backend-admin-filter-head {
        flex-direction: column;
        align-items: stretch;
    }
}

.backend-process-workspace .grid-view .table {
    margin-bottom: 0;
}

.backend-process-stage-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.backend-process-stage-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
    color: var(--admin-shell-heading);
    font-weight: 600;
}

.backend-process-flow-surface {
    position: sticky;
    top: 1rem;
}

.backend-process-flow {
    display: grid;
    justify-items: center;
    gap: 0.55rem;
}

.backend-process-node {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: var(--admin-shell-heading);
    font-weight: 700;
    text-align: center;
    box-shadow: 0 10px 22px rgba(21, 38, 55, 0.04);
}

.backend-process-node-start,
.backend-process-node-end {
    background: linear-gradient(180deg, #f2f7fb 0%, #e6eef6 100%);
}

.backend-process-arrow {
    color: var(--admin-shell-muted);
    font-size: 1rem;
    line-height: 1;
}

@media (max-width: 1199.98px) {
    .backend-process-flow-surface {
        position: static;
    }
}

.form-data-browser .backend-admin-module-surface + .backend-admin-module-surface {
    margin-top: 0.95rem;
}

.form-data-browser .table td,
.form-data-browser .table th {
    vertical-align: middle;
}

.rbac-role-category-list .list-group-item {
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    margin-bottom: 0.45rem;
    color: var(--admin-shell-heading);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--shadow-md);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.rbac-role-category-list .list-group-item:hover {
    color: var(--admin-shell-heading);
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(21, 38, 55, 0.07);
}

.rbac-role-category-list .list-group-item.is-empty {
    border-left: 4px solid #d8e1e9;
}

.rbac-role-category-list .list-group-item.is-partial {
    border-left: 4px solid #d19a2d;
}

.rbac-role-category-list .list-group-item.is-complete {
    border-left: 4px solid #2d8b61;
}

.rbac-role-category-copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.rbac-role-category-copy strong {
    line-height: 1.35;
}

.rbac-role-category-copy small {
    color: var(--admin-shell-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.rbac-role-category-list .list-group-item .badge {
    min-width: 4.5rem;
    align-self: center;
    border-radius: 999px;
    padding: 0.42rem 0.7rem;
    font-weight: 700;
}

.rbac-role-category-list .list-group-item.active {
    border-color: var(--admin-shell-accent);
    background: linear-gradient(180deg, #245f8f 0%, #1f4f78 100%);
    color: #fff;
}

.rbac-role-category-list .list-group-item.active .rbac-role-category-copy small {
    color: rgba(255, 255, 255, 0.82);
}

.rbac-role-permission-list .form-group {
    margin-bottom: 0;
}

.rbac-role-permission-list .list-group-item {
    border: 1px solid var(--admin-shell-border);
}

.rbac-role-permission-list .form-check-input {
    margin-top: 0.2rem;
}

.rbac-role-permission-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0.85rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fbfcfd 0%, #f4f8fb 100%);
}

.rbac-role-permission-toolbar-copy {
    display: grid;
    gap: 0.18rem;
}

.rbac-role-permission-toolbar-label {
    color: var(--admin-shell-heading);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rbac-role-permission-toolbar-text {
    color: var(--admin-shell-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.rbac-role-permission-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

@media (max-width: 767.98px) {
    .rbac-role-permission-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .rbac-role-permission-toolbar-actions {
        justify-content: stretch;
    }

    .rbac-role-permission-toolbar-actions .btn {
        flex: 1 1 0;
    }
}

.rbac-role-search-shell {
    margin-bottom: 0.75rem;
}

.rbac-role-search-shell .form-control {
    border-radius: var(--radius-lg);
    border-color: var(--admin-shell-border);
    background: #fbfcfd;
}

.rbac-role-search-shell .form-control:focus {
    border-color: rgba(36, 95, 143, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(36, 95, 143, 0.12);
    background: #fff;
}

.rbac-role-empty-state {
    padding: 0.85rem 0.95rem;
    margin-top: 0.75rem;
    border: 1px dashed var(--admin-shell-border);
    border-radius: var(--radius-lg);
    color: var(--admin-shell-muted);
    background: #fbfcfd;
}

#rbac-permission-browser-pjax.is-loading {
    opacity: 0.65;
    transition: opacity 0.18s ease;
}

.rbac-role-search-band {
    display: grid;
    gap: 0.95rem;
}

.rbac-role-search-band-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(188, 201, 213, 0.75);
}

.rbac-role-search-band-copy {
    max-width: 28rem;
    color: var(--admin-shell-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.rbac-role-search-label {
    display: inline-block;
    margin-bottom: 0.45rem;
    color: var(--admin-shell-heading);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

@media (max-width: 767.98px) {
    .rbac-role-search-band-head {
        flex-direction: column;
    }
}

.rbac-role-savebar {
    position: sticky;
    bottom: 1rem;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    margin-top: 1rem;
    border: 1px solid rgba(188, 201, 213, 0.9);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 28px rgba(21, 38, 55, 0.1);
    backdrop-filter: blur(8px);
}

.rbac-role-savebar-copy {
    display: grid;
    gap: 0.18rem;
}

.rbac-role-savebar-title {
    color: var(--admin-shell-heading);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rbac-role-savebar-text {
    color: var(--admin-shell-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

@media (max-width: 767.98px) {
    .rbac-role-savebar {
        align-items: stretch;
        flex-direction: column;
        bottom: 0.75rem;
    }

    .rbac-role-savebar .btn {
        width: 100%;
    }
}

.rbac-auth-item-view {
    display: grid;
    gap: 1rem;
}

.rbac-role-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.rbac-role-summary-card {
    padding: 1rem 1.1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    box-shadow: var(--shadow-md);
}

.rbac-role-summary-label {
    color: var(--admin-shell-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rbac-role-summary-value {
    margin-top: 0.55rem;
    color: var(--admin-shell-heading);
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
}

.rbac-role-summary-text {
    margin-top: 0.45rem;
    color: var(--admin-shell-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.rbac-role-inherited-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}

.rbac-role-inherited-card {
    display: grid;
    gap: 0.35rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fbfcfd 0%, #f5f8fb 100%);
}

.rbac-role-inherited-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.45;
}

.rbac-role-inherited-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    color: var(--admin-shell-muted);
    font-size: 0.87rem;
}

.rbac-role-matrix-table thead th {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--admin-shell-border);
    color: var(--admin-shell-heading);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: #f7fafc;
}

.rbac-role-matrix-table tbody td {
    padding: 1rem;
    vertical-align: top;
    border-top: 1px solid rgba(216, 224, 232, 0.75);
}

.rbac-role-matrix-category {
    color: var(--admin-shell-heading);
    font-weight: 700;
}

.rbac-role-matrix-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: var(--admin-shell-accent-soft);
    color: var(--admin-shell-accent);
    font-size: 0.86rem;
    font-weight: 700;
}

.rbac-role-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.rbac-role-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.7rem;
    border: 1px solid rgba(36, 95, 143, 0.18);
    border-radius: 999px;
    background: rgba(36, 95, 143, 0.08);
    color: var(--admin-shell-heading);
    font-size: 0.86rem;
    line-height: 1.35;
    text-decoration: none;
}

a.rbac-role-chip:hover {
    background: rgba(36, 95, 143, 0.16);
    border-color: rgba(36, 95, 143, 0.32);
    color: var(--admin-shell-heading);
    cursor: pointer;
}

.rbac-role-matrix-empty {
    color: var(--admin-shell-muted);
    font-size: 0.92rem;
}

@media (max-width: 991.98px) {
    .rbac-role-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .rbac-role-summary-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .rbac-role-summary-card {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.65rem 0.85rem;
    }

    .rbac-role-summary-label {
        order: 1;
        margin-bottom: 0;
        font-size: 0.78rem;
        flex: 1 1 auto;
    }

    .rbac-role-summary-value {
        order: 0;
        margin-top: 0;
        font-size: 1.2rem;
        flex: 0 0 auto;
    }

    .rbac-role-summary-text {
        display: none;
    }

    .rbac-role-matrix-table thead {
        display: none;
    }

    .rbac-role-matrix-table,
    .rbac-role-matrix-table tbody,
    .rbac-role-matrix-table tr,
    .rbac-role-matrix-table td {
        display: block;
        width: 100%;
    }

    .rbac-role-matrix-table tr {
        padding: 0.85rem 0;
        border-top: 1px solid rgba(216, 224, 232, 0.75);
    }

    .rbac-role-matrix-table tbody td {
        padding: 0.35rem 0;
        border-top: 0;
    }
}

.rbac-role-matrix-action .btn {
    border-radius: 999px;
}

.rbac-role-inherited-link {
    color: inherit;
    text-decoration: none;
}

.rbac-role-inherited-link:hover,
.rbac-role-inherited-link:focus {
    color: var(--admin-shell-accent);
    text-decoration: underline;
}

.rbac-role-context-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}

.rbac-role-context-item {
    display: grid;
    gap: 0.28rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fbfcfd 0%, #f5f8fb 100%);
}

.rbac-role-context-label {
    color: var(--admin-shell-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rbac-role-context-value {
    color: var(--admin-shell-heading);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
    min-width: 0;
}

@media (max-width: 767.98px) {
    .rbac-role-context-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.5rem;
    }

    .rbac-role-context-item {
        padding: 0.7rem 0.8rem;
    }

    .rbac-role-context-label {
        font-size: 0.72rem;
    }

    .rbac-role-context-value {
        font-size: 0.92rem;
    }
}

.rbac-role-title-link {
    display: inline-flex;
    margin-left: 0.75rem;
    vertical-align: middle;
}

.rbac-role-title-link a {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.7rem;
    border: 1px solid rgba(36, 95, 143, 0.2);
    border-radius: 999px;
    background: rgba(36, 95, 143, 0.08);
    color: var(--admin-shell-accent);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.rbac-role-title-link a:hover,
.rbac-role-title-link a:focus {
    background: rgba(36, 95, 143, 0.14);
    color: var(--admin-shell-accent);
}

.rbac-permission-role-browser {
    display: grid;
    gap: 0.9rem;
}

.rbac-permission-role-search {
    max-width: 28rem;
}

.rbac-permission-role-table .btn {
    border-radius: 999px;
}

.rbac-role-table-text {
    color: var(--admin-shell-text);
    line-height: 1.5;
}

@media (max-width: 767.98px) {
    .rbac-permission-role-search {
        max-width: none;
    }
}

.user-view {
    display: grid;
    gap: 1rem;
}

/* Consolidated identity + status header */
.user-view-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2.5rem;
    padding: 1.25rem 1.4rem;
}

.user-view-header-identity {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.user-view-header-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.user-view-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid var(--admin-shell-border);
    color: var(--admin-shell-muted);
    background: var(--admin-shell-accent-soft);
}

.user-view-badge.is-success {
    color: #1f7a55;
    background: rgba(31, 122, 85, 0.12);
    border-color: rgba(31, 122, 85, 0.25);
}

.user-view-badge.is-warning {
    color: #9a6422;
    background: rgba(154, 100, 34, 0.14);
    border-color: rgba(154, 100, 34, 0.28);
}

.user-view-badge.is-danger {
    color: #9d3b47;
    background: rgba(157, 59, 71, 0.14);
    border-color: rgba(157, 59, 71, 0.28);
}

.user-view-badge.is-info {
    color: #245f8f;
    background: rgba(36, 95, 143, 0.12);
    border-color: rgba(36, 95, 143, 0.25);
}

.user-view-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 2.25rem;
}

.user-view-fact {
    display: grid;
    gap: 0.2rem;
}

.user-view-fact-label {
    color: var(--admin-shell-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.user-view-fact-value {
    color: var(--admin-shell-heading);
    font-weight: 700;
}

/* Secondary offices: a responsive list of rows rather than a table, so it
   stacks cleanly on a phone instead of needing horizontal scroll. */
.user-secondary-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* The filter head stacks and stretches its children below md */
    align-self: flex-start;
    flex: 0 0 auto;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.5rem;
    border-radius: 999px;
    background: var(--admin-shell-accent-soft);
    color: var(--admin-shell-accent);
    font-size: 0.82rem;
    font-weight: 800;
}

.user-secondary-list {
    display: grid;
    gap: 0.75rem;
}

.user-secondary-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fbfcfd 0%, #f5f8fb 100%);
}

.user-secondary-cell {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.user-secondary-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.user-secondary-readonly {
    color: var(--admin-shell-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 767.98px) {
    .user-secondary-item {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

    .user-secondary-actions {
        justify-content: flex-start;
    }
}

.user-view-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.user-view-summary-value {
    font-size: 1.45rem;
    line-height: 1.15;
}

.user-view-summary-date {
    font-size: 1.15rem;
}

.user-view-lifecycle-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 1rem;
}

.user-view-state-card,
.user-view-actions-surface {
    display: grid;
    gap: 1rem;
}

.user-view-state-card {
    padding: 1.15rem 1.2rem;
    border-left: 4px solid var(--admin-shell-border);
}

.user-view-state-card.is-success {
    border-left-color: var(--admin-shell-success);
    background: linear-gradient(180deg, rgba(31, 122, 85, 0.08) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.user-view-state-card.is-warning {
    border-left-color: var(--admin-shell-warning);
    background: linear-gradient(180deg, rgba(154, 100, 34, 0.09) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.user-view-state-card.is-danger {
    border-left-color: var(--admin-shell-danger);
    background: linear-gradient(180deg, rgba(157, 59, 71, 0.09) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.user-view-state-card.is-info {
    border-left-color: var(--admin-shell-accent);
    background: linear-gradient(180deg, rgba(36, 95, 143, 0.08) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.user-view-state-eyebrow {
    color: var(--admin-shell-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.user-view-state-title {
    margin: 0;
    color: var(--admin-shell-heading);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.3;
}

.user-view-state-copy {
    color: var(--admin-shell-muted);
    line-height: 1.6;
}

.user-view-state-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.user-view-state-meta-item {
    display: grid;
    gap: 0.18rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(132, 149, 166, 0.18);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.78);
}

.user-view-state-meta-label {
    color: var(--admin-shell-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.user-view-state-meta-value {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.45;
}

.user-view-actions-list {
    display: grid;
    gap: 0.8rem;
}

.user-view-action-card {
    display: grid;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: #fbfcfd;
}

.user-view-action-copy {
    display: grid;
    gap: 0.22rem;
}

.user-view-action-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.35;
}

.user-view-action-text {
    color: var(--admin-shell-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.user-view-action-note {
    color: var(--admin-shell-accent);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.45;
}

.user-view-action-button .btn {
    min-width: 11rem;
}

.user-view-identity-grid {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.user-view-profile-card {
    display: grid;
    gap: 0.9rem;
    align-items: center;
    justify-items: start;
    padding: 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fbfcfd 0%, #f5f8fb 100%);
}

.user-view-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 999px;
    background: var(--admin-shell-accent-soft);
    color: var(--admin-shell-accent);
    font-size: 1.6rem;
    font-weight: 800;
}

.user-view-profile-copy {
    display: grid;
    gap: 0.25rem;
}

.user-view-profile-name {
    color: var(--admin-shell-heading);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.3;
}

.user-view-profile-meta {
    color: var(--admin-shell-muted);
    line-height: 1.45;
}

.user-view-context-grid {
    gap: 0.85rem;
}

.user-view-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.user-view-role-block,
.user-view-signature-block {
    display: grid;
    gap: 0.7rem;
    margin-top: 0.9rem;
}

.user-view-role-chip {
    text-decoration: none;
}

.user-view-role-chip:hover,
.user-view-role-chip:focus {
    color: var(--admin-shell-heading);
    background: rgba(36, 95, 143, 0.14);
}

.user-view-inline-link {
    color: var(--admin-shell-accent);
    text-decoration: none;
}

.user-view-inline-link:hover,
.user-view-inline-link:focus {
    text-decoration: underline;
}

.user-view-signature-preview {
    padding: 0.85rem 1rem;
    border: 1px dashed var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: #fbfcfd;
}

.user-view-signature-preview img {
    max-width: 100%;
    max-height: 7rem;
    object-fit: contain;
}

@media (max-width: 1199.98px) {
    .user-view-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-view-lifecycle-grid,
    .user-view-identity-grid,
    .user-view-section-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .user-view-summary-grid {
        grid-template-columns: 1fr;
    }

    .user-view-summary-grid .rbac-role-summary-card {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 0.85rem;
    }

    .user-view-summary-grid .rbac-role-summary-label {
        order: 1;
        margin-bottom: 0;
        font-size: 0.82rem;
    }

    .user-view-summary-grid .rbac-role-summary-value {
        order: 0;
        font-size: 1.15rem;
        flex: 0 0 auto;
    }

    .user-view-summary-grid .rbac-role-summary-text {
        display: none;
    }

    .user-view-state-card {
        padding: 0.85rem 0.9rem;
    }

    .user-view-state-title {
        font-size: 1.05rem;
    }

    .user-view-state-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .user-view-state-meta-item {
        padding: 0.6rem 0.7rem;
    }

    .user-view-state-meta-label {
        font-size: 0.68rem;
    }

    .user-view-actions-surface {
        padding: 0.85rem 0.9rem;
    }

    .user-view-action-card {
        padding: 0.7rem 0.8rem;
    }

    .user-view-action-text,
    .user-view-action-note {
        font-size: 0.82rem;
    }

    .user-view-action-button .btn {
        width: 100%;
        min-width: 0;
    }

    .user-view-identity-surface {
        padding: 0.85rem 0.9rem;
    }

    .user-view-identity-grid {
        grid-template-columns: 1fr;
    }

    .user-view-profile-card {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        padding: 0.85rem;
    }

    .user-view-avatar {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
        flex: 0 0 auto;
    }

    .user-view-profile-name {
        font-size: 1.05rem;
    }

    .user-view-context-grid {
        gap: 0.6rem;
    }

    .user-view-section-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .user-view-role-block,
    .user-view-signature-block {
        margin-top: 0.6rem;
    }

    .user-view-signature-preview img {
        max-height: 5rem;
    }
}

.user-list-identity {
    display: grid;
    gap: 0.15rem;
}

.user-list-identity-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.35;
}

.user-list-identity-meta,
.user-list-login-meta {
    color: var(--admin-shell-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.user-list-role-chip {
    margin: 0.1rem 0.3rem 0.1rem 0;
    text-decoration: none;
}

.user-list-role-chip:hover,
.user-list-role-chip:focus {
    color: var(--admin-shell-heading);
    background: rgba(36, 95, 143, 0.14);
}

.user-list-empty-chip {
    color: var(--admin-shell-muted);
    font-size: 0.88rem;
}

.user-list-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.5rem;
    padding: 0.42rem 0.75rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
}

.user-list-status-badge.is-active {
    background: rgba(31, 122, 85, 0.12);
    color: var(--admin-shell-success);
}

.user-list-status-badge.is-pending {
    background: rgba(154, 100, 34, 0.12);
    color: var(--admin-shell-warning);
}

.user-list-status-badge.is-deleted {
    background: rgba(157, 59, 71, 0.12);
    color: var(--admin-shell-danger);
}

.user-list-status-badge.is-neutral {
    background: rgba(109, 127, 146, 0.14);
    color: var(--admin-shell-muted);
}

.user-list-login {
    display: grid;
    gap: 0.12rem;
}

.user-list-login-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.35;
}

.user-index {
    display: grid;
    gap: 1rem;
}

.user-index-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.user-index-tabs-shell {
    display: grid;
    gap: 1rem;
}

@media (max-width: 1399.98px) {
    .user-index-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .user-index-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .user-index-summary-grid {
        grid-template-columns: 1fr;
    }
}

.user-form-shell {
    display: grid;
    gap: 1rem;
}

.user-form-layout {
    gap: 1rem;
}

.user-form-section {
    display: grid;
    gap: 0.95rem;
}

.user-form-section-head {
    display: grid;
    gap: 0.25rem;
}

.user-form-signature-card {
    display: grid;
    gap: 0.7rem;
}

.user-form-signature-preview {
    padding: 0.9rem 1rem;
    border: 1px dashed var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: #fbfcfd;
}

.user-form-signature-preview img {
    max-width: 100%;
    max-height: 9rem;
    object-fit: contain;
}

.financial-year-settings-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.financial-year-settings-note,
.financial-year-settings-shell {
    display: grid;
    gap: 1rem;
}

.financial-year-settings-note {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border-left: 4px solid var(--admin-shell-warning);
    background: linear-gradient(180deg, rgba(154, 100, 34, 0.08) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.financial-year-settings-shell .kv-detail-view {
    margin-bottom: 0;
}

.financial-year-settings-shell .kv-detail-view .panel,
.financial-year-settings-shell .kv-detail-view .card {
    margin-bottom: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.financial-year-module .rbac-role-summary-value,
.financial-year-settings-module .rbac-role-summary-value {
    font-size: 1.5rem;
}

.financial-year-quarters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.financial-year-quarter {
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: 999px;
    color: var(--admin-shell-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.financial-year-quarter.is-current {
    border-color: transparent;
    background: rgba(31, 122, 85, 0.12);
    color: var(--admin-shell-success);
}

@media (max-width: 991.98px) {
    .financial-year-settings-summary-grid {
        grid-template-columns: 1fr;
    }
}

.timeline-event-feed-shell,
.timeline-event-table-shell,
.timeline-event-view-shell,
.timeline-event-data-surface {
    display: grid;
    gap: 1rem;
}

.timeline-event-feed {
    display: grid;
    gap: 1rem;
}

.timeline-event-date-marker {
    position: sticky;
    top: 0;
    z-index: 1;
}

.timeline-event-date-marker span {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.8rem;
    border-radius: 999px;
    background: rgba(36, 95, 143, 0.12);
    color: var(--admin-shell-accent);
    font-size: 0.82rem;
    font-weight: 700;
}

.timeline-event-card {
    display: grid;
    gap: 0.95rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

.timeline-event-card-head,
.timeline-event-card-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.timeline-event-card-title {
    color: var(--admin-shell-heading);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.4;
    text-transform: capitalize;
}

.timeline-event-card-subtitle,
.timeline-event-card-time-meta,
.timeline-event-card-copy {
    color: var(--admin-shell-muted);
}

.timeline-event-card-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.2rem;
    font-size: 0.88rem;
}

.timeline-event-card-time {
    text-align: right;
    color: var(--admin-shell-heading);
    font-size: 0.9rem;
    font-weight: 700;
}

.timeline-event-card-time-meta {
    font-size: 0.8rem;
    font-weight: 500;
}

.timeline-event-dot {
    width: 0.3rem;
    height: 0.3rem;
    border-radius: 999px;
    background: var(--admin-shell-border-strong, var(--admin-shell-border));
}

.timeline-event-card-copy {
    line-height: 1.65;
}

.timeline-event-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.timeline-event-meta-item {
    display: grid;
    gap: 0.18rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(132, 149, 166, 0.18);
    border-radius: var(--radius-lg);
    background: #fbfcfd;
}

.timeline-event-meta-label {
    color: var(--admin-shell-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.timeline-event-meta-value {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.45;
}

.timeline-event-data-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.timeline-event-data-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    background: rgba(36, 95, 143, 0.08);
    color: var(--admin-shell-heading);
    font-size: 0.82rem;
    line-height: 1.35;
}

.timeline-event-data-chip.is-muted,
.timeline-event-data-preview-empty,
.timeline-event-data-empty {
    color: var(--admin-shell-muted);
}

.timeline-event-view-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.timeline-event-view-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(280px, 1.08fr);
    gap: 1rem;
}

.timeline-event-data-tree {
    display: grid;
    gap: 0.75rem;
}

.timeline-event-data-tree.is-nested {
    margin-top: 0.65rem;
    padding-left: 0.9rem;
    border-left: 2px solid rgba(132, 149, 166, 0.18);
}

.timeline-event-data-row {
    display: grid;
    gap: 0.28rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(132, 149, 166, 0.18);
    border-radius: var(--radius-lg);
    background: #fbfcfd;
}

.timeline-event-data-key {
    color: var(--admin-shell-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.timeline-event-data-value {
    color: var(--admin-shell-heading);
    line-height: 1.6;
    word-break: break-word;
}

@media (max-width: 1199.98px) {
    .timeline-event-meta-grid,
    .timeline-event-view-summary-grid,
    .timeline-event-view-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .timeline-event-card-head,
    .timeline-event-card-footer {
        flex-direction: column;
    }

    .timeline-event-card-time {
        text-align: left;
    }
}

.office-index {
    display: grid;
    gap: 1rem;
}

.office-index-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.office-index-identity {
    display: grid;
    gap: 0.18rem;
}

.office-index-identity-title a {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
}

.office-index-identity-title a:hover,
.office-index-identity-title a:focus,
.office-index-parent-link:hover,
.office-index-parent-link:focus {
    color: var(--admin-shell-accent);
    text-decoration: underline;
}

.office-index-identity-meta,
.office-index-date-meta {
    color: var(--admin-shell-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.office-index-identity-copy {
    color: var(--admin-shell-muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.office-index-parent-link {
    color: var(--admin-shell-accent);
    text-decoration: none;
    font-weight: 600;
}

.office-index-type-chip,
.office-index-empty-chip,
.office-index-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.72rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
}

.office-index-type-chip {
    background: rgba(36, 95, 143, 0.08);
    color: var(--admin-shell-accent);
}

.office-index-empty-chip {
    color: var(--admin-shell-muted);
    background: rgba(109, 127, 146, 0.12);
}

.office-index-status-badge.is-active,
.office-index-status-badge.is-physical {
    background: rgba(31, 122, 85, 0.12);
    color: var(--admin-shell-success);
}

.office-index-status-badge.is-inactive,
.office-index-status-badge.is-virtual {
    background: rgba(109, 127, 146, 0.14);
    color: var(--admin-shell-muted);
}

.office-index-date {
    display: grid;
    gap: 0.12rem;
}

.office-index-date-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.35;
}

@media (max-width: 1399.98px) {
    .office-index-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .office-index-summary-grid {
        grid-template-columns: 1fr;
    }
}

.office-view {
    display: grid;
    gap: 1rem;
}

.office-view-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.office-view-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.office-view-section {
    display: grid;
    gap: 1rem;
}

.office-view-meta-grid,
.office-view-list-grid,
.office-view-branding-grid {
    display: grid;
    gap: 1rem;
}

.office-view-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.office-view-meta-item,
.office-view-list-card,
.office-view-list-block,
.office-view-branding-card {
    display: grid;
    gap: 0.6rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: #fbfcfd;
}

.office-view-meta-label {
    color: var(--admin-shell-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.office-view-meta-value {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.45;
}

.office-view-inline-link {
    color: var(--admin-shell-accent);
    text-decoration: none;
}

.office-view-inline-link:hover,
.office-view-inline-link:focus {
    text-decoration: underline;
}

.office-view-list-head {
    display: grid;
    gap: 0.2rem;
}

.office-view-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.office-view-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.7rem;
    border-radius: 999px;
    background: rgba(36, 95, 143, 0.08);
    color: var(--admin-shell-heading);
    font-size: 0.84rem;
    line-height: 1.35;
}

.office-view-link-list {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding-left: 1rem;
}

.office-view-collapsible {
    display: grid;
    gap: 0.55rem;
}

.office-view-list-toggle {
    justify-self: start;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--admin-shell-accent);
    font-weight: 600;
    line-height: 1.4;
}

.office-view-list-toggle:hover,
.office-view-list-toggle:focus {
    text-decoration: underline;
}

.office-view-branding-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.office-view-branding-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
}

.office-view-branding-preview {
    display: grid;
    place-items: center;
    min-height: 10rem;
    padding: 1rem;
    border: 1px dashed var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: #ffffff;
}

.office-view-branding-preview img {
    max-width: 100%;
    max-height: 12rem;
    object-fit: contain;
}

@media (max-width: 1399.98px) {
    .office-view-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1199.98px) {
    .office-view-grid,
    .office-view-meta-grid,
    .office-view-branding-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .office-view-summary-grid {
        grid-template-columns: 1fr;
    }
}

.office-view-section .kv-detail-view,
.office-view-section .detail-view {
    margin-bottom: 0;
}

.office-view-section .kv-detail-view .panel,
.office-view-section .kv-detail-view .card,
.office-view-section .detail-view.table,
.office-view-section .table-responsive {
    margin-bottom: 0;
}

.office-view-section .kv-detail-view .table,
.office-view-section .detail-view {
    margin-bottom: 0;
}

.office-location-form,
.office-location-shell,
.office-location-fields {
    display: grid;
    gap: 1rem;
}

.office-location-helper-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.office-location-helper-card {
    display: grid;
    gap: 0.3rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: #fbfcfd;
}

.office-location-helper-label {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.35;
}

.office-location-helper-text {
    color: var(--admin-shell-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.office-location-actions {
    justify-content: flex-end;
}

.office-location-error {
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .office-location-helper-grid {
        grid-template-columns: 1fr;
    }

    .office-location-actions .btn {
        width: 100%;
    }
}

.system-scheduler-index,
.system-scheduler-view,
.system-scheduler-form,
.system-scheduler-config-form,
.system-scheduler-run-view {
    display: grid;
    gap: 1rem;
}

.system-scheduler-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.system-scheduler-list-shell,
.system-scheduler-section,
.system-scheduler-form-shell {
    display: grid;
    gap: 1rem;
}

.system-scheduler-view-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.system-scheduler-identity,
.system-scheduler-frequency,
.system-scheduler-form-section,
.system-scheduler-preview-card,
.system-scheduler-config-card,
.system-scheduler-error-block {
    display: grid;
    gap: 0.3rem;
}

.system-scheduler-identity-title,
.system-scheduler-frequency-title,
.system-scheduler-config-value {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.35;
}

.system-scheduler-identity-meta,
.system-scheduler-frequency-meta,
.system-scheduler-config-label {
    color: var(--admin-shell-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.system-scheduler-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.42rem 0.75rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
}

.system-scheduler-status-badge.is-enabled {
    background: rgba(31, 122, 85, 0.12);
    color: var(--admin-shell-success);
}

.system-scheduler-status-badge.is-disabled {
    background: rgba(157, 59, 71, 0.12);
    color: var(--admin-shell-danger);
}

.system-scheduler-status-badge.is-warning {
    background: rgba(154, 100, 34, 0.12);
    color: var(--admin-shell-warning);
}

.system-scheduler-status-badge.is-neutral {
    background: rgba(109, 127, 146, 0.14);
    color: var(--admin-shell-muted);
}

.system-scheduler-empty {
    color: var(--admin-shell-muted);
}

.system-scheduler-config-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.system-scheduler-config-card,
.system-scheduler-preview-card,
.system-scheduler-error-block {
    padding: 0.95rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: #fbfcfd;
}

.system-scheduler-config-actions {
    display: flex;
    justify-content: flex-end;
}

.system-scheduler-trace-box {
    margin: 0;
    max-height: 420px;
    overflow: auto;
    padding: 0.85rem 1rem;
    border: 1px dashed var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: #fff;
    white-space: pre-wrap;
}

.system-scheduler-form-grid {
    gap: 1rem;
}

.system-scheduler-status-lines {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding: 0.85rem 1rem 0.85rem 2rem;
    border: 1px solid var(--admin-shell-border);
    border-left-width: 4px;
    border-radius: var(--radius-lg);
    background: #fbfcfd;
    color: var(--admin-shell-heading);
}

.system-scheduler-notice {
    padding: 0.7rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-left-width: 4px;
    border-radius: var(--radius-lg);
    background: #fbfcfd;
    color: var(--admin-shell-heading);
}

.system-scheduler-status-lines.is-good,
.system-scheduler-notice.is-good,
.system-scheduler-fact.is-good {
    border-left-color: var(--admin-shell-success);
}

.system-scheduler-status-lines.is-watch,
.system-scheduler-notice.is-watch,
.system-scheduler-fact.is-watch {
    border-left-color: var(--admin-shell-warning);
}

.system-scheduler-status-lines.is-risk,
.system-scheduler-notice.is-risk,
.system-scheduler-fact.is-risk {
    border-left-color: var(--admin-shell-danger);
}

.system-scheduler-fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.system-scheduler-fact {
    border-left-width: 4px;
}

.system-scheduler-fact-value {
    color: var(--admin-shell-heading);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
    word-break: break-word;
}

.system-scheduler-report-table {
    display: grid;
    gap: 0.25rem;
}

.system-scheduler-report-scroll {
    max-height: 560px;
    overflow: auto;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
}

.system-scheduler-report-scroll thead th {
    position: sticky;
    top: 0;
    background: #f7fafc;
    z-index: 1;
}

.system-scheduler-log td {
    font-size: 0.85rem;
    vertical-align: top;
}

.system-scheduler-log .system-scheduler-config-label {
    word-break: break-all;
}

.system-scheduler-form-head {
    display: grid;
    gap: 0.25rem;
}

/* the days of the week and once or repeating side by side */
.system-scheduler-weekdays,
.system-scheduler-time-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
}

.system-scheduler-weekdays label,
.system-scheduler-time-mode label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-weight: 500;
}

.system-scheduler-repeat {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 1rem;
}

.system-scheduler-preview-runs {
    margin: 0.35rem 0 0;
    padding-left: 1.25rem;
    color: var(--admin-shell-heading);
    font-variant-numeric: tabular-nums;
    line-height: 1.6;
}

.system-scheduler-preview-runs:empty {
    display: none;
}

.system-scheduler-live-card {
    display: block;
    border-left-width: 4px;
    color: inherit;
    text-decoration: none;
}

a.system-scheduler-live-card:hover,
.system-scheduler-live-card.is-active {
    color: inherit;
    border-color: var(--admin-shell-heading);
}

.system-scheduler-live-card.is-good {
    border-left-color: var(--admin-shell-success);
}

.system-scheduler-live-card.is-watch {
    border-left-color: var(--admin-shell-warning);
}

.system-scheduler-live-card.is-risk {
    border-left-color: var(--admin-shell-danger);
}

.system-scheduler-activity .system-scheduler-section,
.system-scheduler-view .system-scheduler-section {
    align-content: start;
}

/* side by side the setup sections keep their own height, a short one does not stretch */
.system-scheduler-view .system-scheduler-view-grid {
    align-items: start;
}

.system-scheduler-config-card {
    align-content: start;
}

.system-scheduler-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0.75rem 0.5rem 1rem;
}

.system-scheduler-bar .btn {
    flex-shrink: 0;
}

.system-scheduler-attention {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.system-scheduler-attention > li {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    align-items: start;
    gap: 0.75rem;
}

.system-scheduler-attention .system-scheduler-status-badge {
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
}

a.system-scheduler-identity-title {
    text-decoration: none;
}

a.system-scheduler-identity-title:hover {
    text-decoration: underline;
}

.system-scheduler-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.system-scheduler-lock {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    color: var(--admin-shell-muted);
    font-weight: 600;
    white-space: nowrap;
    cursor: default;
}

/* the action cell sizes its links as icons, the toggle is a button with words */
.backend-table-action-cell a.system-scheduler-toggle {
    width: auto;
    height: auto;
    color: var(--bs-btn-color);
}

.backend-table-action-cell a.system-scheduler-toggle:hover {
    background: var(--bs-btn-hover-bg);
    color: var(--bs-btn-hover-color);
}

.system-scheduler-lock.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

@media (max-width: 1399.98px) {
    .system-scheduler-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1199.98px) {
    .system-scheduler-view-grid,
    .system-scheduler-config-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .system-scheduler-summary-grid {
        grid-template-columns: 1fr;
    }
}

.backend-notification-summary-grid {
    margin-bottom: 1rem;
}

.backend-notification-surface {
    display: grid;
    gap: 1rem;
}

.backend-notification-identity,
.backend-notification-targets,
.backend-notification-delivery,
.backend-notification-schedule {
    display: grid;
    gap: 0.24rem;
}

.backend-notification-identity-title,
.backend-notification-target-primary,
.backend-notification-schedule-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
}

.backend-notification-identity-copy,
.backend-notification-identity-meta,
.backend-notification-target-meta,
.backend-notification-schedule-meta,
.backend-notification-delivery-meta {
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
}

.backend-notification-identity-copy {
    line-height: 1.5;
}

.backend-notification-chip,
.backend-notification-empty-chip,
.backend-notification-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.9rem;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.backend-notification-chip {
    background: #eef4ff;
    color: #25488c;
    border: 1px solid #d5e4ff;
}

.backend-notification-empty-chip {
    background: #f7f8fb;
    color: var(--admin-shell-muted);
    border: 1px dashed var(--admin-shell-border);
}

.backend-notification-status.is-sent {
    background: #e8f8ef;
    color: #17633a;
    border: 1px solid #bfe8cf;
}

.backend-notification-status.is-pending {
    background: #fff7e8;
    color: #8a5a12;
    border: 1px solid #f0ddb1;
}

.backend-notification-delivery-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.9rem;
}

.backend-notification-view-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 1rem;
}

.backend-notification-message-card {
    padding: 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.backend-notification-message-label {
    margin-bottom: 0.75rem;
    color: var(--admin-shell-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.backend-notification-message-content {
    color: var(--admin-shell-text);
    line-height: 1.65;
}

.backend-notification-message-content p:last-child {
    margin-bottom: 0;
}

.backend-notification-alert {
    margin-bottom: 0;
}

@media (max-width: 991.98px) {
    .backend-notification-view-grid {
        grid-template-columns: 1fr;
    }
}

.measurement-index,
.measurement-view,
.measurement-form {
    display: grid;
    gap: 1rem;
}

.measurement-summary-grid {
    margin-bottom: 0;
}

.measurement-list-shell,
.measurement-section,
.measurement-form-shell {
    display: grid;
    gap: 1rem;
}

.measurement-identity,
.measurement-unit-identity {
    display: grid;
    gap: 0.22rem;
}

.measurement-identity-title,
.measurement-unit-identity-title,
.measurement-strategy-value,
.measurement-unit-factor {
    color: var(--admin-shell-heading);
    font-weight: 700;
}

.measurement-identity-meta,
.measurement-unit-identity-meta,
.measurement-strategy-copy {
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
}

.measurement-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.9rem;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.measurement-chip.is-linear {
    background: #eef4ff;
    color: #25488c;
    border: 1px solid #d5e4ff;
}

.measurement-chip.is-formula {
    background: #fff7e8;
    color: #8a5a12;
    border: 1px solid #f0ddb1;
}

.measurement-chip.is-active,
.measurement-chip.is-native {
    background: #e8f8ef;
    color: #17633a;
    border: 1px solid #bfe8cf;
}

.measurement-chip.is-inactive,
.measurement-chip.is-derived {
    background: #f7f8fb;
    color: var(--admin-shell-muted);
    border: 1px solid var(--admin-shell-border);
}

.measurement-view-grid,
.measurement-form-grid,
.measurement-strategy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.measurement-strategy-card,
.measurement-form-section {
    padding: 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.measurement-strategy-label,
.measurement-form-section-title {
    margin-bottom: 0.75rem;
    color: var(--admin-shell-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.measurement-empty-state {
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
}

.measurement-form-shell .form-group {
    margin-bottom: 1rem;
}

.measurement-form-actions {
    margin-top: 0;
}

@media (max-width: 991.98px) {
    .measurement-view-grid,
    .measurement-form-grid,
    .measurement-strategy-grid {
        grid-template-columns: 1fr;
    }
}

.system-information-page,
.system-information-fail-page {
    display: grid;
    gap: 1rem;
}

.system-information-note {
    padding: 0.9rem 1rem;
    border: 1px solid #dce5ef;
    border-radius: var(--radius-lg);
    background: #fcfdff;
}

.system-information-note-label {
    margin-bottom: 0.35rem;
    color: #5f6f83;
    font-size: 0.8rem;
    font-weight: 700;
}

.system-information-note-copy {
    color: #5f6f83;
    line-height: 1.5;
}

.system-information-page {
    --sysinfo-ok: #1a7f4f;
    --sysinfo-high: #a86400;
    --sysinfo-critical: #c0322f;
    --sysinfo-cpu: #2a78d6;
    --sysinfo-memory: #eb6834;
}

.sysinfo-live-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    color: var(--admin-shell-muted);
    font-size: 0.875rem;
}

.sysinfo-live-bar strong {
    color: var(--admin-shell-heading);
}

.sysinfo-clock strong {
    font-variant-numeric: tabular-nums;
}

.sysinfo-live-state {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sysinfo-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.sysinfo-tile {
    display: grid;
    align-content: start;
    gap: 0.45rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    background: var(--clr-surface-raised);
}

.sysinfo-tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sysinfo-tile-label {
    color: var(--admin-shell-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.sysinfo-tile-value {
    color: var(--admin-shell-heading);
    font-size: 1.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.sysinfo-tile-text {
    color: var(--admin-shell-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.sysinfo-meter {
    height: 0.4rem;
    border-radius: 999px;
    background: var(--admin-shell-surface-alt);
}

.sysinfo-tile.is-ok .progress-bar { background: var(--sysinfo-ok); }
.sysinfo-tile.is-high .progress-bar { background: var(--sysinfo-high); }
.sysinfo-tile.is-critical .progress-bar { background: var(--sysinfo-critical); }

.sysinfo-level {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.is-ok > .sysinfo-tile-head .sysinfo-level,
.sysinfo-level.is-ok { color: var(--sysinfo-ok); }
.is-high > .sysinfo-tile-head .sysinfo-level,
.sysinfo-level.is-high { color: var(--sysinfo-high); }
.is-critical > .sysinfo-tile-head .sysinfo-level,
.sysinfo-level.is-critical { color: var(--sysinfo-critical); }

.backend-admin-module-surface.sysinfo-section {
    min-width: 0;
    padding: 1rem 1.1rem;
}

.sysinfo-section .backend-admin-filter-head {
    align-items: center;
    padding: 0 0 0.7rem;
    margin-bottom: 0.8rem;
}

.sysinfo-section-link {
    font-size: 0.85rem;
    font-weight: 600;
}

.sysinfo-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.sysinfo-columns.is-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sysinfo-chart-wrap {
    position: relative;
}

.sysinfo-chart {
    height: 200px;
}

.sysinfo-chart svg {
    display: block;
}

.sysinfo-chart-grid {
    stroke: var(--admin-shell-border);
    stroke-width: 1;
}

.sysinfo-chart-axis {
    fill: var(--admin-shell-muted);
    font-size: 11px;
}

.sysinfo-chart-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sysinfo-chart-line.is-cpu { stroke: var(--sysinfo-cpu); }
.sysinfo-chart-line.is-memory { stroke: var(--sysinfo-memory); }

.sysinfo-chart-crosshair {
    stroke: var(--admin-shell-muted);
    stroke-width: 1;
}

.sysinfo-chart-dot {
    stroke: var(--clr-surface-raised);
    stroke-width: 2;
}

.sysinfo-chart-dot.is-cpu { fill: var(--sysinfo-cpu); }
.sysinfo-chart-dot.is-memory { fill: var(--sysinfo-memory); }

.sysinfo-chart-legend {
    display: flex;
    gap: 1rem;
    color: var(--admin-shell-muted);
    font-size: 0.8rem;
}

.sysinfo-chart-key {
    display: inline-block;
    width: 0.9rem;
    height: 2px;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.sysinfo-chart-key.is-cpu { background: var(--sysinfo-cpu); }
.sysinfo-chart-key.is-memory { background: var(--sysinfo-memory); }

.sysinfo-chart-tooltip {
    position: absolute;
    top: 0.5rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-md, 6px);
    background: var(--clr-surface-raised);
    box-shadow: var(--shadow-md);
    color: var(--admin-shell-text);
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
}

.sysinfo-chart-tooltip-time {
    margin-bottom: 0.15rem;
    color: var(--admin-shell-muted);
}

.sysinfo-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.sysinfo-stat-value {
    color: var(--admin-shell-heading);
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sysinfo-stat-label {
    color: var(--admin-shell-muted);
    font-size: 0.8rem;
}

.sysinfo-problems {
    padding: 0;
    margin: 0 0 0.5rem;
    list-style: none;
}

.sysinfo-problems li {
    padding: 0.5rem 0;
    border-top: 1px solid var(--admin-shell-border);
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

.sysinfo-problem-reason {
    color: var(--admin-shell-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.sysinfo-all-well {
    margin: 0;
    color: var(--sysinfo-ok);
    font-size: 0.875rem;
}

.sysinfo-queues {
    font-size: 0.875rem;
}

.sysinfo-queues th {
    color: var(--admin-shell-muted);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.sysinfo-builds td {
    white-space: nowrap;
}

.sysinfo-builds tr.is-other-build td {
    background: color-mix(in srgb, var(--sysinfo-high) 8%, transparent);
}

.sysinfo-build-container {
    font-family: var(--bs-font-monospace, monospace);
    font-size: 0.8rem;
}

.sysinfo-build-here {
    margin-left: 0.25rem;
    padding: 0 0.35rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: 999px;
    color: var(--admin-shell-muted);
    font-family: var(--bs-body-font-family, inherit);
    font-size: 0.75rem;
}

.sysinfo-build-warning {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--sysinfo-high);
    border-radius: 0.5rem;
    color: var(--sysinfo-high);
    font-size: 0.875rem;
}

.sysinfo-build-warning ul {
    margin: 0.35rem 0;
    padding-left: 1.1rem;
}

.sysinfo-all-well + .table-responsive,
.sysinfo-build-warning + .table-responsive {
    margin-top: 0.5rem;
}

.sysinfo-builds-stale {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.sysinfo-builds-stale summary {
    cursor: pointer;
    color: var(--admin-shell-muted);
}

.sysinfo-details {
    margin: 0;
    font-size: 0.875rem;
}

.sysinfo-details > div {
    display: grid;
    grid-template-columns: minmax(7rem, 2fr) minmax(0, 3fr);
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-top: 1px solid var(--admin-shell-border);
}

.sysinfo-details > div:first-child {
    border-top: 0;
    padding-top: 0;
}

.sysinfo-details dt {
    color: var(--admin-shell-muted);
    font-weight: 500;
}

.sysinfo-details dd {
    margin: 0;
    color: var(--admin-shell-text);
    overflow-wrap: anywhere;
}

/* Needs attention: one list of what every section found */
.sysinfo-attention-list {
    padding: 0;
    margin: 0;
    list-style: none;
    font-size: 0.9rem;
}

.sysinfo-attention-list li {
    padding: 0.45rem 0;
    border-top: 1px solid var(--admin-shell-border);
    overflow-wrap: anywhere;
}

.sysinfo-attention-list li:first-child {
    border-top: 0;
    padding-top: 0;
}

.sysinfo-attention-list li.is-high > .fa { color: var(--sysinfo-high); }
.sysinfo-attention-list li.is-critical > .fa { color: var(--sysinfo-critical); }

.sysinfo-attention-list a {
    color: var(--admin-shell-text);
}

.sysinfo-attention-list:not(:empty) ~ .sysinfo-loading {
    margin-top: 0.6rem;
}

.sysinfo-loading {
    color: var(--admin-shell-muted);
    font-size: 0.875rem;
}

.sysinfo-section .sysinfo-live-bar {
    margin-bottom: 1rem;
}

.sysinfo-tiles + .sysinfo-subhead {
    margin-top: 1.25rem;
}

.sysinfo-servers-wrap {
    margin-bottom: 0.25rem;
}

[data-status="servers"]:not(:empty) {
    margin-bottom: 1.25rem;
}

.sysinfo-servers td {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.sysinfo-servers td .sysinfo-level {
    font-size: inherit;
}

.sysinfo-servers tr.is-late td {
    background: color-mix(in srgb, var(--sysinfo-critical) 6%, transparent);
}

.sysinfo-live-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-right: 0.3rem;
    border-radius: 50%;
    background: var(--sysinfo-ok);
    vertical-align: middle;
}

/* a heading inside a section: Scheduled tasks, Queues, the chart */
.sysinfo-subhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.sysinfo-subhead h4 {
    margin: 0;
    color: var(--admin-shell-heading);
    font-size: 0.95rem;
    font-weight: 600;
}

.sysinfo-stats + .sysinfo-subhead,
[data-status] > p + .sysinfo-subhead {
    margin-top: 1rem;
}

.sysinfo-stat.is-high .sysinfo-stat-value {
    color: var(--sysinfo-high);
}

.sysinfo-band-title {
    margin: 0.5rem 0 0.75rem;
    color: var(--admin-shell-heading);
    font-size: 1.05rem;
    font-weight: 600;
}

@media (max-width: 1199.98px) {
    .sysinfo-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sysinfo-columns.is-three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .sysinfo-tiles,
    .sysinfo-columns,
    .sysinfo-columns.is-three {
        grid-template-columns: minmax(0, 1fr);
    }
}

.integrations-workspace,
.integrations-app-index,
.integrations-app-view,
.integrations-app-form {
    display: grid;
    gap: 1rem;
}

.integrations-summary-grid {
    margin-bottom: 0;
}

.integrations-app-view-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 1rem;
}

.integrations-section,
.integrations-tabs-shell {
    display: grid;
    gap: 1rem;
}

/* the strip is a TabsWidget, whose own rules zero its margin: the space is kept under its wrapper */
.backend-admin-theme .integrations-nav-shell {
    margin-bottom: 1rem;
}

.backend-admin-theme .integrations-workspace > .integrations-nav-shell,
.backend-admin-theme .integrations-app-index > .integrations-nav-shell {
    margin-bottom: 0;
}

/* integrations overview: a status line, then lists whose every row is a link */
.integrations-attention {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
}

.integrations-attention.is-good {
    background: #e8f8ef;
    color: #17633a;
    border: 1px solid #bfe8cf;
}

.integrations-attention.is-risk {
    background: #fff1f1;
    color: #9f2d2d;
    border: 1px solid #efc2c2;
}

.integrations-attention a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.integrations-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.integrations-list-title {
    margin: 0 0 0.6rem;
    color: var(--admin-shell-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.integrations-list {
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    background: var(--clr-surface);
    overflow: hidden;
}

.integrations-list-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.integrations-list-row + .integrations-list-row {
    border-top: 1px solid var(--clr-border);
}

.integrations-list-row:hover,
.integrations-list-row:focus {
    background: var(--clr-primary-soft);
    color: inherit;
}

.integrations-list-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.6rem;
    background: var(--clr-primary-soft);
    color: var(--clr-primary);
    font-size: 1.1rem;
}

.integrations-list-body {
    display: grid;
    flex: 1;
    gap: 0.2rem;
    min-width: 0;
}

.integrations-list-label {
    color: var(--clr-primary);
    font-weight: 700;
}

.integrations-list-copy {
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
}

.integrations-list-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.2rem;
}

.integrations-list-chevron {
    flex: none;
    color: var(--admin-shell-muted);
    transition: transform 0.15s ease;
}

.integrations-list-row:hover .integrations-list-chevron {
    color: var(--clr-primary);
    transform: translateX(2px);
}

.integrations-badge {
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.75rem;
    font-weight: 700;
}

.integrations-badge.is-watch {
    background: #fff7e8;
    color: #8a5a12;
    border-color: #f0ddb1;
}

.integrations-badge.is-risk {
    background: #fff1f1;
    color: #9f2d2d;
    border-color: #efc2c2;
}

.integrations-badge.is-idle {
    background: #f7f8fb;
    color: var(--admin-shell-muted);
    border-color: var(--admin-shell-border);
}

.integrations-app-identity-title,
.integrations-app-endpoint-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
}

.integrations-app-identity-meta,
.integrations-app-identity-copy,
.integrations-app-endpoint-meta,
.integrations-health-copy {
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.integrations-app-identity,
.integrations-app-endpoint,
.integrations-health-list {
    display: grid;
    gap: 0.25rem;
}

.integrations-health-list {
    gap: 0.9rem;
}

.integrations-health-item {
    display: grid;
    gap: 0.4rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.integrations-health-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.9rem;
    width: fit-content;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.integrations-health-chip.is-good {
    background: #e8f8ef;
    color: #17633a;
    border: 1px solid #bfe8cf;
}

.integrations-health-chip.is-watch {
    background: #fff7e8;
    color: #8a5a12;
    border: 1px solid #f0ddb1;
}

.integrations-health-chip.is-risk {
    background: #fff1f1;
    color: #9f2d2d;
    border: 1px solid #efc2c2;
}

.integrations-health-chip.is-idle {
    background: #f7f8fb;
    color: var(--admin-shell-muted);
    border: 1px solid var(--admin-shell-border);
}

.integrations-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 991.98px) {
    .integrations-app-view-grid,
    .integrations-overview-grid,
    .integrations-form-grid {
        grid-template-columns: 1fr;
    }
}

.system-log-index,
.system-log-view {
    display: grid;
    gap: 1rem;
}

.system-log-summary-grid {
    margin-bottom: 0;
}

.system-log-shell {
    display: grid;
    gap: 1rem;
}

.system-log-identity,
.system-log-time {
    display: grid;
    gap: 0.24rem;
}

.system-log-identity-title,
.system-log-time-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
}

.system-log-identity-meta,
.system-log-message-preview,
.system-log-time-meta {
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.system-log-level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.9rem;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.system-log-level-badge.is-error {
    background: #fff1f1;
    color: #9f2d2d;
    border: 1px solid #efc2c2;
}

.system-log-level-badge.is-warning {
    background: #fff7e8;
    color: #8a5a12;
    border: 1px solid #f0ddb1;
}

.system-log-level-badge.is-info {
    background: #eef4ff;
    color: #25488c;
    border: 1px solid #d5e4ff;
}

.system-log-level-badge.is-neutral {
    background: #f7f8fb;
    color: var(--admin-shell-muted);
    border: 1px solid var(--admin-shell-border);
}

.system-log-view-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 1rem;
    align-items: start;
}

.system-log-view .backend-admin-module-surface {
    padding: 1rem;
}

.system-log-view .system-log-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
}

.system-log-view .rbac-role-summary-card {
    padding: 0.65rem 0.85rem;
}

.system-log-side {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.system-log-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.system-log-toggle {
    border: 1px solid var(--admin-shell-border);
    background: #ffffff;
    color: var(--admin-shell-text);
}

.system-log-toggle:hover,
.system-log-toggle:focus-visible {
    border-color: var(--admin-shell-muted);
    color: var(--admin-shell-heading);
}

.system-log-toggle.is-current,
.system-log-toggle.is-current:hover {
    border-color: #1e3a5f;
    background: #1e3a5f;
    color: #ffffff;
}

.system-log-time-filter {
    min-width: 13rem;
}

.system-log-retention {
    margin: 0;
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
}

.system-log-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.system-log-card-link:hover,
.system-log-card-link:focus-visible {
    color: inherit;
    border-color: var(--admin-shell-muted);
}

.system-log-problem-cell {
    min-width: 22rem;
    white-space: normal !important;
    overflow-wrap: anywhere;
}

.system-log-area-cell {
    min-width: 10rem;
    max-width: 16rem;
    white-space: normal !important;
    overflow-wrap: anywhere;
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
}

.system-log-count-cell {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.system-log-problem-title {
    color: var(--admin-shell-heading);
    font-weight: 600;
    line-height: 1.4;
}

.system-log-entry-title {
    color: var(--admin-shell-text);
    line-height: 1.4;
}

.system-log-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.system-log-tag {
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.system-log-tag.is-new {
    background: #eef4ff;
    color: #25488c;
}

.system-log-tag.is-active {
    background: #fff1f1;
    color: #9f2d2d;
}

.system-log-headline {
    display: grid;
    justify-items: start;
    gap: 0.5rem;
}

.system-log-headline-text {
    margin: 0;
    color: var(--admin-shell-heading);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.system-log-card-time {
    font-size: 1.15rem;
}

.system-log-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.system-log-line-library {
    color: var(--admin-shell-muted);
    opacity: 0.7;
}

.system-log-facts {
    display: grid;
    grid-template-columns: minmax(6rem, auto) minmax(0, 1fr);
    gap: 0.5rem 1rem;
    margin: 0;
}

.system-log-facts dt {
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.system-log-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.system-log-fact-code {
    font-family: var(--bs-font-monospace, monospace);
    font-size: 0.82rem;
}

.system-log-recent {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.system-log-recent li {
    display: grid;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md, 6px);
}

.system-log-recent li.is-current {
    background: #eef4ff;
}

.system-log-pre {
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fbfcfe 0%, #f5f8fc 100%);
    color: var(--admin-shell-text);
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.system-log-message-pre {
    min-height: 180px;
    max-height: 70vh;
    overflow: auto;
}

@media (max-width: 991.98px) {
    .system-log-view-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .system-log-problem-cell,
    .system-log-area-cell,
    .system-log-time-filter {
        min-width: 0;
        max-width: none;
    }

    .system-log-count-cell {
        text-align: left;
    }
}

.log-file-filters {
    display: grid;
    grid-template-columns: minmax(9rem, 1fr) minmax(12rem, 1.2fr) minmax(12rem, 2fr) repeat(2, minmax(8.5rem, 1fr)) minmax(5rem, 0.6fr) auto;
    gap: 0.5rem 0.75rem;
    align-items: end;
}

.log-file-filters .form-label {
    margin-bottom: 0.15rem;
    font-size: 0.8rem;
}

.log-file-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin: 0.75rem 0;
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
}

.log-file-entries {
    max-height: 72vh;
    overflow: auto;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    font-family: var(--bs-font-monospace, monospace);
    font-size: 0.8rem;
    line-height: 1.5;
}

.log-file-entry {
    display: grid;
    grid-template-columns: 10.5rem 4.6rem minmax(0, 1fr) auto;
    gap: 0.25rem 0.75rem;
    padding: 0.3rem 0.75rem;
    border-bottom: 1px solid var(--admin-shell-border);
}

.log-file-entry:last-child {
    border-bottom: 0;
}

.log-file-entry.is-error {
    background: #fff6f6;
}

.log-file-entry.is-warning {
    background: #fffaf0;
}

.log-file-entry-time {
    color: var(--admin-shell-muted);
    white-space: nowrap;
}

.log-file-entry-level {
    font-weight: 700;
    color: var(--admin-shell-muted);
}

.log-file-entry.is-error .log-file-entry-level {
    color: #9f2d2d;
}

.log-file-entry.is-warning .log-file-entry-level {
    color: #8a5a12;
}

.log-file-entry-message {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    color: var(--admin-shell-text);
}

.log-file-entry-message summary {
    cursor: pointer;
}

.log-file-entry-copy {
    align-self: start;
    padding: 0 0.3rem;
    border: 0;
    background: transparent;
    color: var(--admin-shell-muted);
    opacity: 0.55;
    cursor: pointer;
}

.log-file-entry:hover .log-file-entry-copy,
.log-file-entry-copy:focus-visible {
    opacity: 1;
}

.log-file-entry-category {
    color: var(--admin-shell-muted);
}

.log-file-entry-details {
    margin: 0.35rem 0 0.15rem;
    padding: 0.5rem 0.65rem;
    max-height: 24rem;
    overflow: auto;
    border-radius: var(--radius-md, 6px);
    background: #f5f8fc;
    font-size: 0.76rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
    .log-file-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .log-file-filters {
        grid-template-columns: minmax(0, 1fr);
    }

    .log-file-entry {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .log-file-entry-copy {
        grid-column: 3;
        grid-row: 1;
        opacity: 1;
    }

    .log-file-entry-message {
        grid-column: 1 / -1;
    }
}

.report-workspace,
.report-exports-page {
    display: grid;
    gap: 1rem;
}

.report-summary-grid {
    margin-bottom: 0;
}

.report-workspace-shell,
.report-exports-shell {
    display: grid;
    gap: 1rem;
}

.report-export-identity {
    display: grid;
    gap: 0.22rem;
}

.report-export-identity-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
}

.report-export-identity-meta {
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
}

.report-workspace .filter,
.report-exports-page .table-responsive {
    width: 100%;
}

.report-workspace .filter .mb-3 {
    margin-bottom: 0.45rem !important;
}

.report-workspace #export-status {
    margin-top: 0.5rem;
}

.process-create-search,
.process-create-confirm {
    display: grid;
    gap: 1rem;
}

.process-create-summary-grid {
    margin-bottom: 0;
}

.process-create-shell,
.process-create-confirm-card {
    display: grid;
    gap: 1rem;
}

.process-create-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.process-create-step {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: 999px;
    background: #f7f8fb;
    color: var(--admin-shell-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.process-create-step.is-active {
    background: #eef4ff;
    color: #25488c;
    border-color: #d5e4ff;
}

.process-create-step.is-complete {
    background: #e8f8ef;
    color: #17633a;
    border-color: #bfe8cf;
}

.process-create-identity,
.process-create-office {
    display: grid;
    gap: 0.24rem;
}

.process-create-identity-title,
.process-create-office-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
}

.process-create-identity-meta,
.process-create-identity-copy {
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.process-create-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.9rem;
    width: fit-content;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.process-create-chip.is-available {
    background: #e8f8ef;
    color: #17633a;
    border: 1px solid #bfe8cf;
}

.process-create-chip.is-unavailable {
    background: #fff1f1;
    color: #9f2d2d;
    border: 1px solid #efc2c2;
}

.process-create-note {
    padding: 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fcfdff 0%, #f5f8fc 100%);
}

.process-create-note-title {
    margin-bottom: 0.45rem;
    color: var(--admin-shell-heading);
    font-weight: 700;
}

.process-create-note-copy,
.process-create-confirm-copy {
    color: var(--admin-shell-muted);
    line-height: 1.6;
}

.process-create-confirm-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 1rem;
}

@media (max-width: 991.98px) {
    .process-create-confirm-grid {
        grid-template-columns: 1fr;
    }
}

.process-create-search-simple,
.process-create-confirm-simple {
    display: grid;
    gap: 1rem;
}

.process-create-shell-compact {
    gap: 0.75rem;
}

.process-create-search-simple .backend-admin-filter-head {
    display: none;
}

.process-create-listing {
    display: grid;
    gap: 0.18rem;
}

.process-create-listing-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.35;
}

.process-create-listing-meta {
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.process-create-action-cell {
    width: 1%;
    vertical-align: middle;
}

.process-create-start-btn {
    min-width: 88px;
}

.process-create-confirm-shell {
    width: 100%;
    max-width: none;
    padding: 1rem;
}

.process-create-confirm-card-simple {
    display: grid;
    gap: 0.3rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fbfcfe 0%, #f5f8fc 100%);
}

.process-create-confirm-label {
    color: var(--admin-shell-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.process-create-confirm-title {
    color: var(--admin-shell-heading);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
}

.process-create-confirm-meta,
.process-create-confirm-office {
    color: var(--admin-shell-muted);
    line-height: 1.5;
}

.process-create-confirm-actions {
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.15rem;
}

.process-create-confirm-submit {
    min-width: 140px;
}

.modal-body .process-create-confirm-simple {
    gap: 0;
}

.modal-body .process-create-confirm-shell {
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

.modal-body .process-create-confirm-card-simple {
    margin-bottom: 0.9rem;
}

@media (max-width: 575.98px) {
    .process-create-confirm-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .process-create-confirm-actions .btn,
    .process-create-confirm-submit {
        width: 100%;
    }
}

.process-create-search-pjax {
    display: grid;
    gap: 1rem;
}

.process-create-search-bar-shell,
.process-create-results-shell {
    display: grid;
    gap: 0.75rem;
}

.process-create-search-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: start;
}

.process-create-search-input-wrap .form-group,
.process-create-search-input-wrap .mb-3 {
    margin-bottom: 0 !important;
}

.process-create-results-meta {
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
}

.process-create-results-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.process-create-result-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.9rem;
    align-items: center;
    padding: 0.95rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.process-create-result-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.35;
}

.process-create-result-meta {
    margin-top: 0.18rem;
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
    line-height: 1.4;
}

.process-create-result-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.process-create-empty-state {
    padding: 1rem;
    border: 1px dashed var(--admin-shell-border);
    border-radius: var(--radius-lg);
    color: var(--admin-shell-muted);
    background: #fbfcfe;
}

@media (max-width: 991.98px) {
    .process-create-results-stack {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .process-create-search-bar,
    .process-create-result-card {
        grid-template-columns: 1fr;
    }

    .process-create-search-actions .btn,
    .process-create-result-actions .btn {
        width: 100%;
    }
}

.process-create-search-head {
    display: grid;
    gap: 0.18rem;
}

.process-create-search-kicker {
    color: var(--admin-shell-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.process-create-search-copy {
    color: var(--admin-shell-heading);
    font-weight: 700;
}

.process-create-search-input-shell {
    position: relative;
}

.process-create-search-icon {
    position: absolute;
    top: 50%;
    left: 0.95rem;
    transform: translateY(-50%);
    color: var(--admin-shell-muted);
    z-index: 2;
    pointer-events: none;
}

.process-create-search-input {
    min-height: 48px;
    padding-left: 2.7rem;
    border-radius: var(--radius-lg);
}

.process-create-search-submit {
    min-width: 110px;
    min-height: 48px;
    border-radius: var(--radius-lg);
}

.process-create-results-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.process-create-results-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
}

.process-create-result-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.process-create-result-card:hover {
    transform: translateY(-1px);
    border-color: #c9d9f7;
    box-shadow: 0 14px 30px rgba(38, 64, 112, 0.08);
}

.process-create-result-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.35rem;
}

.process-create-code-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.85rem;
    padding: 0.24rem 0.68rem;
    border: 1px solid #d8e2f2;
    border-radius: 999px;
    background: #f7f9fc;
    color: #516177;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.process-create-search-input:focus,
.process-create-search-submit:focus,
.process-create-start-btn:focus {
    outline: none;
}

.process-create-search-input:focus-visible {
    border-color: #99b6eb;
    box-shadow: 0 0 0 0.24rem rgba(62, 112, 196, 0.12);
}

.process-create-search-submit:focus-visible,
.process-create-start-btn:focus-visible {
    box-shadow: 0 0 0 0.24rem rgba(62, 112, 196, 0.16);
}

.process-create-result-card:focus-within {
    border-color: #b8cef3;
    box-shadow: 0 14px 30px rgba(38, 64, 112, 0.1);
}

.process-create-office-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    min-height: 1.85rem;
    padding: 0.24rem 0.68rem;
    border: 1px solid #e2e8f2;
    border-radius: 999px;
    background: #ffffff;
    color: var(--admin-shell-muted);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.2;
}

.process-create-office-meta i {
    color: #6d88b5;
    font-size: 0.78rem;
}

.process-create-search-bar-shell {
    margin-bottom: 0.35rem;
}

.backend-confirm-message {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    align-items: start;
    padding: 0.95rem 1rem;
    border: 1px solid #d9e5f8;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
}

.backend-confirm-message-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    background: #ffffff;
    color: #315fa7;
    box-shadow: inset 0 0 0 1px #d5e4ff;
    font-size: 1rem;
}

.backend-confirm-message-body {
    display: grid;
    gap: 0.22rem;
}

.backend-confirm-message-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.4;
}

.backend-confirm-message-copy {
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.backend-confirm-message.is-info {
    border-color: #d9e5f8;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
}

.backend-confirm-message.is-info .backend-confirm-message-icon {
    color: #315fa7;
    box-shadow: inset 0 0 0 1px #d5e4ff;
}

.backend-confirm-message.is-success {
    border-color: #cfe9d8;
    background: linear-gradient(180deg, #f6fcf8 0%, #eaf7ef 100%);
}

.backend-confirm-message.is-success .backend-confirm-message-icon {
    color: #1f7a47;
    box-shadow: inset 0 0 0 1px #c6e8d2;
}

.backend-confirm-message.is-warning {
    border-color: #f0ddb1;
    background: linear-gradient(180deg, #fffdf7 0%, #fff7e8 100%);
}

.backend-confirm-message.is-warning .backend-confirm-message-icon {
    color: #8a5a12;
    box-shadow: inset 0 0 0 1px #f2e1b9;
}

.backend-confirm-message.is-danger {
    border-color: #efc2c2;
    background: linear-gradient(180deg, #fff8f8 0%, #fff1f1 100%);
}

.backend-confirm-message.is-danger .backend-confirm-message-icon {
    color: #9f2d2d;
    box-shadow: inset 0 0 0 1px #efcaca;
}

@media (max-width: 575.98px) {
    .backend-confirm-message {
        grid-template-columns: 1fr;
    }
}

.process-instance-type-page {
    display: grid;
    gap: 1rem;
}

.process-instance-type-shell {
    display: grid;
    gap: 0.75rem;
}

.process-instance-type-record,
.process-instance-type-process {
    display: grid;
    gap: 0.2rem;
}

.process-instance-type-record-title,
.process-instance-type-process-title,
.process-instance-type-entity {
    color: var(--admin-shell-heading);
    line-height: 1.35;
}

.process-instance-type-record-meta,
.process-instance-type-process-meta {
    color: var(--admin-shell-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.process-instance-type-badge,
.process-instance-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.9rem;
    padding: 0.26rem 0.72rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.process-instance-type-badge {
    border: 1px solid #d8e2f2;
    background: #f7f9fc;
    color: #516177;
}

.process-instance-status-badge.is-success {
    border: 1px solid #bfe8cf;
    background: #e8f8ef;
    color: #17633a;
}

.process-instance-status-badge.is-info {
    border: 1px solid #d5e4ff;
    background: #eef4ff;
    color: #25488c;
}

.process-instance-status-badge.is-warning {
    border: 1px solid #f0ddb1;
    background: #fff7e8;
    color: #8a5a12;
}

.process-instance-status-badge.is-danger {
    border: 1px solid #efc2c2;
    background: #fff1f1;
    color: #9f2d2d;
}

.process-instance-status-badge.is-neutral {
    border: 1px solid var(--admin-shell-border);
    background: #f7f8fb;
    color: var(--admin-shell-muted);
}

.process-instance-view-page {
    display: grid;
    gap: 1rem;
}









.process-instance-view-shell {
    display: grid;
    gap: 1rem;
}


.process-instance-view-kicker {
    color: var(--admin-shell-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}



/* ── Process Instance Stage Summary ─────────────────────────── */
.process-instance-stage-summary {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.process-instance-stage-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.process-instance-stage-summary-title {
    margin: 0.15rem 0 0;
    color: var(--admin-shell-heading);
    font-size: 1.05rem;
    font-weight: 700;
}

.process-instance-stage-summary-counters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.process-instance-stage-summary-list {
    display: grid;
    gap: 0.5rem;
}

.process-instance-stage-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: 10px;
    background: #ffffff;
    transition: border-color 0.15s;
}

.process-instance-stage-summary-item.is-current {
    border-color: #bfd6ff;
    background: #f5f9ff;
}

.process-instance-stage-summary-line-one {
    display: grid;
    grid-template-columns: 2.5rem 1fr auto;
    align-items: center;
    gap: 0.7rem;
}

.process-instance-stage-summary-item .stage-action-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0 !important;
    margin-left: 2.5rem !important;
    padding: 0.3rem 0.6rem !important;
    background: #f8f9fb !important;
    border: 1px solid #edf0f4 !important;
    border-radius: 0.5rem !important;
    font-size: 0.78rem;
}

.process-instance-stage-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--admin-shell-muted, #6b7a8d);
    font-size: 0.78rem;
    white-space: nowrap;
}

.process-instance-stage-summary-step {
    text-align: center;
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--admin-shell-muted);
    letter-spacing: 0.04em;
}

.process-instance-stage-summary-name {
    color: var(--admin-shell-heading);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}

.process-instance-stage-summary-state {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

/* a long list shows five steps; this line says how many more there are and opens them all */
.process-instance-stage-summary-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.35rem 0.75rem;
    border: 1px dashed var(--admin-shell-border);
    border-radius: 10px;
    background: transparent;
    color: var(--admin-shell-muted, #6b7a8d);
    font-size: 0.8rem;
    font-weight: 600;
}

.process-instance-stage-summary-more:hover,
.process-instance-stage-summary-more:focus-visible {
    border-color: #bfd6ff;
    background: #f5f9ff;
    color: var(--admin-shell-heading);
}

/* the pop-up holding every step */
.process-instance-steps-dialog {
    width: min(760px, calc(100vw - 1.5rem));
    max-height: min(85vh, 900px);
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg, 14px);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

.process-instance-steps-dialog[open] {
    display: flex;
    flex-direction: column;
}

.process-instance-steps-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.process-instance-steps-dialog-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--admin-shell-border);
}

.process-instance-steps-dialog-body {
    padding: 1rem;
    overflow-y: auto;
}

@media (max-width: 767.98px) {
    .process-instance-stage-summary-line-one {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
    }

    .process-instance-stage-summary-state {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .process-instance-stage-summary-item .stage-action-toolbar {
        margin-left: 0 !important;
    }
}

/* the headline of an application page (_overview.php): where it stands, in one line */
.process-instance-headline {
    --headline-accent: #94a3b8;
    display: grid;
    gap: 0.55rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-left: 4px solid var(--headline-accent);
    border-radius: var(--radius-lg);
    background: #ffffff;
}

.process-instance-headline.is-info { --headline-accent: #3b6fd8; }
.process-instance-headline.is-warning { --headline-accent: #d69e2e; }
.process-instance-headline.is-success { --headline-accent: #2f9e5b; }
.process-instance-headline.is-danger { --headline-accent: #c94b4b; }

.process-instance-headline-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.process-instance-headline-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.6rem;
    color: var(--admin-shell-heading);
    font-weight: 600;
}

.process-instance-headline-entity::before {
    content: "·";
    margin-right: 0.6rem;
    color: var(--admin-shell-muted);
}

.process-instance-headline-entity a {
    text-decoration: none;
}

.process-instance-headline-entity a:hover {
    text-decoration: underline;
}

.process-instance-headline-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0;
    color: var(--admin-shell-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.process-instance-headline-line > strong {
    margin-right: 0.6rem;
    color: var(--admin-shell-heading);
    font-weight: 600;
}

.process-instance-headline-line > span + span::before {
    content: "·";
    margin: 0 0.45rem;
}

.process-instance-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--admin-shell-muted);
    font-size: 0.8rem;
}

.process-instance-progress-bar {
    flex: 1 1 auto;
    max-width: 22rem;
    height: 0.4rem;
    border-radius: 999px;
    background: #e9edf3;
    overflow: hidden;
}

.process-instance-progress-bar > span {
    display: block;
    height: 100%;
    min-width: 0.4rem;
    border-radius: inherit;
    background: var(--headline-accent);
}

@media (max-width: 575.98px) {
    /* on a phone each fact gets its own line, so no dot is left hanging at a line's end */
    .process-instance-headline-entity {
        flex-basis: 100%;
    }

    .process-instance-headline-entity::before {
        content: none;
    }

    .process-instance-headline-line {
        flex-direction: column;
    }

    .process-instance-headline-line > span + span::before {
        content: none;
    }
}

/* a long value with no spaces (a code, a reference) wraps instead of running under the steps */
.process-instance-view-shell .detail-view td {
    overflow-wrap: anywhere;
}

/* a step past its due date, in the headline and in its row */
.process-instance-headline-line .is-late,
.process-instance-stage-meta-chip.is-late {
    color: #b42318;
    font-weight: 600;
}

/* a step not reached yet: one quiet line */
.process-instance-stage-summary-item.is-pending {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    background: transparent;
    border-style: dashed;
}

.process-instance-stage-summary-item.is-pending .process-instance-stage-summary-name {
    color: var(--admin-shell-muted);
    font-weight: 500;
}

.process-instance-stage-pending {
    color: var(--admin-shell-muted);
    font-size: 0.78rem;
}

@media (max-width: 767.98px) {
    .process-instance-stage-summary-item.is-pending .process-instance-stage-summary-line-one {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto;
    }

    .process-instance-stage-summary-item.is-pending .process-instance-stage-summary-state {
        grid-column: auto;
    }
}

.process-instance-modal-stack {
    display: grid;
    gap: 1rem;
}

.process-instance-modal-context {
    display: grid;
    gap: 0.22rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.process-instance-modal-label {
    color: var(--admin-shell-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.process-instance-modal-value {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.4;
}

.process-instance-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.process-instance-modal-actions .btn {
    min-width: 140px;
}

@media (max-width: 575.98px) {
    .process-instance-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .process-instance-modal-actions .btn {
        width: 100%;
    }
}

.process-instance-modal-stack .backend-confirm-message {
    margin-bottom: 0.2rem;
}

.document-index-page {
    display: grid;
    gap: 1rem;
}

.document-index-shell {
    display: grid;
    gap: 0.75rem;
}

.document-index-record,
.document-index-type {
    display: grid;
    gap: 0.24rem;
}

.document-index-record-title,
.document-index-type-title,
.document-index-entity {
    color: var(--admin-shell-heading);
    font-weight: 400;
    line-height: 1.35;
}

.document-index-record-meta {
    color: var(--admin-shell-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.document-index-category-badge,
.document-index-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.9rem;
    width: fit-content;
    padding: 0.24rem 0.7rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.document-index-category-badge {
    border: 1px solid #d8e2f2;
    background: #f7f9fc;
    color: #516177;
}

.document-index-date {
    color: var(--admin-shell-heading);
    font-weight: 400;
}

.document-index-status-badge.is-success {
    border: 1px solid #bfe8cf;
    background: #e8f8ef;
    color: #17633a;
}

.document-index-status-badge.is-warning {
    border: 1px solid #f0ddb1;
    background: #fff7e8;
    color: #8a5a12;
}

.document-index-status-badge.is-danger {
    border: 1px solid #efc2c2;
    background: #fff1f1;
    color: #9f2d2d;
}

.document-index-status-badge.is-neutral {
    border: 1px solid var(--admin-shell-border);
    background: #f7f8fb;
    color: var(--admin-shell-muted);
}

.document-view-page {
    display: grid;
    gap: 1rem;
}

.document-view-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.document-view-card {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.document-view-label {
    color: var(--admin-shell-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.document-view-value {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.4;
}

.document-view-copy {
    color: var(--admin-shell-muted);
    font-size: 0.83rem;
    line-height: 1.5;
}

.document-view-shell {
    display: grid;
    gap: 1rem;
}

.document-view-head {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.document-view-kicker {
    color: var(--admin-shell-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.document-view-title {
    margin: 0.15rem 0 0;
    color: var(--admin-shell-heading);
    font-size: 1.2rem;
    font-weight: 700;
}

.document-view-subtitle {
    margin-top: 0.3rem;
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.document-view-nav-shell {
    padding: 0.9rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.document-view-nav-shell .detail-header,
.document-view-nav-shell .process {
    margin: 0;
    width: 100%;
}

.document-view-nav-shell .row {
    margin: 0;
}

@media (max-width: 1199.98px) {
    .document-view-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .document-view-summary-grid {
        grid-template-columns: 1fr;
    }
}

.document-linked-process-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.document-linked-process-main {
    display: grid;
    gap: 0.24rem;
}

.document-linked-process-kicker {
    color: var(--admin-shell-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.document-linked-process-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.35;
}

.document-linked-process-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--admin-shell-muted);
    font-size: 0.84rem;
}

.document-linked-process-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

@media (max-width: 575.98px) {
    .document-linked-process-actions,
    .document-linked-process-actions .btn {
        width: 100%;
    }
}

.backend-table-summary {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-pill);
    background: var(--clr-surface-alt);
    border: 1px solid var(--clr-border);
    color: var(--clr-muted);
    font-size: var(--fs-sm);
    font-weight: 500;
    white-space: nowrap;
}

/* A table field inside a page's details: the table is its own bordered card, so the list wrapper
   behind it stays clear instead of showing as a white box on the striped row */
.form-table-field .grid-view {
    background: transparent;
}

/* the header's column lines carry on down through the rows */
.backend-admin-theme .form-table-field .kv-grid-table tbody td:not(:last-child) {
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

/* the table fits its cell rather than the width a list page keeps on tablets; a wider one scrolls inside the cell */
.backend-admin-theme .form-table-field .grid-view table.kv-grid-table {
    min-width: 0;
}

.backend-admin-theme .form-table-field .kv-grid-container {
    overflow-x: auto;
}

.backend-admin-theme .value:has(.form-table-field) {
    min-width: 0;
}

/* Fix PJAX loading overlay visibility */
.kv-grid-loading {
    overflow: visible;
    max-height: none;
}

.kv-grid-loading > .kv-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    background: rgba(255, 255, 255, 0.45);
}

.kv-grid-loading > .kv-loader-overlay > .kv-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1051;
}

.backend-table-widget .backend-table-action-head {
    text-align: center;
}

.backend-table-widget .backend-table-action-cell {
    white-space: nowrap;
    text-align: center;
}

.backend-table-widget .backend-table-action-cell .btn,
.backend-table-widget .action-column .btn {
    border-radius: var(--radius-md);
    box-shadow: none;
}

.backend-table-widget .backend-table-action-cell .btn.btn-sm,
.backend-table-widget .action-column .btn.btn-sm {
    min-width: 2rem;
    min-height: 2rem;
    padding: 0.32rem 0.56rem;
}

.backend-table-widget .backend-table-action-cell > a:not(.btn),
.backend-table-widget .action-column > a:not(.btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin: 0 0.14rem;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-control);
    background: var(--ui-surface);
    color: var(--ui-ink);
    text-decoration: none;
    transition: background-color .15s, border-color .15s, color .15s;
}

.backend-table-widget .backend-table-action-cell > a:not(.btn):hover,
.backend-table-widget .action-column > a:not(.btn):hover {
    border-color: var(--ui-accent);
    background: var(--ui-accent-soft);
    color: var(--ui-accent);
}

.backend-table-widget .backend-table-action-cell .btn i,
.backend-table-widget .backend-table-action-cell > a i,
.backend-table-widget .backend-table-action-cell > a span,
.backend-table-widget .action-column .btn i,
.backend-table-widget .action-column > a i,
.backend-table-widget .action-column > a span {
    line-height: 1;
}

/* Action buttons turned into icons by TableWidget: keep them compact and square
   whether or not the original markup carried .btn / .btn-sm. */
.backend-table-widget .backend-table-action-cell .backend-action-icon,
.backend-table-widget .action-column .backend-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0.32rem 0.5rem;
    margin: 0 0.1rem;
    line-height: 1;
}

.backend-table-widget .backend-table-action-cell .backend-action-icon i,
.backend-table-widget .action-column .backend-action-icon i {
    font-size: 0.95rem;
    line-height: 1;
}

.process-instance-index-page {
    display: grid;
    gap: 1rem;
}

.process-instance-index-shell {
    display: grid;
    gap: 0.75rem;
}

.process-instance-index-shell .table {
    margin-bottom: 0;
}

.process-instance-index-shell tbody tr {
    transition: background-color 0.2s ease;
}

.process-instance-index-shell tbody tr:hover {
    background-color: #f9f9fb;
}

.process-instance-index-shell td {
    vertical-align: middle;
    padding: 0.95rem 0.75rem !important;
}

.process-instance-index-shell th {
    font-weight: 600;
    border-top: 1px solid #e0e0e0;
    border-bottom: 2px solid #e0e0e0;
    background-color: #f5f5f7;
    padding: 0.85rem 0.75rem !important;
    color: #516177;
}

.process-instance-index-record,
.process-instance-index-process,
.process-instance-index-date {
    display: grid;
    gap: 0.2rem;
}

.process-instance-index-record-title,
.process-instance-index-process-title,
.process-instance-index-date-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.35;
    font-size: 0.95rem;
}

.process-instance-index-record-meta,
.process-instance-index-process-meta,
.process-instance-index-date-meta {
    color: var(--admin-shell-muted);
    font-size: 0.80rem;
    line-height: 1.45;
}

.process-instance-index-date-title i,
.process-instance-index-date-meta i {
    margin-right: 0.35rem;
    color: #a0aec0;
}

.process-instance-external-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.9rem;
    width: fit-content;
    padding: 0.24rem 0.72rem;
    border: 1px solid #d8e2f2;
    border-radius: 999px;
    background: #f7f9fc;
    color: #516177;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.process-instance-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 1.95rem;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.80rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.process-instance-status-badge i {
    font-size: 0.85rem;
}

.process-instance-index-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 1.95rem;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.80rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.process-instance-index-flag i {
    font-size: 0.85rem;
}

.process-instance-index-flag.is-success {
    background: #edf9f1;
    color: #1d6b45;
}

.process-instance-index-flag.is-danger {
    background: #fff0f0;
    color: #a33d4b;
}

.plan-activity-index-page,
.plan-activity-view-page,
.plan-activity-form-page {
    display: grid;
    gap: 1rem;
}

.plan-activity-index-shell,
.plan-activity-form-surface,
.plan-activity-detail-surface,
.plan-activity-indicators-surface {
    display: grid;
    gap: 0.9rem;
}

.plan-activity-record {
    display: grid;
    gap: 0.18rem;
}

.plan-activity-record-title,
.plan-activity-summary-value,
.plan-activity-section-title {
    color: var(--admin-shell-heading);
    font-weight: 700;
    line-height: 1.35;
}

.plan-activity-record-meta,
.plan-activity-summary-label,
.plan-activity-section-copy {
    color: var(--admin-shell-muted);
}

.plan-activity-record-meta,
.plan-activity-section-copy {
    font-size: 0.84rem;
    line-height: 1.5;
}

.plan-activity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.9rem;
    padding: 0.24rem 0.72rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    border: 1px solid var(--admin-shell-border);
    background: #f7f8fb;
    color: #516177;
}

.plan-activity-badge.is-success {
    border-color: #bfe8cf;
    background: #e8f8ef;
    color: #17633a;
}

.plan-activity-badge.is-info {
    border-color: #c8dbfb;
    background: #eef4ff;
    color: #25488c;
}

.plan-activity-badge.is-neutral {
    border-color: #d8e2f2;
    background: #f7f9fc;
    color: #516177;
}

.plan-activity-view-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.plan-activity-summary-card {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid var(--admin-shell-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.plan-activity-summary-label {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.plan-activity-view-grid,
.plan-activity-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.plan-activity-form-section {
    display: grid;
    gap: 0.85rem;
}

.plan-activity-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.plan-activity-section-title {
    margin: 0;
    font-size: 1rem;
}

.plan-activity-section-copy {
    margin: 0.2rem 0 0;
}

.plan-activity-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.4rem;
}

.plan-activity-detail-surface .table,
.plan-activity-detail-surface .kv-detail-view,
.plan-activity-detail-surface .detail-view {
    margin-bottom: 0;
}

@media (max-width: 991.98px) {
    .plan-activity-view-summary-grid,
    .plan-activity-view-grid,
    .plan-activity-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .plan-activity-view-summary-grid,
    .plan-activity-view-grid,
    .plan-activity-form-grid {
        grid-template-columns: 1fr;
    }

    .plan-activity-form-actions,
    .plan-activity-form-actions .btn,
    .plan-activity-section-actions,
    .plan-activity-section-actions .btn {
        width: 100%;
    }
}

/* Planning progress: targets against what was achieved */
.plan-activity-badge.is-warning {
    border-color: #f3dca6;
    background: #fff7e3;
    color: #85570a;
}

.plan-activity-badge.is-danger {
    border-color: #f3c4ca;
    background: #fff0f0;
    color: #a33d4b;
}

.plan-progress-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
}

.plan-import-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.plan-import-form input[type="file"] {
    flex: 1 1 18rem;
    min-width: 0;
}

.plan-import-list {
    margin-top: 0.5rem;
}

.plan-import-list summary {
    cursor: pointer;
    font-weight: 600;
}

.plan-import-list ul {
    margin: 0.35rem 0 0;
    overflow-wrap: anywhere;
}

.plan-progress-filter {
    display: grid;
    gap: 0.3rem;
    flex: 0 1 16rem;
    min-width: 0;
    margin: 0;
}

.plan-progress-node:not(.is-open) > .plan-progress-children {
    display: none;
}

.plan-progress-tree .plan-progress-children > ul {
    display: block;
    margin-left: 0.95rem;
    padding-left: 0.65rem;
    border-left: 1px solid var(--admin-shell-border);
}

.plan-progress-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
}

.plan-progress-line:hover {
    background: var(--admin-shell-surface-alt);
}

.plan-progress-line-name {
    flex: 1 1 14rem;
    min-width: 0;
}

.plan-progress-line-figures {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1rem;
}

.plan-progress-cell {
    display: inline-flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 4.5rem;
    font-variant-numeric: tabular-nums;
}

.plan-progress-cell-label {
    color: var(--admin-shell-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.plan-progress-pending {
    display: block;
    margin-top: 0.15rem;
    color: #85570a;
    font-size: 0.78rem;
}

.plan-progress-over {
    color: #a33d4b;
    font-weight: 700;
}

.plan-progress-note {
    color: var(--admin-shell-muted);
    font-size: 0.8rem;
}

@media (max-width: 767.98px) {
    .plan-activity-view-summary-grid.plan-progress-figures {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .plan-progress-filter {
        flex: 1 1 100%;
    }

    .plan-progress-line-figures {
        width: 100%;
    }
}

/* Record results (project-activity-task-implementation/reporting): one card per running task */
/* the task cards are the surfaces: no page card around them */
.backend-page-surface:has(> .backend-page-body > .planning-reporting) {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.planning-reporting {
    max-width: 1100px;
}

.planning-reporting-intro {
    margin: 0 0 1rem;
    color: var(--ui-muted);
    max-width: 70ch;
}

.planning-reporting-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0 0.6rem;
    color: var(--ui-ink);
    font-size: 0.95rem;
    font-weight: 700;
}

.planning-reporting-switch + .planning-reporting-group,
.planning-reporting-intro + .planning-reporting-group {
    margin-top: 0.5rem;
}

.planning-count {
    min-width: 1.5rem;
    padding: 0.05rem 0.45rem;
    border-radius: var(--ui-radius-pill);
    background: var(--ui-line-soft);
    color: var(--ui-muted);
    font-size: 0.75rem;
    text-align: center;
}

.planning-reporting-switch {
    margin-bottom: 0.5rem;
}

.planning-task-list {
    display: grid;
    gap: 0.75rem;
}

.planning-task {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "head action" "body body";
    column-gap: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-card);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-card);
}

.planning-task.needs-attention {
    border-left: 4px solid #c58a1b;
}

.planning-task.planning-reporting-empty {
    display: block;
}

.planning-task-head {
    grid-area: head;
    min-width: 0;
}

.planning-task-action {
    grid-area: action;
    align-self: start;
}

.planning-task-action .btn {
    min-width: 8.5rem;
}

.planning-task-title {
    color: var(--ui-ink);
    font-size: 1.02rem;
    font-weight: 700;
    text-decoration: none;
}

.planning-task-title:hover,
.planning-task-title:focus {
    color: var(--ui-accent);
    text-decoration: underline;
}

.planning-task-where {
    margin-top: 0.1rem;
    color: var(--ui-muted);
    font-size: 0.85rem;
}

.planning-task-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.35rem;
    margin-top: 0.35rem;
    color: var(--ui-muted);
    font-size: 0.85rem;
}

.planning-task-facts strong {
    color: var(--ui-ink);
    font-weight: 600;
}

.planning-task-fact {
    white-space: nowrap;
}

.planning-indicators {
    grid-area: body;
    margin: 0.85rem 0 0;
    padding: 0;
    border-top: 1px solid var(--ui-line-soft);
}

.planning-indicator {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(7rem, auto);
    align-items: center;
    gap: 0.4rem 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--ui-line-soft);
    font-size: 0.875rem;
}

.planning-indicator:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.planning-indicator-name {
    color: var(--ui-ink);
}

.planning-indicator-bar {
    height: 0.45rem;
    margin-bottom: 0.25rem;
    border-radius: var(--ui-radius-pill);
    background: var(--ui-line-soft);
    overflow: hidden;
}

.planning-indicator-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--ui-accent);
}

.planning-indicator-bar.is-success span {
    background: var(--ui-success);
}

.planning-indicator-bar.is-warning span {
    background: #c58a1b;
}

.planning-indicator-bar.is-danger span {
    background: var(--ui-danger);
}

.planning-indicator-text {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.5rem;
    color: var(--ui-muted);
}

.planning-indicator-text strong {
    color: var(--ui-ink);
}

.planning-indicator-togo {
    margin-left: auto;
}

.planning-indicator-status {
    text-align: right;
}

.planning-indicator-status .plan-progress-pending {
    font-size: 0.75rem;
}

.planning-reporting-rejected {
    margin-bottom: 1rem;
    padding: 0.85rem 1.15rem;
    border: 1px solid #e5c3c9;
    border-radius: var(--ui-radius-card);
    background: var(--ui-danger-soft);
}

.planning-reporting-rejected .planning-reporting-group {
    margin-top: 0;
    color: var(--ui-danger);
}

.planning-rejected-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.5rem 0;
    border-top: 1px solid #ecd2d7;
}

.planning-rejected-reason {
    margin-top: 0.15rem;
    font-size: 0.85rem;
}

.planning-reporting-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
}

.planning-reporting-filters .form-control {
    flex: 1 1 18rem;
    max-width: 26rem;
}

.planning-reporting-filters .form-select {
    flex: 0 1 16rem;
    width: auto;
}

.planning-reporting-result {
    margin: 0 0 0.25rem;
    color: var(--ui-muted);
    font-size: 0.875rem;
}

.planning-reporting-more {
    margin: 0 0 0.5rem;
    padding: 0.55rem 0.85rem;
    border-radius: var(--ui-radius-control);
    background: var(--ui-accent-soft);
    color: var(--ui-ink);
    font-size: 0.875rem;
}

.planning-project-list {
    display: grid;
    gap: 0.6rem;
}

.planning-project > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-control);
    background: var(--ui-surface);
    color: var(--ui-ink);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.planning-project > summary::-webkit-details-marker {
    display: none;
}

.planning-project > summary::before {
    content: "";
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--ui-muted);
    border-bottom: 2px solid var(--ui-muted);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}

.planning-project[open] > summary::before {
    transform: rotate(45deg);
}

.planning-project > summary:focus-visible {
    outline: 2px solid var(--ui-focus);
    outline-offset: 2px;
}

.planning-project.has-attention > summary {
    border-left: 4px solid #c58a1b;
}

.planning-reporting-summary {
    color: var(--ui-muted);
    font-weight: 400;
}

.planning-project-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.planning-project > summary .planning-count,
.planning-project > summary .plan-activity-badge {
    flex: none;
    white-space: nowrap;
}

.planning-project > .planning-task-list {
    margin: 0.6rem 0 0.25rem 0.9rem;
}

@media (max-width: 767.98px) {
    .planning-reporting-filters .form-control,
    .planning-reporting-filters .form-select {
        flex: 1 1 100%;
        max-width: none;
    }

    .planning-project > .planning-task-list {
        margin-left: 0;
    }

    .planning-task {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "head" "body" "action";
        padding: 0.9rem;
    }

    .planning-task-action {
        margin-top: 0.85rem;
    }

    .planning-task-action .btn {
        width: 100%;
    }

    .planning-indicator {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .planning-indicator-name {
        grid-column: 1;
    }

    .planning-indicator-status {
        grid-column: 2;
        grid-row: 1;
    }

    .planning-indicator-figure {
        grid-column: 1 / -1;
    }

    .planning-rejected-item {
        flex-direction: column;
        gap: 0.4rem;
    }
}

.backend-admin-sidebar-search-shell {
    padding: 0.55rem 0.9rem 0.5rem;
}

/* Nothing pinned: the panel holds no visible content, so take no room. */
.backend-admin-sidebar-pinned-panel.is-empty {
    display: none;
}

.backend-admin-sidebar-panel {
    display: grid;
    gap: 0.55rem;
    padding: 0 0.9rem 0.85rem;
}

.backend-admin-sidebar-kicker {
    color: var(--admin-shell-sidebar-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.backend-admin-sidebar-search {
    position: relative;
}

.backend-admin-sidebar-search > i {
    position: absolute;
    top: 50%;
    left: 0.78rem;
    transform: translateY(-50%);
    color: #8aabc8;
    pointer-events: none;
}

.backend-admin-sidebar-search .form-control {
    min-height: 2.35rem;
    padding-left: 2.35rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    color: var(--admin-shell-sidebar-text);
    font-size: 0.8125rem;
}

.backend-admin-sidebar-search .form-control:focus {
    border-color: rgba(91, 155, 213, 0.4);
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(91, 155, 213, 0.15);
}

.backend-admin-sidebar-search .form-control::placeholder {
    color: #8aabc8;
    font-size: 0.8125rem;
}

.backend-admin-sidebar .backend-admin-sidebar-find {
    display: flex;
    margin-top: 0.45rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-md);
    background: rgba(91, 155, 213, 0.18);
    color: #fff;
    font-size: 0.8125rem;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.backend-admin-sidebar .backend-admin-sidebar-find[hidden] {
    display: none;
}

.backend-admin-sidebar .backend-admin-sidebar-find:hover,
.backend-admin-sidebar .backend-admin-sidebar-find:focus-visible {
    background: rgba(91, 155, 213, 0.32);
    color: #fff;
}

.backend-admin-sidebar .backend-admin-sidebar-find strong {
    color: inherit;
}

.backend-admin-sidebar .backend-admin-sidebar-find kbd {
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
    padding: 0.05rem 0.35rem;
    background: rgba(255, 255, 255, 0.12);
    color: #cfe0f0;
    font-size: 0.7rem;
}

.backend-admin-pinned-links {
    display: grid;
    gap: 0.45rem;
}

.backend-admin-pinned-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 2.35rem;
    padding: 0.62rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.04);
    color: #e5edf6;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.backend-admin-pinned-link span,
.backend-admin-pinned-link i {
    color: #e5edf6 !important;
}

.backend-admin-pinned-link:hover span,
.backend-admin-pinned-link:hover i,
.backend-admin-pinned-link.is-active span,
.backend-admin-pinned-link.is-active i {
    color: #ffffff !important;
}

.backend-admin-pinned-link:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateY(-1px);
}

.backend-admin-pinned-link.is-active {
    border-color: rgba(91, 155, 213, 0.25);
    background: rgba(99, 148, 210, 0.12);
    color: #ffffff;
    box-shadow: inset 3px 0 0 #5b9bd5;
}

.backend-admin-pinned-link i {
    width: 1rem;
    text-align: center;
    color: inherit;
}

.backend-admin-sidebar-empty {
    margin: 0.2rem 0.9rem 1rem;
    padding: 0.75rem 0.85rem;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    color: var(--admin-shell-sidebar-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.backend-admin-nav .backend-sidebar-search-hit {
    color: #7db8e8;
}

.backend-admin-nav .backend-sidebar-search-hit p {
    color: inherit;
}

.backend-admin-nav .backend-sidebar-search-open > .nav-link {
    background: rgba(59, 103, 166, 0.08);
}

body.sidebar-mini.sidebar-collapse .backend-admin-sidebar-search-shell,
body.sidebar-mini.sidebar-collapse .backend-admin-sidebar-panel,
body.sidebar-mini.sidebar-collapse .backend-admin-sidebar-empty {
    display: none;
}

.backend-admin-sidebar-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.backend-admin-sidebar-clear {
    border: 0;
    background: transparent;
    color: var(--admin-shell-sidebar-muted);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0;
}

.backend-admin-sidebar-clear:hover {
    color: #ffffff;
}

.backend-admin-pinned-empty {
    color: var(--admin-shell-sidebar-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.backend-admin-nav .backend-sidebar-pinnable {
    position: relative;
}

/* A label is shown whole. The pin comes up over the end of the row only while
   the row is pointed at, so no room is kept for it; room is kept only where
   the pin always shows: on a pinned item and on touch widths. A label too
   long for the row goes onto a second line and is not cut short. */
.backend-admin-nav .backend-sidebar-pinnable:has(> .backend-admin-pin-toggle.is-active) > .nav-link {
    padding-right: 2.4rem;
}

body:not(.sidebar-collapse) .backend-admin-nav .nav-link {
    align-items: flex-start;
}

body:not(.sidebar-collapse) .backend-admin-nav .nav-link > p {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.3;
}

body:not(.sidebar-collapse) .backend-admin-nav .nav-link > .nav-icon {
    line-height: 1.3;
    flex: 0 0 auto;
}

.backend-admin-nav .backend-sidebar-pinnable:hover > .backend-admin-pin-toggle,
.backend-admin-nav .backend-sidebar-pinnable:focus-within > .backend-admin-pin-toggle {
    background: #1b3a5c;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* A count is kept whole at the end of its row; the pin of that row comes up
   beside it, not over it. */
.backend-admin-nav .nav-link .pull-right-container {
    position: absolute;
    top: 50%;
    right: 0.65rem;
    transform: translateY(-50%);
    display: inline-flex;
}

.backend-admin-nav .nav-link .pull-right-container .nav-badge {
    margin: 0 !important;
    min-width: 1.25rem;
    min-height: 0;
    height: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.7rem;
    line-height: 1;
    justify-content: center;
}

.backend-admin-nav .nav-link > p:has(.pull-right-container) {
    padding-right: 1.7rem;
}

.backend-admin-nav .backend-sidebar-pinnable:has(.pull-right-container) > .backend-admin-pin-toggle {
    right: 2.2rem;
}

.backend-admin-nav .backend-sidebar-pinnable:has(.pull-right-container):has(> .backend-admin-pin-toggle.is-active) > .nav-link {
    padding-right: 2.2rem;
}

@media (max-width: 991.98px) {
    .backend-admin-nav .backend-sidebar-pinnable > .nav-link {
        padding-right: 2.4rem;
    }

    .backend-admin-nav .backend-sidebar-pinnable:has(.pull-right-container) > .nav-link {
        padding-right: 2.2rem;
    }
}

.backend-admin-pin-toggle {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    transform: translateY(-50%);
    width: 1.6rem;
    height: 1.6rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: #8aabc8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    font-size: 0.75rem;
    transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.backend-admin-nav .backend-sidebar-pinnable:hover > .backend-admin-pin-toggle,
.backend-admin-nav .backend-sidebar-pinnable:focus-within > .backend-admin-pin-toggle,
.backend-admin-pin-toggle.is-active {
    opacity: 1;
}

.backend-admin-pin-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #c8d5e2;
}

.backend-admin-pin-toggle.is-active {
    background: rgba(91, 155, 213, 0.2);
    color: #5b9bd5;
}

.backend-admin-pin-toggle i {
    line-height: 1;
}

@media (max-width: 991.98px) {
    .backend-admin-pin-toggle {
        opacity: 1;
    }
}

.task-queue-page .kv-grid-table thead th {
    white-space: nowrap;
}

.task-page-mode-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.22rem;
    border: 1px solid rgba(21, 38, 55, 0.08);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(247, 250, 252, 0.96) 0%, rgba(240, 245, 249, 0.96) 100%);
    overflow-x: auto;
    scrollbar-width: thin;
}

.backend-page-actions .task-page-action {
    min-height: 2.3rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: none;
}

.backend-page-actions .task-page-action--mode {
    border: 0;
    background: transparent;
    color: var(--admin-shell-muted);
}

.backend-page-actions .task-page-action--mode:hover,
.backend-page-actions .task-page-action--mode:focus {
    background: rgba(255, 255, 255, 0.82);
    color: var(--admin-shell-heading);
}

.backend-page-actions .task-page-action--mode:focus-visible {
    outline: 2px solid var(--admin-shell-accent, #2a6282);
    outline-offset: -2px;
}

.backend-page-actions .task-page-action--mode.is-active {
    background: linear-gradient(180deg, #ffffff 0%, #f6fafc 100%);
    color: var(--admin-shell-accent);
    box-shadow: 0 10px 24px -18px rgba(36, 95, 143, 0.45);
}

@media (max-width: 767.98px) {
    .backend-page-actions {
        width: 100%;
    }

    .task-page-mode-switch {
        width: 100%;
        justify-content: flex-start;
        gap: 0.25rem;
        padding: 0.18rem;
    }

    /* not the full width every page action takes on a phone: the options sit side by side */
    .backend-page-actions .task-page-action--mode {
        flex: 0 0 auto;
        width: auto;
        min-height: 2.1rem;
        padding-inline: 0.75rem;
        white-space: nowrap;
    }

    .task-queue-page .table-responsive {
        border-radius: var(--radius-lg);
    }

    .task-queue-page .kv-grid-table {
        min-width: 760px;
    }

    .task-queue-page .task-queue-filters td {
        min-width: 156px;
        padding-top: 0.42rem;
        padding-bottom: 0.42rem;
    }
}

.task-queue-page .task-queue-head th {
    color: #415a6d;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(244, 248, 252, 0.9);
    border-bottom-color: rgba(21, 38, 55, 0.14);
    border-bottom-width: 1px;
}

.task-queue-page .task-queue-filters td {
    vertical-align: top;
    background: rgba(248, 250, 252, 0.72);
    border-top: 0;
    border-bottom: 1px solid rgba(21, 38, 55, 0.05);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.task-queue-page .task-queue-filters .form-control,
.task-queue-page .task-queue-filters .form-select,
.task-queue-page .task-queue-filters select,
.task-queue-page .task-queue-filters .input-group,
.task-queue-page .task-queue-filters .select2-container {
    width: 100% !important;
    min-width: 0;
}

.task-queue-page .task-queue-filters .form-control,
.task-queue-page .task-queue-filters .form-select,
.task-queue-page .task-queue-filters select,
.task-queue-page .task-queue-filters .select2-container .select2-selection {
    min-height: 2.15rem;
    border: 1px solid rgba(21, 38, 55, 0.08);
    border-radius: 0.72rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: none;
    font-size: 0.92rem;
}

.task-queue-page .task-queue-filters .select2-container .select2-selection {
    display: flex;
    align-items: center;
}

.task-queue-page .task-queue-filters .select2-container--krajee-bs5 .select2-selection--single .select2-selection__rendered,
.task-queue-page .task-queue-filters .select2-container .select2-selection__rendered {
    padding-left: 0.8rem;
    padding-right: 2rem;
    color: var(--admin-shell-text);
    line-height: 1.2;
}

.task-queue-page .task-queue-filters .select2-container .select2-selection__arrow {
    height: 100%;
}

.task-queue-page .task-queue-filters .form-control::placeholder {
    color: rgba(90, 108, 122, 0.76);
}

.task-queue-page .table tbody td {
    vertical-align: middle;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.task-queue-page .kv-grid-table tbody tr {
    transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.task-queue-page .kv-grid-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 253, 0.5);
}

.task-queue-page .kv-grid-table tbody tr:hover {
    background: rgba(236, 244, 250, 0.72);
}

.task-queue-page .kv-grid-table tbody tr.rowclicable:hover {
    box-shadow: inset 3px 0 0 rgba(36, 95, 143, 0.16);
}

.task-queue-page .kv-grid-table tbody tr.rowclicable:focus-visible {
    box-shadow: inset 3px 0 0 rgba(36, 95, 143, 0.4);
    outline: 2px solid rgba(36, 95, 143, 0.3);
    outline-offset: -2px;
    background: rgba(244, 249, 252, 0.85);
}

.task-queue-page .task-queue-item {
    display: grid;
    gap: 0.15rem;
}

.task-queue-page .task-queue-title {
    color: var(--admin-shell-heading);
    font-weight: 500;
    line-height: 1.3;
}

.task-queue-page .task-queue-reference,
.task-queue-page .task-queue-date {
    color: var(--admin-shell-heading);
    font-weight: 400;
    line-height: 1.3;
}

.task-queue-page .task-queue-reference {
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.88rem;
}

.task-queue-page .task-queue-meta,
.task-queue-page .task-queue-submeta {
    color: var(--admin-shell-muted);
    font-size: 0.83rem;
    font-weight: 400;
    line-height: 1.35;
}

.task-queue-page .task-queue-entity {
    color: var(--admin-shell-heading);
    font-weight: 400;
    line-height: 1.35;
}

.task-queue-page .task-queue-worker {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.78rem;
    color: #3d845c;
    font-weight: 450;
}

.task-queue-page .task-queue-worker i {
    font-size: 0.68rem;
}

.task-queue-page .task-queue-type {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    padding: 0.15rem 0.7rem;
    border: 1px solid rgba(24, 88, 122, 0.12);
    border-radius: 999px;
    background: linear-gradient(180deg, #f7fbff 0%, #eef5fa 100%);
    color: #46697f;
    font-size: 0.8rem;
    font-weight: 500;
}

.task-queue-page .task-queue-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.95rem;
    padding: 0.2rem 0.72rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.task-queue-page .task-queue-status.is-primary {
    background: #e8f0f7;
    color: #2f6b8b;
}

.task-queue-page .task-queue-status.is-success {
    background: #e9f5ef;
    color: #3d845c;
}

.task-queue-page .task-queue-status.is-warning {
    background: #fbf3e7;
    color: #b07b24;
}

.task-queue-page .task-queue-status.is-neutral {
    background: #eef3f7;
    color: #667b8b;
}

.task-queue-page .task-queue-status-head,
.task-queue-page .task-queue-action-head {
    width: 1%;
}

.task-queue-page .task-queue-status-cell,
.task-queue-page .task-queue-action-cell {
    white-space: nowrap;
    text-align: center;
}

.task-queue-page .task-queue-status-filter {
    min-width: 7.5rem;
}

.task-queue-page .task-queue-status {
    min-height: 1.72rem;
    padding: 0.14rem 0.58rem;
    font-size: 0.76rem;
    letter-spacing: 0.01em;
}

.task-queue-page .task-queue-action-cell > a:not(.btn),
.task-queue-page .task-queue-action-cell .btn.btn-sm {
    width: 1.86rem;
    height: 1.86rem;
    min-width: 1.86rem;
    min-height: 1.86rem;
    padding: 0.22rem;
    border-radius: 0.72rem;
}

.task-queue-page .task-queue-action-cell > a:not(.btn) {
    border-color: rgba(21, 38, 55, 0.1);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    color: #5c7083;
}

.task-queue-page .task-queue-action-cell > a:not(.btn):hover,
.task-queue-page .task-queue-action-cell > a:not(.btn):focus {
    border-color: rgba(36, 95, 143, 0.16);
    background: #f2f7fd;
    color: #2a6282;
}

@media (max-width: 991.98px) {
    .task-queue-page .task-queue-filters td {
        min-width: 180px;
    }
}

/* ── Process stepper / linked-stages horizontal scroller ── */

.process .process-widget.info-box {
    background: #fff;
    border-radius: 0.75rem;
    padding: 0.5rem 0.25rem;
}

.process-widget .steps {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    -webkit-overflow-scrolling: touch;
}

.process-widget .steps::-webkit-scrollbar {
    height: 4px;
}

.process-widget .steps::-webkit-scrollbar-track {
    background: transparent;
}

.process-widget .steps::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Override Bootstrap carousel: show ALL items side-by-side */
.process-widget .md-stepper-horizontal {
    display: flex;
    width: 100%;
    background: transparent;
    gap: 0;
}

.process-widget .carousel {
    flex: 1 1 100%;
    width: 100%;
}

.process-widget .carousel-inner {
    display: flex !important;
    flex-wrap: nowrap;
    overflow: visible;
    width: 100%;
}

.process-widget .carousel-item {
    display: block !important;
    flex: 1 1 0%;
    min-width: 100px;
    margin-right: 0;
    opacity: 1 !important;
}

/* Hide carousel controls – not needed when all items are visible */
.process-widget .carousel-control-prev,
.process-widget .carousel-control-next {
    display: none !important;
}

/* ── Step styling ── */

.process-widget .md-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}

.process-widget a.md-step[href] {
    cursor: pointer;
}

.process-widget .md-step:hover {
    background-color: #f1f5f9;
}

/* Circle */
.process-widget .md-step .md-step-circle {
    width: 34px;
    height: 34px;
    line-height: 34px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.process-widget .md-step:hover .md-step-circle {
    transform: scale(1.12);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Title */
.process-widget .md-step .md-step-title {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0.01em;
    color: #64748b;
    transition: color 0.2s ease;
}

.process-widget .md-step.active .md-step-title,
.process-widget .md-step.inprogress .md-step-title {
    color: #1e293b;
}

.process-widget .md-step.active-nav .md-step-title {
    color: var(--bs-primary);
}

/* Active-nav highlight */
.process-widget .md-step.active-nav {
    background-color: rgba(13, 110, 253, 0.06);
    border-bottom: 1px solid var(--bs-card-border-color);
    border-radius: 0.5rem 0.5rem 0 0;
}

/* Connecting bars */
.process-widget .md-step .md-step-bar-left,
.process-widget .md-step .md-step-bar-right {
    top: 24px;
    height: 2px;
    border-top-width: 2px;
    border-top-style: solid;
    border-top-color: #e2e8f0;
}

.process-widget .md-step.active .md-step-bar-left,
.process-widget .md-step.done .md-step-bar-left,
.process-widget .md-step.inprogress .md-step-bar-left {
    border-top-color: RGBA(var(--bs-success-rgb), 0.55);
}

/* ═══════════════════════════════════════════════════════════════
   ERROR PAGE
   ═══════════════════════════════════════════════════════════════ */

.backend-error-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    padding: var(--sp-8) var(--sp-4);
}

.backend-error-card {
    text-align: center;
    max-width: 480px;
    padding: var(--sp-8) var(--sp-6);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-xl);
    background: var(--clr-surface-raised);
    box-shadow: var(--shadow-md);
}

.backend-error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    margin-bottom: var(--sp-4);
    border-radius: var(--radius-xl);
    background: var(--clr-warning-soft);
    color: var(--clr-warning);
    font-size: var(--fs-2xl);
}

.backend-error-code {
    color: var(--clr-heading);
    font-size: 3.5rem;
    font-weight: var(--fw-bold);
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: var(--sp-2);
}

.backend-error-title {
    color: var(--clr-heading);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    margin: 0 0 var(--sp-3);
}

.backend-error-message {
    color: var(--clr-muted);
    font-size: var(--fs-base);
    line-height: 1.6;
    margin-bottom: var(--sp-6);
}

/* ═══════════════════════════════════════════════════════════════
   UNIFIED STATUS BADGES
   ═══════════════════════════════════════════════════════════════ */

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.03em;
    line-height: 1.4;
}

.badge-status-active,
.badge-status-success {
    background: var(--clr-success-soft);
    color: var(--clr-success);
    border: 1px solid #bfd8c9;
}

.badge-status-pending,
.badge-status-warning {
    background: var(--clr-warning-soft);
    color: var(--clr-warning);
    border: 1px solid #ead7bb;
}

.badge-status-danger,
.badge-status-expired {
    background: var(--clr-danger-soft);
    color: var(--clr-danger);
    border: 1px solid #e0b8c0;
}

.badge-status-info,
.badge-status-primary {
    background: var(--clr-primary-soft);
    color: var(--clr-primary);
    border: 1px solid #c9d9e6;
}

.badge-status-neutral,
.badge-status-inactive {
    background: var(--clr-surface-alt);
    color: var(--clr-muted);
    border: 1px solid var(--clr-border);
}

/* ═══════════════════════════════════════════════════════════════
   TABLE ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════ */

.backend-table-widget .empty {
    padding: var(--sp-8) var(--sp-4);
    border: 1px dashed var(--clr-border);
    border-radius: var(--radius-lg);
    background: var(--clr-surface-alt);
    color: var(--clr-muted);
    font-weight: var(--fw-semibold);
    text-align: center;
}

.backend-table-action-cell {
    text-align: right;
    white-space: nowrap;
}

.backend-table-action-cell a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-md);
    color: var(--clr-muted);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.backend-table-action-cell a:hover {
    background: var(--clr-primary-soft);
    color: var(--clr-primary);
}

.backend-table-action-head {
    text-align: right;
}

/* ═══════════════════════════════════════════════════════════════
   DETAIL VIEW ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════ */

.backend-admin-theme .kv-detail-view th,
.backend-admin-theme .detail-view th {
    color: var(--clr-text);
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    background: var(--clr-surface-alt);
}

.backend-admin-theme .kv-detail-view td,
.backend-admin-theme .detail-view td {
    color: var(--clr-heading);
    font-size: var(--fs-base);
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL REFINEMENTS
   ═══════════════════════════════════════════════════════════════ */

.modal-content {
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(180deg, #f6f8fb 0%, #eef2f7 100%);
    border-bottom: 1px solid var(--clr-border);
    padding: var(--sp-3) var(--sp-4);
}

.modal-title {
    color: var(--clr-heading);
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
}

.modal-body {
    padding: var(--sp-4);
}

.modal-footer {
    background: var(--clr-surface-alt);
    border-top: 1px solid var(--clr-border);
    padding: var(--sp-3) var(--sp-4);
    gap: var(--sp-2);
}

#mainModal .modal-body .spinner-border {
    color: var(--clr-primary);
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR SEARCH & PIN POLISH
   ═══════════════════════════════════════════════════════════════ */

.backend-sidebar-search {
    padding: 0 var(--sp-3) var(--sp-3);
}

.backend-sidebar-search .form-control {
    min-height: 36px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--clr-sidebar-text);
    font-size: var(--fs-sm);
    padding-left: var(--sp-4);
}

.backend-sidebar-search .form-control::placeholder {
    color: var(--clr-sidebar-muted);
}

.backend-sidebar-search .form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.backend-sidebar-pin-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    color: var(--clr-sidebar-muted);
    font-size: 0.7rem;
    font-weight: var(--fw-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.backend-sidebar-pin-clear {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.backend-sidebar-pin-clear:hover {
    opacity: 1;
}

.backend-sidebar-pinned-empty {
    padding: var(--sp-2) var(--sp-3);
    color: var(--clr-sidebar-muted);
    font-size: var(--fs-sm);
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   FORM FIELD ERROR STATE ENHANCEMENT
   ═══════════════════════════════════════════════════════════════ */

.backend-admin-theme .has-error .form-control,
.backend-admin-theme .has-error .form-select,
.backend-admin-theme .is-invalid {
    border-color: var(--clr-danger) !important;
    box-shadow: 0 0 0 0.2rem rgba(157, 59, 71, 0.12) !important;
}

.backend-admin-theme .has-error .help-block,
.backend-admin-theme .invalid-feedback {
    color: var(--clr-danger) !important;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE REFINEMENTS
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 767.98px) {
    .backend-error-shell {
        padding: var(--sp-4) var(--sp-3);
        min-height: 40vh;
    }

    .backend-error-code {
        font-size: 2.5rem;
    }

    .backend-error-card {
        padding: var(--sp-6) var(--sp-4);
    }
}
/* #w0 a{} */

/* ── Iframe popup states ──────────────────────────────────────── */
.fancybox-slide .fancybox-content {
    position: relative;
}

/* Loading overlay backdrop */
.fancybox-slide.iframe-is-loading .iframe-loading-state {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(5, 56, 97, 0.07) 0%, rgba(66, 134, 189, 0.1) 100%);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* Loading card */
.iframe-loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    border-radius: 16px;
    padding: 36px 40px 30px;
    box-shadow: 0 8px 40px rgba(5, 56, 97, 0.18), 0 2px 8px rgba(0,0,0,0.06);
    max-width: 340px;
    width: 90%;
    animation: iframe-card-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes iframe-card-in {
    from { opacity: 0; transform: scale(0.88) translateY(12px); }
    to   { opacity: 1; transform: scale(1)   translateY(0);    }
}

/* Concentric animated rings */
.iframe-loading-rings {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.iframe-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: iframe-spin linear infinite;
}

.iframe-ring-1 {
    width: 80px; height: 80px;
    border-top-color: #053861;
    border-right-color: rgba(5, 56, 97, 0.2);
    animation-duration: 1.1s;
}

.iframe-ring-2 {
    width: 60px; height: 60px;
    border-top-color: #4286bd;
    border-right-color: rgba(66, 134, 189, 0.2);
    animation-duration: 0.85s;
    animation-direction: reverse;
}

.iframe-ring-3 {
    width: 40px; height: 40px;
    border-top-color: #ffc107;
    border-right-color: rgba(255, 193, 7, 0.2);
    animation-duration: 1.4s;
}

@keyframes iframe-spin { to { transform: rotate(360deg); } }

.iframe-loading-icon {
    position: relative;
    z-index: 1;
    animation: iframe-icon-pulse 2s ease-in-out infinite;
}

@keyframes iframe-icon-pulse {
    0%, 100% { opacity: 1;   transform: scale(1);    }
    50%       { opacity: 0.6; transform: scale(0.92); }
}

.iframe-loading-title {
    font-size: 16px;
    font-weight: 700;
    color: #053861;
    letter-spacing: 0.01em;
    margin-bottom: 6px;
}

.iframe-loading-text {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Progress bar */
.iframe-loading-bar {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 99px;
    overflow: hidden;
}

.iframe-loading-bar-fill {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #053861 0%, #4286bd 50%, #ffc107 100%);
    background-size: 200% 100%;
    animation: iframe-bar-slide 1.6s ease-in-out infinite;
}

@keyframes iframe-bar-slide {
    0%   { background-position: 200% 0; width: 30%; }
    50%  { background-position: 0%   0; width: 70%; }
    100% { background-position: 200% 0; width: 30%; }
}

/* Error state */
.fancybox-slide .iframe-error-state {
    max-width: 680px; margin: 20px auto; padding: 18px;
    border: 1px solid #e0b4b4; background: #fff4f4; border-radius: 8px; color: #6d1f1f;
}
.fancybox-slide .iframe-error-title { font-weight: 600; margin-bottom: 8px; }
.fancybox-slide .iframe-error-text  { font-size: 14px; line-height: 1.4; }
.fancybox-slide .iframe-error-actions { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fancybox-slide .iframe-open-tab { padding-left: 0; }

@media (max-width: 576px) {
    .fancybox-slide .iframe-error-state { margin: 14px; padding: 14px; }
}

/* Lightweight indicator for navigations (link clicks, form submits)
   happening inside an already-open iframe modal */
.iframe-nav-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 4;
    overflow: hidden;
    background: rgba(5, 56, 97, 0.08);
}

.iframe-nav-progress-bar {
    display: block;
    height: 100%;
    width: 40%;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(90deg, #053861 0%, #4286bd 50%, #ffc107 100%);
    animation: iframe-nav-progress-slide 1.1s ease-in-out infinite;
}

@keyframes iframe-nav-progress-slide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

.iframe-inline-loading-text {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Subtle copy column for task table */
.task-queue-page .task-queue-copy-head {
    width: 1%;
}

.task-queue-page .task-queue-copy-cell {
    white-space: nowrap;
    text-align: center;
}

.task-queue-page .task-queue-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    min-width: 1.55rem;
    min-height: 1.55rem;
    padding: 0.18rem;
    border: 1px solid transparent;
    border-radius: 0.45rem;
    background: transparent;
    color: #7f92a3;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, display 0.15s ease;
}

.task-queue-page .task-queue-copy-btn--quiet {
    opacity: 0.35;
    
}

.task-queue-page .kv-grid-table tbody tr:hover .task-queue-copy-btn--quiet,
.task-queue-page .task-queue-copy-btn--quiet:focus-visible {
    opacity: 0.95;
}

.task-queue-page .task-queue-copy-btn:hover,
.task-queue-page .task-queue-copy-btn:focus-visible {
    color: #2a6282;
    background: rgba(36, 95, 143, 0.08);
    border-color: rgba(36, 95, 143, 0.14);
}

.task-queue-page .task-queue-copy-btn:focus-visible {
    outline: 2px solid rgba(36, 95, 143, 0.28);
    outline-offset: 1px;
}

/* Task Header Reorganization Styles */
/* These classes organize the card header into three logical sections */

.card-header-primary {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.5rem 0.75rem;
}

.primary-task-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.primary-action {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}

.primary-action > .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .card-header-primary {
        padding: 0.5rem;
    }

    .primary-task-content,
    .primary-action {
        width: 100%;
    }

    /* Stretch buttons to fill each wrapped row for easier tapping */
    .primary-action > .btn {
        flex: 1 1 auto;
        min-height: 2.25rem;
    }
}

.card-header-context {
    /* Context toolbar with role, worker, and office information */
    /* Contains ProcessInstanceStageActionBarWidget */
    /* Styling to be added in next task */
}

/* Timing Badges Styling */
.timing-badges-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}

.timing-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
}

.timing-badge i {
    font-size: 0.875rem;
}

/* Elapsed Time Badge */
.timing-badge.elapsed {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #90caf9;
}

.timing-badge.elapsed i {
    color: #1976d2;
}

/* Due Date Badge */
.timing-badge.due {
    background-color: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffe0b2;
}

.timing-badge.due i {
    color: #f57c00;
}

/* Status Badges */
.timing-badge.status {
    background-color: #f5f5f5;
    color: #424242;
    border: 1px solid #e0e0e0;
}

.timing-badge.status-inprogress {
    background-color: #e0f7fa;
    color: #00838f;
    border: 1px solid #80deea;
}

.timing-badge.status-inprogress i {
    color: #00838f;
}

.timing-badge.status-due {
    background-color: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffe0b2;
}

.timing-badge.status-due i {
    color: #f57c00;
}

.timing-badge.status-overdue {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.timing-badge.status-overdue i {
    color: #c62828;
}

.timing-badge.status-completed {
    background-color: #e8f5e9;
    color: #388e3c;
    border: 1px solid #a5d6a7;
}

.timing-badge.status-completed i {
    color: #388e3c;
}

.backend-admin-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 16, 24, 0.45);
    z-index: 1037;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.backend-admin-sidebar-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.2s ease;
}

.backend-admin-sidebar-close {
    border: 0;
    background: transparent;
    color: #fff;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 991.98px) {
    body.sidebar-open {
        overflow: hidden;
    }

    .backend-admin-sidebar {
        transition: margin-left 0.2s ease;
        z-index: 1038;
    }

    .app-main-wrapper,
    .backend-admin-main {
        width: 100%;
        min-width: 0;
    }

    .backend-admin-content-inner {
        min-width: 0;
    }
}

/* Responsive Design */
@media (max-width: 576px) {
    .timing-badges-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .timing-badge {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .backend-admin-content-inner {
        gap: 0.75rem;
        padding: 0.7rem 0.5rem 0.95rem;
        min-width: 0;
        max-width: 100%;
    }

    .backend-admin-context-bar {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        padding: 0.7rem 0.75rem;
        max-width: 100%;
        overflow: hidden;
    }

    .backend-admin-context-bar.is-open {
        display: flex;
    }

    .backend-admin-context-toggle-item {
        display: block !important;
    }

    .backend-admin-context-collapse {
        display: none;
    }

    .backend-admin-context-actions {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.15rem;
        scrollbar-width: thin;
        max-width: 100%;
    }

    .backend-admin-context-link {
        flex: 0 0 auto;
        width: auto;
        min-height: 2.75rem;
        padding: 0.45rem 0.75rem;
        font-size: 0.82rem;
    }

    .backend-page-head {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        padding: 0.75rem 0.8rem;
    }

    .backend-page-actions-wrap,
    .backend-page-actions {
        justify-content: flex-start;
    }

    .backend-page-actions {
        width: 100%;
        gap: 0.45rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 0.15rem;
    }

    .backend-page-actions > .btn,
    .backend-page-actions .btn-group {
        flex: 0 0 auto;
        width: auto;
    }

    .backend-page-surface {
        padding: 0.3rem 0.25rem;
        border-radius: var(--radius-md);
    }

    .backend-page-surface,
    .workspace-surface,
    .backend-admin-theme .grid-view,
    .backend-admin-theme .table-responsive,
    .backend-table-widget {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .backend-page-head {
        max-width: 100%;
        overflow: hidden;
    }

    .backend-admin-theme .grid-view table,
    .backend-admin-theme .kv-grid-table,
    .backend-table-widget table {
        min-width: 600px;
    }

    .backend-table-widget .kv-grid-table thead th,
    .backend-table-widget .kv-grid-table tbody td {
        padding: 0.45rem 0.55rem;
        font-size: 0.84rem;
    }

    .backend-table-widget .backend-table-action-cell {
        position: sticky;
        right: 0;
        background: #fff;
        box-shadow: -2px 0 4px rgba(0, 0, 0, 0.06);
        z-index: 2;
    }

    .backend-table-widget .backend-table-action-head {
        position: sticky;
        right: 0;
        background: linear-gradient(180deg, #f6f6f6 0%, #e8e8e8 100%);
        box-shadow: -2px 0 4px rgba(0, 0, 0, 0.06);
        z-index: 3;
    }

    .backend-table-widget .kv-grid-table input.form-control,
    .backend-table-widget .kv-grid-table select.form-select {
        min-height: 38px;
        font-size: 0.84rem;
    }

    .backend-table-summary {
        font-size: 0.78rem;
        padding: 0.5rem 0.65rem;
    }

    .backend-admin-theme .btn,
    .backend-admin-theme .form-control,
    .backend-admin-theme .form-select {
        min-height: 44px;
    }

    .task-page-mode-switch {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 767.98px) {
    .backend-admin-theme .modal-dialog {
        margin: 0;
        max-width: 100%;
        min-height: 100vh;
    }

    .backend-admin-theme .modal-content {
        border: 0;
        border-radius: 0;
        min-height: 100vh;
    }

    .backend-admin-theme .modal-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: #fff;
        border-bottom: 1px solid var(--admin-shell-border);
        padding: 0.85rem 1rem;
    }

    .backend-admin-theme .modal-header .btn-close {
        width: 2.5rem;
        height: 2.5rem;
        padding: 0;
    }

    .backend-admin-theme .modal-body {
        padding: 0.85rem 0.9rem;
    }

    .backend-admin-theme .modal-footer {
        position: sticky;
        bottom: 0;
        z-index: 10;
        background: #fff;
        border-top: 1px solid var(--admin-shell-border);
        padding: 0.75rem 0.9rem;
        gap: 0.5rem;
    }

    .backend-admin-theme .modal-footer .btn {
        flex: 1 1 auto;
        min-height: 44px;
    }
}

@media (max-width: 767.98px) {
    .backend-admin-theme .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        gap: 0;
        border-bottom: 1px solid var(--admin-shell-border);
    }

    .backend-admin-theme .nav-tabs .nav-item {
        flex: 0 0 auto;
    }

    .backend-admin-theme .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 0.7rem 1rem;
        min-height: 44px;
    }
}

@media (max-width: 767.98px) {
    .rbac-role-chip-list {
        gap: 0.35rem;
    }

    .rbac-role-chip {
        padding: 0.3rem 0.6rem;
        font-size: 0.78rem;
        min-height: 2rem;
    }
}

/* ==========================================================================
   Responsive hardening: tablets, touch devices, notched/iOS screens
   ========================================================================== */

/* Never let content push the page wider than the viewport */
.backend-admin-theme .backend-admin-content img,
.backend-admin-theme .backend-admin-content video,
.backend-admin-theme .backend-admin-content iframe,
.backend-admin-theme .backend-admin-content canvas {
    max-width: 100%;
    height: auto;
}

.backend-admin-theme .backend-admin-content pre {
    max-width: 100%;
    overflow-x: auto;
}

.backend-admin-theme .backend-admin-content {
    overflow-wrap: break-word;
    min-width: 0;
}

/* Grid/flex-item blowout: a data table's intrinsic width leaks up through
   grid and flex ancestors (whose items default to min-width:auto), stretching
   the whole content column past the viewport on tablets and phones. Collapse
   those structural ancestors so the table's own scroll container can size down
   and scroll, while the table and its cells keep their natural width. */
@media (max-width: 991.98px) {
    /* Anchored on the content wrapper every backend layout shares, so this also
       covers layouts with their own inner wrapper (the process layout uses
       .app-content1, which .app-content alone would miss). */
    .backend-admin-theme .backend-admin-content-inner
        *:not(table):not(thead):not(tbody):not(tr):not(th):not(td):not(.kv-grid-table):not(.dropdown-menu):not(.modal):not(.carousel-item) {
        min-width: 0;
    }

    /* The process stepper must not compress until its nowrap labels overlap.
       Wrap the steps onto more rows instead of scrolling them: .steps only ever
       had a 4px scrollbar and the carousel's prev/next buttons are hidden, so a
       horizontal scroll left the last step looking cut off with no way to reach
       it on a phone. */
    .backend-admin-theme .process-widget .carousel-inner {
        flex-wrap: wrap;
        justify-content: flex-start;
        width: auto;
        row-gap: 0.25rem;
    }

    .backend-admin-theme .process-widget .carousel-item {
        flex: 0 0 auto;
        /* Bootstrap sets width:100% on carousel items, which would make each
           step claim a whole row once wrapping is on. */
        width: auto;
        min-width: max-content;
    }

    /* Reference codes such as IQC|DI|AAKIA|0001|2025 carry no break
       opportunity, and overflow-wrap:break-word does not shrink an element's
       min-content width, so the value spills out of its cell. */
    .backend-admin-theme .process-view-accordion-body td,
    .backend-admin-theme .process-view-accordion-body th {
        overflow-wrap: anywhere;
    }

    .backend-admin-theme .process-view-accordion-body td .btn {
        white-space: normal;
        overflow-wrap: anywhere;
        max-width: 100%;
        text-align: left;
    }

    .backend-admin-theme .process-view-accordion-body td,
    .backend-admin-theme .process-view-accordion-body th {
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }

    /* Keep the label column at least as wide as its longest word, so headings
       like "Manufacturer" are not split mid-word by the rule above. */
    .backend-admin-theme .process-view-accordion-body tr > td:first-child,
    .backend-admin-theme .process-view-accordion-body tr > th:first-child {
        overflow-wrap: normal;
    }

    .backend-admin-theme .backend-page-shell,
    .backend-admin-theme .backend-page-head,
    .backend-admin-theme .backend-page-surface,
    .backend-admin-theme .backend-page-body {
        max-width: 100%;
    }

    .backend-admin-theme .table-responsive,
    .backend-admin-theme .kv-grid-container,
    .backend-admin-theme .grid-view {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
}

/* Tablet portrait/landscape: 768px - 1199.98px */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .backend-admin-theme .grid-view,
    .backend-admin-theme .table-responsive,
    .backend-table-widget {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .backend-admin-theme .grid-view table,
    .backend-admin-theme .kv-grid-table,
    .backend-table-widget table {
        min-width: 720px;
    }

    .backend-table-widget .backend-table-action-cell {
        position: sticky;
        right: 0;
        background: #fff;
        box-shadow: -2px 0 4px rgba(0, 0, 0, 0.06);
        z-index: 2;
    }

    .backend-page-head {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .backend-page-actions {
        flex-wrap: wrap;
    }

    .backend-admin-content-inner {
        padding-left: 1rem;
        padding-right: 1rem;
        max-width: 100%;
    }

    /* Wide modals must fit the tablet viewport */
    .backend-admin-theme .modal-dialog.modal-lg,
    .backend-admin-theme .modal-dialog.modal-xl {
        max-width: calc(100vw - 2rem);
        margin-left: auto;
        margin-right: auto;
    }

    .backend-admin-theme .modal-dialog-scrollable .modal-content,
    .backend-admin-theme .modal-content {
        max-height: calc(100dvh - 2rem);
    }

    .backend-admin-theme .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* AdminLTE puts grid-area on .app-header/.app-main/.app-footer, but this layout
   wraps them in .app-main-wrapper, which has no area of its own. Below lg the
   sidebar is position:fixed and leaves the grid, so the wrapper gets auto-placed
   into the sidebar's `auto` column and the empty 1fr column shows up as dead
   space on the right. Pin it to the content column instead. */
.backend-admin-shell > .app-main-wrapper {
    grid-column: 2 / -1;
    grid-row: 1 / -1;
    min-width: 0;
}

/* Sidebar drawer (below lg) must never cover the whole screen.
   AdminLTE hides it with margin-left: calc(var(--lte-sidebar-width) * -1), so the
   drawer width has to come from that same variable or part of it stays on screen. */
@media (max-width: 991.98px) {
    .backend-admin-sidebar {
        --lte-sidebar-width: min(320px, 85vw);
        width: var(--lte-sidebar-width);
        min-width: var(--lte-sidebar-width);
        max-width: var(--lte-sidebar-width);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 0 24px rgba(0, 0, 0, 0.25);
        /* Above the demo banner (1050), which otherwise swallows taps on the
           drawer's brand and close button. */
        z-index: 1052;
        display: flex;
        flex-direction: column;
    }

    .backend-admin-sidebar-overlay {
        z-index: 1051;
    }

    /* AdminLTE sizes .sidebar-wrapper as 100vh minus a 3.5rem brand, but this
       brand is 68px, so the drawer overflows and clips its own header. */
    .backend-admin-sidebar .sidebar-wrapper {
        height: auto;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }

    /* AdminLTE locks .sidebar-brand to 3.5rem with overflow:hidden, which clips
       this 68px brand row top and bottom. */
    .backend-admin-sidebar .backend-admin-brand {
        flex: 0 0 auto;
        height: auto;
        min-height: 68px;
        overflow: visible;
        /* .brand-link already carries its own 68px row and padding */
        padding-top: 0;
        padding-bottom: 0;
    }

    body:not(.sidebar-open) .backend-admin-sidebar {
        box-shadow: none;
    }

    .backend-admin-sidebar .sidebar-wrapper {
        overscroll-behavior: contain;
    }
}

/* Phones: iOS Safari zooms into inputs below 16px, and 100vh ignores the
   collapsing address bar. */
@media (max-width: 767.98px) {
    .backend-admin-theme .form-control,
    .backend-admin-theme .form-select,
    .backend-admin-theme .select2-container .select2-selection,
    .backend-admin-theme .select2-search__field,
    .backend-admin-theme textarea {
        font-size: 16px;
    }

    .backend-table-widget .kv-grid-table input.form-control,
    .backend-table-widget .kv-grid-table select.form-select {
        font-size: 16px;
    }

    @supports (height: 100dvh) {
        .backend-admin-theme .modal-dialog,
        .backend-admin-theme .modal-content {
            min-height: 100dvh;
        }
    }

    .backend-admin-theme .modal-footer {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }

    .backend-admin-theme .modal-header {
        padding-top: calc(0.85rem + env(safe-area-inset-top, 0px));
    }
}

/* Notched devices (needs viewport-fit=cover in the layout) */
.backend-admin-header {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

@media (max-width: 991.98px) {
    .backend-admin-content-inner {
        padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
        padding-bottom: max(0.95rem, env(safe-area-inset-bottom, 0px));
    }
}

/* Touch devices of any width (tablets included): comfortable tap targets */
@media (pointer: coarse) {
    .backend-admin-theme .btn:not(.btn-sm):not(.btn-close),
    .backend-admin-theme .form-control:not(textarea),
    .backend-admin-theme .form-select {
        min-height: 44px;
    }

    .backend-admin-theme .btn.btn-sm {
        min-height: 36px;
        min-width: 36px;
    }

    .backend-admin-theme .nav-link,
    .backend-admin-theme .dropdown-item,
    .backend-admin-theme .page-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .backend-admin-theme .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
    }

    /* Hover-only affordances are invisible on touch */
    .backend-admin-pin-toggle {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .backend-admin-sidebar,
    .backend-admin-theme .modal.fade .modal-dialog {
        transition: none;
    }
}

/* Process hierarchy (ProcessHierarchyWidget): the instances an instance came from, each step set in under the one it came from */
.process-hierarchy {
    margin: 1rem 0;
}

/* the page's grid already spaces it from the headline above and the details below */
.process-instance-view-page .process-hierarchy {
    margin: 0;
}

.process-hierarchy-trail {
    margin: 0;
    padding: 0;
    list-style: none;
}

.process-hierarchy-step {
    position: relative;
    margin-left: calc(var(--hierarchy-level, 0) * 1.5rem);
}

.process-hierarchy-step + .process-hierarchy-step::before {
    content: "";
    position: absolute;
    top: -0.7rem;
    left: -0.9rem;
    width: 0.9rem;
    height: 2.3rem;
    border-left: 2px solid #ced4da;
    border-bottom: 2px solid #ced4da;
    border-bottom-left-radius: 0.5rem;
}

.process-hierarchy-step .process-view-accordion-copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
    text-align: left;
}

.process-hierarchy-reference {
    margin-left: 0.25rem;
    color: #6c757d;
    font-weight: 400;
    white-space: nowrap;
}

.process-hierarchy-origin {
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.35;
}

.process-hierarchy-current {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.875rem 1.25rem;
    color: #18365a;
}

.process-hierarchy-step .process-view-accordion-item {
    border-top: 1px solid #e9ecef;
}

.process-hierarchy-step.is-current .process-view-accordion-item {
    border-color: #18365a;
    background: #f4f7fb;
}

.process-hierarchy-step.is-current .process-view-accordion-badge {
    background: #18365a;
    color: #fff;
}

.process-hierarchy-here {
    margin-left: auto;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: #18365a;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Results worksheet: the results of an inspection entered in one sheet, each saved as it is left */
.results-worksheet-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 8px 10px;
    border: 1px solid #d7e4f4;
    border-radius: 12px;
    background: #fff;
}

/* the two views of the sheet, as one switch at the head of its bar */
.results-worksheet-tabs {
    flex: none;
    gap: 2px;
    padding: 2px;
    border-radius: 8px;
    background: #eef2f6;
}

.results-worksheet-tabs .nav-link {
    padding: 4px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.results-worksheet-tabs .nav-link.active {
    background: #fff;
    color: #18365a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .18);
}

.results-worksheet.is-report [data-ws-enter-only] {
    display: none;
}

.results-worksheet-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 2px 8px;
}

.results-worksheet-subbar .results-worksheet-hint {
    margin: 0;
}

.results-worksheet-progress {
    flex: 1 1 130px;
    min-width: 0;
}

.results-worksheet-progress-text {
    font-size: 13px;
    color: #33506f;
    margin-bottom: 4px;
    white-space: nowrap;
}

.results-worksheet-progress .progress {
    height: 5px;
}

.results-worksheet-failed {
    color: #b42318;
}

.results-worksheet-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* small enough for the bar to stay one row beside the page's side column */
.backend-admin-theme .results-worksheet .results-worksheet-controls .btn.btn,
.backend-admin-theme .results-worksheet .results-worksheet-search {
    height: 30px;
    min-height: 0;
    padding: 2px 10px;
    font-size: 13px;
    line-height: 1.5;
}

/* which results are shown, plain to see */
.backend-admin-theme .results-worksheet .results-worksheet-controls .btn.btn.active {
    border-color: #18365a;
    background: #18365a;
    color: #fff;
}

.results-worksheet-search {
    width: 140px;
    max-width: 100%;
}

.backend-admin-theme .results-worksheet .results-worksheet-controls .btn.btn.results-worksheet-toggle-all {
    width: 30px;
    padding: 2px 0;
    color: #64748b;
}

.results-worksheet-hint {
    font-size: 12px;
    color: #64748b;
    margin: 8px 2px 12px;
}

.results-worksheet-category {
    border: 1px solid #d7e4f4;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 12px;
    overflow: hidden;
}

.results-worksheet-category > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: #eef5fc;
    color: #33506f;
    font-weight: 700;
    cursor: pointer;
}

.results-worksheet-category-count {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.results-worksheet-table thead th {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #35506a;
    border-bottom: 1px solid #cad5e0;
    white-space: nowrap;
}

.results-worksheet-table td,
.results-worksheet-table th {
    vertical-align: middle;
}

/* the sheet keeps the same columns in every group, the parameter taking what is left */
@media (min-width: 768px) {
    .results-worksheet-table {
        table-layout: fixed;
    }

    .results-worksheet-method-col { width: 88px; }
    .results-worksheet-requirement-col { width: 112px; }
    .results-worksheet-result-col { width: 164px; }
    .results-worksheet-verdict-col { width: 100px; }
    .results-worksheet-saved-col { width: 72px; }
}

.backend-admin-theme .results-worksheet-row td.is-none {
    color: #a3adba;
}

.results-worksheet-requirement-row th,
.results-worksheet-requirement-row td {
    background: rgba(0, 0, 0, 0.04);
    font-weight: 600;
}

.results-worksheet-row td:first-child {
    border-left: 3px solid transparent;
}

.results-worksheet-row[data-ws-state="pass"] td:first-child {
    border-left-color: #12b76a;
}

.results-worksheet-row[data-ws-state="fail"] td:first-child {
    border-left-color: #d92d20;
}

.results-worksheet-row[data-ws-state="fail"] [data-ws-row-outcome] {
    color: #b42318;
    font-weight: 700;
}

.results-worksheet-parameter label {
    margin: 0;
    font-weight: 500;
}

.results-worksheet-row.is-error .results-worksheet-input {
    border-color: #d92d20;
}

.results-worksheet-error {
    font-size: 12px;
    color: #b42318;
}

.results-worksheet-error:empty {
    display: none;
}

.results-worksheet-saved {
    width: 32px;
    color: #12b76a;
    text-align: center;
}

.results-worksheet-outcome[data-ws-outcome="FAIL"] {
    color: #b42318;
}

.results-worksheet-outcome[data-ws-outcome="PASS"] {
    color: #067647;
}

.results-worksheet-empty {
    padding: 16px;
    color: #64748b;
    text-align: center;
}

/* On a narrow screen each result is a card: what it is, what is required, and its field */
@media (max-width: 767.98px) {
    .results-worksheet-search {
        width: 100%;
    }

    .results-worksheet-table thead {
        display: none;
    }

    .results-worksheet-table,
    .results-worksheet-table tbody,
    .results-worksheet-table tr,
    .results-worksheet-table th,
    .results-worksheet-table td {
        display: block;
        width: 100%;
    }

    .results-worksheet-requirement-row {
        display: flex !important;
        align-items: center;
        background: rgba(0, 0, 0, 0.04);
    }

    .results-worksheet-requirement-row th {
        flex: 1 1 auto;
        width: auto;
    }

    .results-worksheet-requirement-row th,
    .results-worksheet-requirement-row td {
        background: transparent !important;
    }

    .results-worksheet-requirement-row td {
        width: auto;
    }

    .results-worksheet-row {
        padding: 8px 0;
        border-bottom: 1px solid #e5eaf0;
        border-left: 3px solid transparent;
    }

    .results-worksheet-row[data-ws-state="pass"] {
        border-left-color: #12b76a;
    }

    .results-worksheet-row[data-ws-state="fail"] {
        border-left-color: #d92d20;
    }

    .results-worksheet-row td {
        border: 0 !important;
        padding: 2px 12px;
    }

    .results-worksheet-row td[data-label] {
        display: flex;
        gap: 8px;
        font-size: 13px;
    }

    .results-worksheet-row td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 96px;
        color: #64748b;
        font-weight: 600;
    }

    .results-worksheet-row td.results-worksheet-result {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .results-worksheet-saved {
        width: 100%;
        text-align: left;
    }
}

/* Office hierarchy */
.office-tree-shell {
    padding: 1.25rem;
}

.office-tree-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.office-tree-search {
    flex: 1 1 16rem;
    width: auto;
    min-width: 0;
}

.office-tree-type {
    flex: 0 1 13rem;
    width: auto;
}

.office-tree-show-inactive {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0 0.25rem;
    color: var(--admin-shell-muted);
}

.office-tree-show-inactive .form-check-input {
    margin: 0;
}

.office-tree,
.office-tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.office-tree ul {
    display: none;
    margin-left: 0.95rem;
    padding-left: 0.65rem;
    border-left: 1px solid var(--admin-shell-border);
}

.office-tree-node.is-open > ul {
    display: block;
}

.office-tree-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    min-height: 2.5rem;
    padding: 0.3rem 0.5rem 0.3rem 0.15rem;
    border-radius: 8px;
}

.office-tree-row:hover {
    background: var(--admin-shell-surface-alt);
}

.office-tree-toggle,
.office-tree-toggle-space {
    flex: 0 0 1.75rem;
    width: 1.75rem;
    height: 1.75rem;
}

.office-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--admin-shell-muted);
    font-size: 0.72rem;
}

.office-tree-toggle:hover {
    background: var(--admin-shell-accent-soft);
    color: var(--admin-shell-accent);
}

.office-tree-toggle i {
    transition: transform 0.15s ease;
}

.office-tree-node.is-open > .office-tree-row .office-tree-toggle i {
    transform: rotate(90deg);
}

.office-tree-name {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--admin-shell-heading);
    font-weight: 600;
    text-decoration: none;
}

a.office-tree-name:hover,
a.office-tree-name:focus {
    color: var(--admin-shell-accent);
    text-decoration: underline;
}

.office-tree-chip {
    padding: 0.15rem 0.55rem;
    font-size: 0.74rem;
}

.office-tree-count {
    margin-left: auto;
    color: var(--admin-shell-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.office-tree-node.is-current > .office-tree-row {
    background: var(--admin-shell-accent-soft);
}

.office-tree-here {
    color: var(--admin-shell-accent);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.office-tree-node.is-inactive > .office-tree-row .office-tree-name {
    color: var(--admin-shell-muted);
    font-weight: 500;
}

.office-tree.hide-inactive .office-tree-node.is-below.is-inactive {
    display: none;
}

.office-tree.hide-inactive .office-tree-node.no-active-children > .office-tree-row .office-tree-toggle {
    visibility: hidden;
}

/* While searching, only matches and the offices above them show, whatever is open. */
.office-tree.is-filtering .office-tree-node {
    display: none;
}

.office-tree.is-filtering .office-tree-node.is-hit {
    display: block;
}

.office-tree.is-filtering .office-tree-node.is-hit > ul {
    display: block;
}

.office-tree.is-filtering .office-tree-toggle {
    visibility: hidden;
}

.office-path {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.office-path li:not(:last-child)::after {
    content: "\203A";
    margin-left: 0.4rem;
    color: var(--admin-shell-muted);
}

.office-path li[aria-current] {
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .office-tree-shell {
        padding: 0.75rem;
    }

    .office-tree ul {
        margin-left: 0.55rem;
        padding-left: 0.3rem;
    }

    .office-tree-type {
        flex: 1 1 100%;
    }

    .office-tree-count {
        margin-left: 0;
    }
}

.nav-tabs.office-view-tabs {
    overflow: visible;
}

.office-tree-group-label {
    margin-top: 0.75rem;
    padding: 0.5rem 0.15rem 0.25rem;
    border-top: 1px solid var(--admin-shell-border);
    color: var(--admin-shell-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.office-tree.is-filtering .office-tree-group-label {
    display: none;
}

.office-tree-summary {
    margin: 0 0 1rem;
}

.office-tree-menu {
    margin-left: auto;
}

.office-tree-count + .office-tree-menu {
    margin-left: 0;
}

.office-tree-menu-toggle {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--admin-shell-muted);
}

.office-tree-menu-toggle:hover,
.office-tree-menu-toggle:focus {
    background: var(--admin-shell-accent-soft);
    color: var(--admin-shell-accent);
}

.office-tree-node.is-highlighted > .office-tree-row {
    outline: 2px solid var(--admin-shell-accent);
    outline-offset: -2px;
}

.office-move-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.office-move-list > li > a {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    min-height: 2.5rem;
    padding: 0.35rem 0.5rem 0.35rem calc(0.5rem + min(var(--depth, 0), 8) * 1rem);
    border-radius: 8px;
    text-decoration: none;
}

.office-move-list > li > a:hover,
.office-move-list > li > a:focus {
    background: var(--admin-shell-accent-soft);
}

.office-move-route {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.25rem 0.75rem;
    margin: 1rem 0;
}

.office-move-route dt {
    color: var(--admin-shell-muted);
    font-weight: 600;
}

.office-move-route dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.office-move-impact {
    margin: 0.35rem 0 1rem;
    padding-left: 1.2rem;
}

/* Standard catalogue: the office tree's look, with a row that opens onto a summary. */
button.office-tree-name {
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
}

button.office-tree-name:hover,
button.office-tree-name:focus {
    color: var(--admin-shell-accent);
}

.standard-catalogue-leaf > .office-tree-row .standard-catalogue-row-name {
    flex: 1 1 16rem;
    font-weight: 500;
}

.standard-catalogue-tree-shell .office-tree-type {
    min-width: 0;
}

.standard-catalogue-view-more {
    margin-left: auto;
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
}

.standard-catalogue-more {
    display: none;
    margin: 0 0 0.5rem 1.95rem;
    padding: 0.5rem 0.75rem;
    border-left: 2px solid var(--admin-shell-border);
    color: var(--admin-shell-text, inherit);
    font-size: 0.9rem;
}

.office-tree-node.is-open > .standard-catalogue-more {
    display: block;
}

.standard-catalogue-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 1.25rem;
    margin-bottom: 0.4rem;
    color: var(--admin-shell-muted);
}

.standard-catalogue-facts b {
    font-weight: 600;
}

/* Rows stay usable while a search is on: only sectors have their toggle hidden by it. */
.office-tree.is-filtering .standard-catalogue-leaf > .office-tree-row .office-tree-toggle {
    visibility: visible;
}

.standard-catalogue-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.standard-catalogue-code {
    color: var(--admin-shell-accent);
    font-weight: 700;
}

.standard-catalogue-title {
    margin: 0.15rem 0 0;
    color: var(--admin-shell-heading);
    font-size: 1.25rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.standard-catalogue-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.standard-catalogue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.75rem 1.25rem;
    margin: 0 0 1rem;
}

.standard-catalogue-grid dt,
.standard-catalogue-related dt {
    color: var(--admin-shell-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.standard-catalogue-grid dd {
    margin: 0;
    color: var(--admin-shell-heading);
    overflow-wrap: anywhere;
}

.standard-catalogue-heading {
    margin: 0 0 0.6rem;
    color: var(--admin-shell-heading);
    font-size: 1rem;
    font-weight: 700;
}

.standard-catalogue-scope {
    overflow-wrap: anywhere;
}

.standard-catalogue-summary {
    max-height: 12rem;
    overflow: hidden;
}

.standard-catalogue-summary.is-expanded {
    max-height: none;
}

.standard-catalogue-summary.is-cut {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 3rem), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 3rem), transparent);
}

.btn.btn-link.standard-catalogue-summary-toggle {
    margin-left: 0;
    padding: 0.25rem 0 0;
    font-weight: 600;
}

.standard-catalogue-related dd {
    margin: 0 0 0.75rem;
}

.standard-catalogue-related dd:last-child {
    margin-bottom: 0;
}

.standard-catalogue-observations th {
    color: var(--admin-shell-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .standard-catalogue-more {
        margin-left: 0.5rem;
    }

    .standard-catalogue-observations thead {
        display: none;
    }

    .standard-catalogue-observations tr,
    .standard-catalogue-observations td {
        display: block;
    }

    .standard-catalogue-observations tr {
        padding: 0.4rem 0;
        border-bottom: 1px solid var(--admin-shell-border);
    }

    .standard-catalogue-observations td {
        padding: 0.1rem 0;
        border: 0;
    }

    .standard-catalogue-observations td[data-label]::before {
        content: attr(data-label) ": ";
        color: var(--admin-shell-muted);
        font-weight: 600;
    }
}

@media print {
    .standard-catalogue-reader {
        display: none;
    }
}

/* Document Type Settings: all the setup of document types on one page, built on the office tree. */
.document-type-settings-status {
    margin: 0 0 0.75rem;
    color: var(--admin-shell-muted);
    font-size: 0.86rem;
}

.document-type-settings-status.is-attention {
    color: #92400e;
}

.document-type-settings-shell .office-tree-search {
    flex-basis: 100%;
}

.document-type-settings-type {
    scroll-margin-top: 6rem;
}

.document-type-settings-tree .office-tree-row {
    flex-wrap: wrap;
}

.document-type-settings-tree .office-tree-count {
    margin-left: 0.5rem;
}

.document-type-settings-type > .document-type-settings-body:has([data-problems][hidden]) {
    display: none;
}

.document-type-settings-category > .office-tree-row .document-type-settings-name {
    font-weight: 700;
}

.document-type-settings-type > .office-tree-row .document-type-settings-name {
    font-weight: 600;
}

button.document-type-settings-name {
    overflow-wrap: anywhere;
    text-align: left;
}

.document-type-settings-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.75rem;
    margin-left: auto;
}

.document-type-settings-action {
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
}

.document-type-settings-actions + .office-tree-menu,
.document-type-settings-check + .office-tree-menu {
    margin-left: auto;
}

.document-type-settings-tree .office-tree-chip.is-quiet {
    background: transparent;
    color: var(--admin-shell-muted);
}

.document-type-settings-tree .office-tree-chip.is-off {
    background: #f1f5f9;
    color: #64748b;
}

.document-type-settings-tree .office-tree-chip.is-warning {
    background: #fef3c7;
    color: #92400e;
}

.document-type-settings-check:empty {
    display: none;
}

.document-type-settings-check {
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
}

.document-type-settings-check.is-problem {
    background: #fee2e2;
    color: #991b1b;
}

.document-type-settings-check.is-warning {
    background: #fef3c7;
    color: #92400e;
}

.document-type-settings-body {
    display: none;
    margin: 0 0 0.5rem 1.95rem;
    padding: 0.5rem 0.75rem;
    border-left: 2px solid var(--admin-shell-border);
    font-size: 0.88rem;
}

.office-tree-node.is-open > .document-type-settings-body {
    display: block;
}

.document-type-settings-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 0.35rem 1.25rem;
    margin: 0;
}

.document-type-settings-fact {
    min-width: 0;
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
}

.document-type-settings-fact.is-match {
    background: #fef9c3;
}

.document-type-settings-fact dt {
    color: var(--admin-shell-muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.document-type-settings-fact dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.document-type-settings-fact:has(.document-type-settings-long) {
    grid-column: 1 / -1;
}

.document-type-settings-long summary {
    cursor: pointer;
}

.document-type-settings-long .is-less,
.document-type-settings-long[open] .is-preview {
    display: none;
}

.document-type-settings-long[open] .is-less {
    display: inline;
    color: var(--admin-shell-accent);
    font-size: 0.78rem;
    font-weight: 600;
}

.document-type-settings-group + .document-type-settings-group {
    margin-top: 0.6rem;
}

.document-type-settings-group h4 {
    margin: 0 0 0.25rem;
    color: var(--admin-shell-heading);
    font-size: 0.82rem;
    font-weight: 700;
}

.document-type-settings-none {
    margin: 0;
    color: var(--admin-shell-muted);
}

.document-type-settings-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.document-type-settings-image {
    width: 10rem;
    margin: 0;
}

.document-type-settings-image img {
    display: block;
    max-width: 100%;
    max-height: 5rem;
    margin-bottom: 0.25rem;
    object-fit: contain;
}

.document-type-settings-image figcaption {
    color: var(--admin-shell-muted);
    font-size: 0.78rem;
}

.document-type-settings-image figcaption b {
    display: block;
    color: var(--admin-shell-text, inherit);
    font-weight: 600;
}

.document-type-settings-problem-group strong {
    font-size: 0.82rem;
}

.document-type-settings-tree .document-type-settings-problem-group ul {
    display: block;
    margin: 0.15rem 0 0.4rem;
    padding-left: 1.1rem;
    border: 0;
    list-style: disc;
}

.document-type-settings-problem-group.is-problem strong {
    color: #991b1b;
}

.document-type-settings-problem-group.is-warning strong {
    color: #92400e;
}

.document-type-settings-picker {
    flex: 1 1 20rem;
    min-width: 0;
}

.document-type-settings-more {
    margin: 0 0 0.75rem;
    font-size: 0.88rem;
}

.document-type-settings-more .btn-link {
    padding: 0 0.25rem;
    vertical-align: baseline;
}

/* While searching, only what was found and the way down to it show. */
.document-type-settings-tree.is-searching .document-type-settings-node {
    display: none;
}

.document-type-settings-tree.is-searching .document-type-settings-node.is-hit,
.document-type-settings-tree.is-searching .document-type-settings-node.is-whole .document-type-settings-node {
    display: block;
}

@media (max-width: 767.98px) {
    .document-type-settings-actions {
        margin-left: 1.95rem;
        width: 100%;
    }

    .document-type-settings-body {
        margin-left: 0.5rem;
    }

    .document-type-settings-facts {
        grid-template-columns: 1fr;
    }
}

/* Options: list, and the hierarchy built on the office tree */
.backend-table-action-cell a.btn {
    width: auto;
    min-width: 2rem;
}

.backend-table-action-cell .btn + .btn {
    margin-left: 0.25rem;
}

.option-list-under {
    color: var(--admin-shell-muted);
    font-size: 0.8rem;
}

.option-add-child.btn.btn-sm {
    min-width: 1.5rem;
    min-height: 1.5rem;
    padding: 0.05rem 0.3rem;
    font-size: 0.75rem;
}

.option-view-heading {
    margin: 1.25rem 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.option-view-used {
    margin: 0;
    padding-left: 1.1rem;
}

.option-tree-icon {
    color: var(--admin-shell-muted);
    font-size: 0.75rem;
}

.option-tree-key {
    color: var(--admin-shell-muted);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.option-tree-path {
    color: var(--admin-shell-muted);
    font-size: 0.78rem;
}

.option-tree-value > .office-tree-row .office-tree-name {
    font-weight: 500;
}

.option-tree-value.is-inactive > .office-tree-row .office-tree-name {
    color: var(--admin-shell-muted);
}

.option-tree-opener {
    cursor: pointer;
}

.option-tree-label {
    margin-top: 0.25rem;
}

.option-tree-empty {
    padding: 0.35rem 0.6rem 0.35rem 1.95rem;
    color: var(--admin-shell-muted);
    font-size: 0.86rem;
    list-style: none;
}

.option-tree-more-row {
    padding: 0.35rem 0 0.5rem 1.95rem;
    list-style: none;
}

.option-tree-filtered-out {
    display: none;
}

.option-tree-shell .office-tree-node > .office-tree-row .office-tree-menu {
    margin-left: 0;
}

.option-tree-shell .office-tree-row > .office-tree-menu:only-of-type {
    flex: 0 0 auto;
}

.option-tree-shell .office-tree-row > .office-tree-count {
    margin-left: auto;
}

.option-tree-shell .office-tree-row > .option-tree-key + .office-tree-menu,
.option-tree-shell .office-tree-row > .office-tree-chip + .office-tree-menu,
.option-tree-shell .office-tree-row > .option-tree-path + .office-tree-menu {
    margin-left: auto;
}

/* Application hierarchy: a deleted application, shown to administrators only, is greyed out. */
.process-tree-application.is-deleted > .office-tree-row {
    opacity: 0.55;
}

.process-tree .office-tree-row .process-instance-status-badge {
    font-size: 0.72rem;
}

/* Inspection stage: what the work is about in one line, then the work itself */
.inspection-panel.inspection-work {
    padding: 0;
}

.inspection-context {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 24px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.inspection-context-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.inspection-context-item.is-main {
    flex: 1 1 320px;
}

.inspection-context-label {
    flex: none;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.inspection-context-value {
    color: #1e293b;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.inspection-context-chip {
    padding: 1px 10px;
    border-radius: 999px;
    background: #eef2f6;
    color: #33506f;
    font-size: 12px;
    font-weight: 700;
}

.inspection-context-chip.is-pass {
    background: #ecfdf3;
    color: #067647;
}

.inspection-context-chip.is-fail {
    background: #fef3f2;
    color: #b42318;
}

.inspection-report-block {
    margin-bottom: 14px;
}

.inspection-report-block > .inspection-context-label {
    margin-bottom: 4px;
}

.inspection-report-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Results worksheet on the stage page: the progress and filters stay in sight under the page
   header while a long sheet is entered, and the rows are close enough to keep many on a screen */
.app-main .results-worksheet-toolbar {
    top: 68px;
    box-shadow: 0 6px 12px -10px rgba(15, 23, 42, .35);
}

/* more exact than the theme's table cells */
.app-main .results-worksheet .results-worksheet-table > :not(caption) > * > * {
    padding: 5px 12px;
}

.results-worksheet-table thead th {
    position: static;
}

.results-worksheet-row td[data-label="Requirement"] {
    font-weight: 600;
}

.results-worksheet .results-worksheet-passed {
    width: auto;
    min-width: 84px;
    height: 31px;
    min-height: 0;
    padding-top: 2px;
    padding-bottom: 2px;
}

.results-worksheet-row:focus-within > td {
    background: #f5f9ff;
}

/* what is done to a requirement, small at the end of its row */
.backend-admin-theme .results-worksheet-requirement-row .btn-link {
    min-height: 0;
    padding: 2px 6px;
    font-size: 13px;
    line-height: 1.4;
}

.results-worksheet-requirement-row .results-worksheet-reload {
    color: #94a3b8;
}

@media (max-width: 767.98px) {
    .app-main .results-worksheet-toolbar {
        position: static;
    }

    /* nothing to say: the card keeps to what the result has */
    .results-worksheet-row td.is-none {
        display: none;
    }

    .results-worksheet-controls {
        flex-wrap: wrap;
        width: 100%;
    }

    .backend-admin-theme .results-worksheet .results-worksheet-search {
        flex: 1 1 120px;
        width: auto;
    }
}

/* the results as a report shows them, on a page: headings the size of the page's own section titles */
.inspection-shell .standard-instance-heading {
    font-size: 15px;
    letter-spacing: .01em;
}

/* Work pages: a page set up with many columns scrolls its table inside the surface, as tables
   do below 1200px, instead of widening the whole page past the window */
.backend-page-surface:has(.process-bridge-grid),
.process-bridge-grid,
.process-bridge-grid .bridge-table {
    min-width: 0;
    max-width: 100%;
}

.process-bridge-grid .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* the column resize handles sit outside the scrolling box: kept within the table's edge */
.process-bridge-grid .bridge-table {
    overflow: hidden;
}

/* Work pages: a row's More, the columns kept out of the table */
.process-bridge-grid .bridge-more-cell { width: 1%; white-space: nowrap; }
.bridge-more-toggle { line-height: 1; padding: .2rem .4rem; }
.bridge-more-toggle .bi { display: inline-block; transition: transform .15s; }
.bridge-more-toggle[aria-expanded="true"] .bi { transform: rotate(180deg); }
tr.bridge-more-row > td { background: var(--bs-tertiary-bg, #f8f9fa); padding: .9rem 1.1rem; white-space: normal; border-left: 3px solid var(--bs-primary, #0d6efd); }
.bridge-more-label { font-size: .75rem; color: var(--bs-secondary-color, #6c757d); }
.bridge-more-value { overflow-wrap: anywhere; }
/* Work pages: a row's actions stay on one line, the first as a button, the rest in its menu */
.process-bridge-grid .bridge-actions-cell { white-space: nowrap; width: 1%; }
/* Work pages: a value that opens its row, e.g. the sample number */
.process-bridge-grid a.bridge-value-link { font-weight: 600; text-decoration: none; }
.process-bridge-grid a.bridge-value-link:hover { text-decoration: underline; }
/* Work pages: a row's Stages menu, one line per step, the current one marked */
/* the actions menu shows either its actions or, after Stages, the steps */
.bridge-actions-menu .bridge-stages-pane { display: none; }
.bridge-actions-menu.is-stages .bridge-action-item { display: none; }
.bridge-actions-menu.is-stages .bridge-stages-pane { display: block; }
.bridge-actions-menu.is-stages { padding-top: .15rem; }
.bridge-stages-menu { min-width: 21rem; max-width: min(30rem, 92vw); max-height: 60vh; overflow-y: auto; padding: .25rem 0; }
.bridge-stages-menu .bridge-step { display: flex; align-items: baseline; gap: .5rem; white-space: normal; padding: .35rem .85rem; }
.bridge-stages-menu .bridge-step-icon { flex: none; font-size: .8rem; }
.bridge-stages-menu .bridge-step-name { flex: 1 1 auto; min-width: 0; }
.bridge-stages-menu .bridge-step-facts { flex: none; display: flex; gap: .35rem; align-items: baseline; font-size: .78rem; color: var(--bs-secondary-color, #6c757d); text-align: right; max-width: 60%; flex-wrap: wrap; justify-content: flex-end; }
.bridge-stages-menu .bridge-step-current { background: var(--bs-primary-bg-subtle, #cfe2ff); font-weight: 600; }
.bridge-stages-menu .bridge-step-pending .bridge-step-name { color: var(--bs-secondary-color, #6c757d); }
.bridge-stages-menu .has-focus .bridge-step:not(.is-focus):not(.bridge-step-current) { opacity: .6; }
/* Work pages: the filter bar, what to show, whose, then the steps */
.bridge-filter-bar { padding: .6rem .75rem; border: 1px solid var(--bs-border-color, #dee2e6); border-radius: .6rem; background: var(--bs-body-bg, #fff); }
.bridge-filter-bar .btn-group > .btn { white-space: nowrap; }
