:root {
    --crm-red: #e40000;
    --crm-page-bg: #eef3f5;
    --crm-text: #343434;
    --sidebar-width: 275px;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--crm-page-bg);
    color: var(--crm-text);
}

.search-card {
    border-top: 4px solid #e40000;
}

.btn-crm {
    background: #e40000;
    border-color: #e40000;
    color: #fff;
}

.btn-crm:hover,
.btn-crm:focus {
    background: #c80000;
    border-color: #c80000;
    color: #fff;
}


/* Darker information/action outline button */
.btn-outline-info {
    --bs-btn-color: #087f95;
    --bs-btn-border-color: #087f95;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #087f95;
    --bs-btn-hover-border-color: #087f95;
    --bs-btn-focus-shadow-rgb: 8, 127, 149;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #066f82;
    --bs-btn-active-border-color: #066779;
    --bs-btn-disabled-color: #087f95;
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: #087f95;
}

/* Darker information/action button */
.btn-info {
    --bs-btn-color: #fff;
    --bs-btn-bg: #087f95;
    --bs-btn-border-color: #087f95;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #066f82;
    --bs-btn-hover-border-color: #066779;
    --bs-btn-focus-shadow-rgb: 8, 127, 149;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #066779;
    --bs-btn-active-border-color: #055d6d;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #087f95;
    --bs-btn-disabled-border-color: #087f95;
}

.crm-home-button {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
}

.crm-home-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #fff;
    color: #5c636a;
    font-size: 1.35rem;
    line-height: 1;
}

.page-logo {
    display: block;
    width: auto;
    max-width: 100%;
    height: 64px;
}

.table-responsive {
    max-height: 65vh;
    overflow: auto;
}

.results-table {
    font-size: .875rem;
    white-space: nowrap;
}

.results-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #343434;
    color: #fff;
    vertical-align: middle;
}

.service-user-link {
    color: #e40000;
    font-weight: 700;
}

.service-user-link:hover,
.service-user-link:focus {
    color: #b80000;
}

/* CRM sidebar and shared shell layout */
.crm-sidebar {
    position: fixed;
    z-index: 1040;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-top: 3px solid var(--crm-red);
    box-shadow: 2px 0 10px rgba(0, 0, 0, .12);
    transition: transform .25s ease;
}

.sidebar-header {
    min-height: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: .4rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #dee2e6;
}

.sidebar-logo {
    width: 100%;
    height: auto;
    max-height: 72px;
    object-fit: contain;
    object-position: center;
}

.sidebar-office-name {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    color: #343434;
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem .75rem;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    flex: 0 0 auto;
    padding: .75rem .5rem;
    border-top: 1px solid #dee2e6;
    color: #6c757d;
    font-size: .72rem;
    line-height: 1.2;
    white-space: nowrap;
}

.sidebar-heading {
    padding: .35rem .75rem .5rem;
    color: #6c757d;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sidebar-link {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: .3rem;
    padding: .7rem .8rem;
    border-radius: .5rem;
    color: #343434;
    font-size: .94rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.sidebar-link i {
    width: 24px;
    flex: 0 0 24px;
    text-align: center;
    color: var(--crm-red);
    font-size: 1.2rem;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
    background: #f3f4f5;
    color: #111;
}

.sidebar-link.active {
    background: var(--crm-red);
    color: #fff;
}

.sidebar-link.active i {
    color: #fff;
}

.sidebar-link.disabled {
    opacity: .55;
    cursor: default;
    pointer-events: none;
}

.sidebar-section {
    margin-bottom: .3rem;
}

.sidebar-section-toggle {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .7rem .8rem;
    border-radius: .5rem;
    color: #343434;
    font-size: .94rem;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
}

.sidebar-section-toggle::-webkit-details-marker {
    display: none;
}

.sidebar-section-toggle:hover,
.sidebar-section-toggle:focus-visible,
.sidebar-section[open] > .sidebar-section-toggle {
    background: #f3f4f5;
    color: #111;
}

.sidebar-section-toggle > i:first-child {
    width: 24px;
    flex: 0 0 24px;
    color: var(--crm-red);
    font-size: 1.2rem;
    text-align: center;
}

.sidebar-section-chevron {
    margin-left: auto;
    color: #6c757d;
    font-size: .85rem;
    transition: transform .2s ease;
}

.sidebar-section[open] .sidebar-section-chevron {
    transform: rotate(180deg);
}

.sidebar-submenu {
    display: grid;
    gap: .2rem;
    padding: .3rem 0 .4rem 2.45rem;
}

.sidebar-sublink {
    padding: .55rem .7rem;
    border-left: 3px solid #dee2e6;
    color: #495057;
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
}

.sidebar-sublink:hover,
.sidebar-sublink:focus-visible {
    border-left-color: var(--crm-red);
    background: #f3f4f5;
    color: #111;
}

.sidebar-sublink.active {
    border-left-color: var(--crm-red);
    color: var(--crm-red);
    font-weight: 600;
}

.sidebar-empty {
    padding: .4rem .7rem;
    color: #868e96;
    font-size: .78rem;
    font-style: italic;
}

.crm-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding: 2rem;
}

.sidebar-backdrop {
    display: none;
}

.report-card {
    border: 0;
    border-top: 4px solid var(--crm-red);
}

/* Shared shell dialogs */
.report-date-dialog {
    width: min(34rem, calc(100% - 2rem));
    padding: 0;
    border: 0;
    border-radius: .75rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .28);
}

.report-date-dialog::backdrop {
    background: rgba(22, 31, 38, .62);
    backdrop-filter: blur(2px);
}

.report-date-dialog[open] {
    animation: report-dialog-in 180ms ease-out;
}

.report-date-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
}

.report-date-dialog-body {
    padding: 1.25rem;
}

.report-date-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}

.report-office-list {
    display: grid;
    gap: .65rem;
}

.report-office-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: .8rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    background: #fff;
    color: #212529;
    text-align: left;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.report-office-choice:hover,
.report-office-choice:focus-visible,
.report-office-choice.current {
    border-color: var(--crm-red, #e40000);
    background: #fff5f5;
}

.report-office-choice.current {
    font-weight: 600;
}

.report-office-choice .bi {
    color: var(--crm-red, #e40000);
}

.report-date-close {
    border: 0;
    background: transparent;
    color: #495057;
    font-size: 1.6rem;
    line-height: 1;
    padding: .15rem .35rem;
}

/* Shared service-user result link */
.service-user-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    margin-right: .35em;
    border-radius: 50%;
    background: var(--crm-red, #e40000);
    color: #fff;
    text-decoration: none;
    vertical-align: middle;
    transition: background-color 150ms ease, transform 150ms ease;
}

.service-user-label {
    vertical-align: middle;
}

.service-user-open:hover {
    background: #b80000;
    color: #fff;
    transform: translateX(1px);
}

.service-user-open:focus-visible {
    outline: 3px solid rgba(228, 0, 0, .3);
    outline-offset: 2px;
}

.service-user-open .bi {
    font-size: .58em;
    line-height: 1;
}

@keyframes report-dialog-in {
    from {
        opacity: 0;
        transform: translateY(-.75rem) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .report-date-dialog[open] {
        animation: none;
    }
}

/* Managed Account Tracker */
.tracker-summary-card,
.tracker-balance-card,
.tracker-transactions-card {
    border: 0;
    border-top: 4px solid var(--crm-red);
}

.tracker-summary-label {
    display: block;
    margin-bottom: .35rem;
    color: #6c757d;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.tracker-summary-value,
.tracker-balance-value {
    display: block;
    color: var(--crm-text);
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.tracker-balance-card small {
    display: block;
    margin-top: .4rem;
}

.tracker-user-name {
    display: block;
    font-weight: 700;
}

.tracker-user-number {
    display: block;
    margin-top: .1rem;
    color: #6c757d;
    font-size: .78rem;
}

.tracker-access-badge {
    padding: .55rem .75rem;
    font-size: .78rem;
}

.tracker-table-filter {
    width: min(100%, 34rem);
}

.tracker-table {
    font-variant-numeric: tabular-nums;
}

.tracker-details-cell {
    min-width: 15rem;
    max-width: 28rem;
    overflow-wrap: anywhere;
    white-space: normal;
}

.tracker-transaction-form .modal-header {
    border-top: 4px solid var(--crm-red);
}

.tracker-transaction-form input[type="number"] {
    font-variant-numeric: tabular-nums;
}

@media (max-width: 991.98px) {
    .crm-sidebar {
        width: min(var(--sidebar-width), 86vw);
        transform: translateX(-100%);
    }

    .crm-main {
        margin-left: 0;
        padding: 1.25rem;
    }

    body.sidebar-open .crm-sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        z-index: 1030;
        inset: 0;
        background: rgba(0, 0, 0, .45);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }
}

/* CRM reports dashboard */
.reports-home-intro {
    border-left: .3rem solid var(--crm-red, #e40000);
}

.reports-home-card {
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.reports-home-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .75rem 1.5rem rgba(33, 37, 41, .1) !important;
}

.reports-home-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    border-radius: 50%;
    background: var(--crm-red, #e40000);
    color: #fff;
}

.reports-home-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem .8rem;
    border-radius: .45rem;
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.reports-home-link:hover,
.reports-home-link:focus-visible {
    background: rgba(228, 0, 0, .08);
    color: var(--crm-red, #e40000);
}

.dashboard-metric {
    padding: .75rem;
    border: 1px solid #dee2e6;
    border-radius: .55rem;
    background: #f8f9fa;
}

.dashboard-metric-value {
    display: block;
    color: var(--crm-red, #e40000);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.1;
}

.dashboard-status-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem .85rem;
    border: 1px solid #dee2e6;
    border-radius: .55rem;
    color: inherit;
    text-decoration: none;
}

.dashboard-status-link:hover,
.dashboard-status-link:focus-visible {
    border-color: var(--crm-red, #e40000);
    color: var(--crm-red, #e40000);
}

/* CRM Home dashboard */
.crm-home-welcome,
.crm-home-stat,
.crm-home-panel {
    border: 0;
    border-top: 4px solid var(--crm-red);
}

.crm-home-stat .card-body {
    position: relative;
    min-height: 8.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.crm-home-stat-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: rgba(228, 0, 0, .09);
    color: var(--crm-red);
    font-size: 1.1rem;
}

.crm-home-stat-value {
    display: block;
    margin-bottom: .2rem;
    color: var(--crm-red);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.crm-home-stat-label {
    color: #6c757d;
    font-size: .84rem;
    font-weight: 500;
}

.crm-home-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem .85rem;
    border: 1px solid #dee2e6;
    border-radius: .55rem;
    background: #fff;
    font-weight: 600;
}

.crm-home-activity-list {
    display: grid;
}

.crm-home-activity {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .8rem 0;
    border-bottom: 1px solid #e9ecef;
}

.crm-home-activity:first-child {
    padding-top: 0;
}

.crm-home-activity:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.crm-home-activity-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    flex: 0 0 1.55rem;
    margin-top: .1rem;
    border-radius: 50%;
    background: var(--crm-red);
    color: #fff;
    font-size: .72rem;
}

.crm-home-activity-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.min-w-0 {
    min-width: 0;
}

/* Shared page loading overlay */
.page-loader {
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .84);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 140ms ease, visibility 140ms ease;
}

.page-loader.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.page-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 1.15rem 1.4rem;
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 .65rem 1.75rem rgba(33, 37, 41, .14);
}

.page-loader-spinner {
    width: 3rem;
    height: 3rem;
    border: .35rem solid #dee2e6;
    border-top-color: var(--crm-red, #e40000);
    border-radius: 50%;
    animation: page-loader-spin .75s linear infinite;
}

.page-loader-text {
    color: #495057;
    font-size: .84rem;
    font-weight: 600;
}

@keyframes page-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-loader {
        transition: none;
    }

    .page-loader-spinner {
        animation-duration: 1.5s;
    }
}

/* CRM login pages */
.crm-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 2rem 1rem;
    background: var(--crm-page-bg);
    color: var(--crm-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.crm-login-page *,
.crm-login-page *::before,
.crm-login-page *::after {
    box-sizing: border-box;
}

.crm-login-shell {
    width: 100%;
    max-width: 430px;
}

.crm-login-card {
    overflow: hidden;
    border: 0;
    border-top: 4px solid var(--crm-red);
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 .85rem 2rem rgba(33, 37, 41, .12);
}

.crm-login-card-body {
    padding: 2rem;
}

.crm-login-brand {
    margin-bottom: 1.75rem;
    text-align: center;
}

.crm-login-logo {
    display: block;
    width: min(300px, 100%);
    height: auto;
    margin: 0 auto 1rem;
}

.crm-login-title {
    margin: 0;
    color: #343434;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}

.crm-login-subtitle {
    margin: .55rem 0 0;
    color: #6c757d;
    font-size: .92rem;
    line-height: 1.45;
}

.crm-login-alert {
    margin-bottom: 1.25rem;
    padding: .8rem 1rem;
    border: 1px solid rgba(228, 0, 0, .22);
    border-radius: .5rem;
    background: rgba(228, 0, 0, .06);
    color: #8f0000;
    font-size: .9rem;
}

.crm-login-form {
    display: grid;
    gap: 1rem;
}

.crm-login-field {
    display: grid;
    gap: .4rem;
}

.crm-login-label {
    color: #495057;
    font-size: .86rem;
    font-weight: 600;
}

.crm-login-input {
    width: 100%;
    min-height: 48px;
    padding: .7rem .85rem;
    border: 1px solid #ced4da;
    border-radius: .5rem;
    background: #fff;
    color: #212529;
    font: inherit;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.crm-login-input:focus {
    border-color: var(--crm-red);
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(228, 0, 0, .12);
}

.crm-login-button {
    width: 100%;
    min-height: 48px;
    margin-top: .25rem;
    padding: .75rem 1rem;
    border: 1px solid var(--crm-red);
    border-radius: .5rem;
    background: var(--crm-red);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease;
}

.crm-login-button:hover,
.crm-login-button:focus-visible {
    border-color: #c80000;
    background: #c80000;
    color: #fff;
}

.crm-login-footer {
    margin-top: 1.25rem;
    color: #6c757d;
    font-size: .8rem;
    line-height: 1.55;
    text-align: center;
}

.crm-login-footer p,
.crm-login-footer span {
    display: block;
    margin: 0;
}

@media (max-width: 575.98px) {
    .crm-login-page {
        padding: 1rem;
    }

    .crm-login-card-body {
        padding: 1.5rem;
    }
}


/* Sidebar menu sizing - 90% of previous size */
.sidebar-heading {
    padding: .315rem .675rem .45rem;
    font-size: .648rem;
}

.sidebar-link {
    min-height: 41.4px;
    gap: .765rem;
    margin-bottom: .27rem;
    padding: .63rem .72rem;
    font-size: .846rem;
}

.sidebar-link i {
    width: 21.6px;
    flex-basis: 21.6px;
    font-size: 1.08rem;
}

.sidebar-section {
    margin-bottom: .27rem;
}

.sidebar-section-toggle {
    min-height: 41.4px;
    gap: .765rem;
    padding: .63rem .72rem;
    font-size: .846rem;
}

.sidebar-section-toggle > i:first-child {
    width: 21.6px;
    flex-basis: 21.6px;
    font-size: 1.08rem;
}

.sidebar-section-chevron {
    font-size: .765rem;
}

.sidebar-submenu {
    gap: .18rem;
    padding: .27rem 0 .36rem 2.205rem;
}

.sidebar-sublink {
    padding: .495rem .63rem;
    font-size: .738rem;
}

.sidebar-empty {
    padding: .36rem .63rem;
    font-size: .702rem;
}


/* Service-user shell header */
.sidebar-header-su {
    min-height: auto;
    gap: .5rem;
    padding-bottom: .85rem;
}

.sidebar-header-su .sidebar-logo {
    flex: 0 0 auto;
}

.sidebar-header-su .sidebar-office-name {
    flex: 0 0 auto;
    min-height: 1.25rem;
    overflow: visible;
    line-height: 1.35;
    text-overflow: clip;
    white-space: normal;
}

.sidebar-header-su .border-top {
    margin-top: .25rem !important;
    padding-top: .75rem !important;
}


/* Service-user Contracts section */
.contract-card {
    border: 0;
    border-top: 4px solid var(--crm-red);
}

.contract-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    border-radius: 50%;
    background: var(--crm-red);
    color: #fff;
}

.contract-hours-summary {
    color: #495057;
    font-size: .9rem;
}

.contract-support-hours {
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.contract-support-row {
    display: grid;
    grid-template-columns: minmax(8rem, 1.2fr) 1fr 1fr;
    gap: .75rem;
    padding: .65rem 0;
    border-bottom: 1px solid #e9ecef;
    font-size: .84rem;
}

.contract-support-row:last-child {
    border-bottom: 0;
}

.contract-dialog {
    width: min(30rem, calc(100% - 2rem));
    padding: 0;
    border: 0;
    border-radius: .75rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .28);
}

.contract-dialog::backdrop {
    background: rgba(22, 31, 38, .62);
    backdrop-filter: blur(2px);
}

.contract-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
}

.contract-dialog-body {
    padding: 1.25rem;
}

.contract-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}

.contract-dialog-close {
    border: 0;
    background: transparent;
    color: #495057;
    font-size: 1.6rem;
    line-height: 1;
    padding: .15rem .35rem;
}

@media (max-width: 767.98px) {
    .contract-support-row {
        grid-template-columns: 1fr;
        gap: .2rem;
    }
}

@media print {
    .crm-sidebar,
    .sidebar-backdrop,
    .page-loader,
    .crm-main > .d-flex:first-child,
    .contract-dialog,
    .btn {
        display: none !important;
    }

    .crm-main {
        margin-left: 0;
        padding: 0;
    }

    .contract-card {
        break-inside: avoid;
        box-shadow: none !important;
    }
}


/* Service-user Funding & Payroll section */
.funding-card {
    border: 0;
    border-top: 4px solid var(--crm-red);
}

.funding-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    border-radius: 50%;
    background: var(--crm-red);
    color: #fff;
}

.funding-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: .65rem;
}

.funding-check {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 2.6rem;
    padding: .6rem .75rem;
    border: 1px solid #dee2e6;
    border-radius: .55rem;
    background: #fff;
    cursor: pointer;
}

.funding-check:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
}

.funding-check .form-check-input {
    flex: 0 0 auto;
    margin: 0;
}

.funding-contribution-row {
    display: grid;
    grid-template-columns: minmax(11rem, 1fr) minmax(10rem, .8fr);
    gap: .75rem;
    align-items: center;
    padding: .65rem 0;
    border-bottom: 1px solid #e9ecef;
}

.funding-contribution-row:last-child {
    border-bottom: 0;
}

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

@media print {
    .funding-card {
        break-inside: avoid;
        box-shadow: none !important;
    }
}


/* Service-user Support & Services section */
.services-card { border: 0; border-top: 4px solid var(--crm-red); }
.services-card-icon {
    display:inline-flex; align-items:center; justify-content:center;
    width:2.5rem; height:2.5rem; flex:0 0 2.5rem; border-radius:50%;
    background:var(--crm-red); color:#fff;
}
.services-card-icon-muted { background:#6c757d; }
.services-stat-strip { display:flex; gap:1.25rem; color:#495057; font-size:.9rem; }
.services-stat-strip strong { font-size:1.05rem; color:#212529; }
.services-table th { white-space:nowrap; font-size:.82rem; text-transform:uppercase; letter-spacing:.025em; color:#6c757d; }
.services-empty { padding:1rem; border:1px dashed #ced4da; border-radius:.55rem; color:#6c757d; background:#f8f9fa; }
.services-tpsa-summary > div { display:flex; flex-direction:column; gap:.25rem; }
.services-tpsa-summary span { font-size:.78rem; color:#6c757d; }
.services-tpsa-summary strong { font-size:1rem; }
@media print {
    .services-card { break-inside:avoid; box-shadow:none !important; }
    .services-table .btn, .services-stat-strip + .d-flex { display:none !important; }
}


/* Service-user Files & Documents section */
.files-card { border:0; border-top:4px solid var(--crm-red); }
.files-card-icon {
    display:inline-flex; align-items:center; justify-content:center;
    width:2.5rem; height:2.5rem; flex:0 0 2.5rem;
    border-radius:50%; background:var(--crm-red); color:#fff;
}
.files-stat { color:#6c757d; }
.files-stat strong { color:#212529; font-size:1.1rem; }
.files-table th {
    white-space:nowrap; font-size:.82rem; text-transform:uppercase;
    letter-spacing:.025em; color:#6c757d;
}
.files-empty {
    padding:1rem; border:1px dashed #ced4da; border-radius:.55rem;
    color:#6c757d; background:#f8f9fa;
}


/* More section pages */
.more-card { border:0; border-top:4px solid var(--crm-red); }
button.sidebar-section-toggle + .sidebar-submenu {
    display: grid;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-.25rem);
    pointer-events: none;
    transition:
        max-height .28s ease,
        opacity .2s ease,
        transform .28s ease,
        padding .28s ease;
    padding-top: 0;
    padding-bottom: 0;
}

button.sidebar-section-toggle + .sidebar-submenu.is-open {
    max-height: 18rem;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    padding-top: .27rem;
    padding-bottom: .36rem;
}


/* More sidebar toggle - match standard sidebar links */
.sidebar-section-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    outline: none;
    box-shadow: none;
}

.sidebar-section-toggle:hover,
.sidebar-section-toggle:focus,
.sidebar-section-toggle:focus-visible {
    border: 0;
    outline: none;
    box-shadow: none;
}

.sidebar-section-toggle.active {
    background: var(--crm-red);
    color: #fff;
}

.sidebar-section-toggle.active > i:first-child,
.sidebar-section-toggle.active .sidebar-section-chevron {
    color: #fff;
}

.sidebar-section-toggle[aria-expanded="true"] .sidebar-section-chevron {
    transform: rotate(180deg);
}


@media (prefers-reduced-motion: reduce) {
    button.sidebar-section-toggle + .sidebar-submenu,
    .sidebar-section-chevron {
        transition: none !important;
    }
}


/* Add Service User */
.create-card { border:0; border-top:4px solid var(--crm-red); }
.create-card-icon,.create-warning-icon { display:inline-flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;flex:0 0 2.5rem;border-radius:50%;background:var(--crm-red);color:#fff; }
.create-duplicate-card { border:0; border-top:4px solid #ffc107; }
.create-warning-icon { background:#ffc107;color:#212529; }
.create-duplicate-card th { white-space:nowrap;color:#6c757d;font-size:.82rem;text-transform:uppercase;letter-spacing:.025em; }
@media print { .create-card,.create-duplicate-card { break-inside:avoid;box-shadow:none!important; } }


/* Induction Quiz */
.calms-module-card,
.calms-question-card,
.calms-result-card {
    border: 0;
    border-top: 4px solid var(--crm-red);
}

.calms-module-icon,
.calms-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 2.75rem;
    border-radius: 50%;
    background: var(--crm-red);
    color: #fff;
    font-size: 1.1rem;
}

.calms-score-panel {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    padding: .8rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: .65rem;
    background: #f8f9fa;
}

.calms-score-panel strong {
    margin-left: auto;
    font-size: 1.15rem;
}

.calms-quiz-wrap {
    max-width: 900px;
}

.calms-question-count {
    font-size: .9rem;
    color: #6c757d;
}

.calms-progress {
    height: .5rem;
}

.calms-progress .progress-bar {
    background: var(--crm-red);
}

.calms-answer-list {
    display: grid;
    gap: .75rem;
}

.calms-answer-option {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: 1rem 1.1rem;
    border: 1px solid #d9dee3;
    border-radius: .7rem;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.calms-answer-option:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
}

.calms-answer-option:has(.calms-answer-input:checked) {
    border-color: var(--crm-red);
    background: rgba(228, 0, 0, .045);
}

.calms-answer-input {
    flex: 0 0 auto;
    margin-top: .2rem;
}

.calms-result-icon {
    width: 4rem;
    height: 4rem;
    font-size: 2rem;
    background: #198754;
}

.calms-result-score {
    display: inline-flex;
    align-items: baseline;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: .8rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.calms-result-score strong {
    font-size: 1.7rem;
}

.calms-result-score span {
    color: #6c757d;
}

@media (prefers-reduced-motion: reduce) {
    .calms-answer-option {
        transition: none;
    }
}


/* Website Content Management */
.cms-dashboard-card,
.cms-list-card,
.cms-editor-card {
    border: 0;
    border-top: 4px solid var(--crm-red);
}

.cms-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.65rem;
    height: 2.65rem;
    flex: 0 0 2.65rem;
    border-radius: 50%;
    background: var(--crm-red);
    color: #fff;
    font-size: 1.05rem;
}

.cms-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .6rem;
}

.cms-stat-grid > div {
    display: grid;
    gap: .1rem;
    padding: .75rem .5rem;
    text-align: center;
    border: 1px solid #dee2e6;
    border-radius: .6rem;
    background: #f8f9fa;
}

.cms-stat-grid strong {
    font-size: 1.25rem;
}

.cms-stat-grid span {
    color: #6c757d;
    font-size: .78rem;
}

.cms-list-card th {
    white-space: nowrap;
    color: #6c757d;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .025em;
}

.cms-url-cell {
    max-width: 28rem;
    overflow-wrap: anywhere;
}

.cms-content-editor {
    font-family: inherit;
    min-height: 24rem;
}

@media (max-width: 575.98px) {
    .cms-stat-grid {
        grid-template-columns: 1fr;
    }
}


/* CMS health, filters and staff ordering */
.cms-filter-card {
    border: 0;
}

.cms-health-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .75rem;
}

.cms-health-item {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-height: 6.25rem;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: .7rem;
    background: #f8f9fa;
    color: inherit;
    text-decoration: none;
    justify-content: center;
}

.cms-health-item:hover {
    border-color: #adb5bd;
    background: #fff;
}

.cms-health-item strong {
    font-size: 1.55rem;
    line-height: 1;
}

.cms-health-item span {
    color: #6c757d;
    font-size: .82rem;
}

.cms-order-number {
    min-width: 1.75rem;
    text-align: center;
    font-weight: 600;
}

.cms-order-btn {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1199.98px) {
    .cms-health-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .cms-health-grid {
        grid-template-columns: 1fr;
    }
}


/* News CMS */
.cms-news-stat {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: .7rem;
    background: #fff;
}

.cms-news-stat strong {
    font-size: 1.5rem;
    line-height: 1;
}

.cms-news-stat span {
    color: #6c757d;
    font-size: .82rem;
}

.cms-news-thumb,
.cms-news-thumb-placeholder {
    width: 88px;
    height: 50px;
    border-radius: .4rem;
}

.cms-news-thumb {
    object-fit: cover;
    display: block;
}

.cms-news-thumb-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    color: #adb5bd;
}

.cms-news-link-preview {
    max-width: 30rem;
}

.cms-news-hero-preview,
.cms-news-preview-image {
    aspect-ratio: 16 / 9;
    width: 100%;
    overflow: hidden;
    border: 1px solid #dee2e6;
    border-radius: .65rem;
    background: #f8f9fa;
}

.cms-news-hero-preview img,
.cms-news-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cms-news-hero-empty {
    width: 100%;
    height: 100%;
    min-height: 12rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: center;
    justify-content: center;
    color: #868e96;
    background: #f8f9fa;
}

.cms-news-full-preview {
    max-width: 1100px;
    margin: 0 auto;
}

.cms-news-full-preview #modalNewsContent {
    font-size: 1rem;
    line-height: 1.7;
}

@media (max-width: 767.98px) {
    .cms-news-thumb,
    .cms-news-thumb-placeholder {
        width: 68px;
        height: 40px;
    }
}


/* News editor layout */
.cms-news-edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.cms-news-edit-main,
.cms-news-edit-side {
    min-width: 0;
}

.cms-news-edit-side {
    position: sticky;
    top: 6rem;
}

@media (max-width: 1199.98px) {
    .cms-news-edit-grid {
        grid-template-columns: 1fr;
    }

    .cms-news-edit-side {
        position: static;
    }
}


/* CMS dashboard card grid */
.cms-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

.cms-dashboard-grid > .cms-dashboard-card {
    min-width: 0;
    height: 100%;
}

.cms-dashboard-grid > .cms-dashboard-card .card-body {
    height: 100%;
}

@media (max-width: 1199.98px) {
    .cms-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

/* CRM report charts */
.crm-donut-wrap {
    width: min(100%, 25rem);
    margin-inline: auto;
}

.crm-donut {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.crm-donut-track,
.crm-donut-segment {
    fill: none;
    stroke-width: 6.5;
}

.crm-donut-track {
    stroke: #e9ecef;
}

.crm-donut-segment {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-linecap: butt;
}

.crm-donut-total,
.crm-donut-caption {
    text-anchor: middle;
    dominant-baseline: middle;
    fill: var(--crm-text, #343434);
}

.crm-donut-total {
    font-size: .32rem;
    font-weight: 700;
}

.crm-donut-caption {
    font-size: .12rem;
    font-weight: 500;
    fill: #6c757d;
}

.crm-chart-legend {
    display: grid;
    gap: .65rem;
}

.crm-chart-legend-row {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    padding: .55rem .7rem;
    border-bottom: 1px solid #e9ecef;
}

.crm-chart-legend-row:last-child {
    border-bottom: 0;
}

.crm-chart-swatch {
    display: inline-block;
    width: .85rem;
    height: .85rem;
    border-radius: 50%;
}

.crm-chart-legend-label {
    min-width: 0;
    font-weight: 600;
}

.crm-chart-legend-value {
    display: flex;
    align-items: baseline;
    gap: .55rem;
    white-space: nowrap;
}

/* Palette derived from CRM red, information blue and neutral greys */
.crm-chart-colour-1 {
    stroke: var(--crm-red, #e40000);
    background: var(--crm-red, #e40000);
}

.crm-chart-colour-2 {
    stroke: #087f95;
    background: #087f95;
}

.crm-chart-colour-3 {
    stroke: #6c757d;
    background: #6c757d;
}

.crm-chart-colour-4 {
    stroke: #ee5a5a;
    background: #ee5a5a;
}

.crm-chart-colour-5 {
    stroke: #57a9b8;
    background: #57a9b8;
}

.crm-chart-colour-6 {
    stroke: #adb5bd;
    background: #adb5bd;
}

@media (max-width: 575.98px) {
    .crm-chart-legend-row {
        grid-template-columns: 1rem minmax(0, 1fr);
    }

    .crm-chart-legend-value {
        grid-column: 2;
    }
}



/* PA Recruitment public portal */
.pa-recruitment-body {
    background: var(--crm-page-bg, #eef3f5);
}

.pa-recruitment-main {
    padding-top: 2rem;
    padding-bottom: 2rem;
}


.pa-recruitment-hero {
    padding: 3rem 0 2.75rem;
}

.pa-recruitment-hero h1 {
    margin-bottom: 1.75rem;
}

.pa-recruitment-hero .lead {
    margin-top: 0;
}

.pa-recruitment-choice {
    border-top: 4px solid var(--crm-red, #e40000) !important;
}

.pa-recruitment-body .progress {
    height: 0.65rem;
}

.pa-recruitment-body .progress-bar {
    background: var(--crm-red, #e40000);
}

.pa-recruitment-body table th:first-child,
.pa-recruitment-body table td:first-child {
    padding-left: 1.5rem;
}

.pa-recruitment-body table th:last-child,
.pa-recruitment-body table td:last-child {
    padding-right: 1.5rem;
}

.pa-recruitment-logo {
    width: 225px;
    height: auto;
}


/* PA Recruitment - Personal Details */
.pa-recruitment-page-heading {
    padding: 2.25rem 0 1.75rem;
}

.pa-recruitment-eyebrow {
    color: var(--crm-red, #e40000);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.pa-recruitment-section-icon {
    align-items: center;
    background: #f4f6f7;
    border-radius: .75rem;
    display: inline-flex;
    flex: 0 0 2.75rem;
    font-size: 1.25rem;
    height: 2.75rem;
    justify-content: center;
    width: 2.75rem;
}

.pa-recruitment-check {
    border: 1px solid #dee2e6;
    border-radius: .75rem;
    height: 100%;
    padding: 1rem 1rem 1rem 2.5rem;
}

.pa-recruitment-check .form-check-input {
    margin-top: .2rem;
}

@media (min-width: 1200px) {
    .pa-recruitment-sticky-card {
        position: sticky;
        top: 2rem;
    }
}


/* PA Jobs step navigation */
.pa-job-progress {
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: .25rem;
}

.pa-job-progress-list {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0;
    min-width: 820px;
    padding: 0;
}

.pa-job-progress-item {
    flex: 1 1 0;
    position: relative;
}

.pa-job-progress-item:not(:last-child)::after {
    background: #dee2e6;
    content: "";
    height: 2px;
    left: calc(50% + 1.25rem);
    position: absolute;
    right: calc(-50% + 1.25rem);
    top: 1.1rem;
}

.pa-job-progress-item.is-previous:not(:last-child)::after {
    background: #6c757d;
}

.pa-job-progress-item a {
    align-items: center;
    color: #6c757d;
    display: flex;
    flex-direction: column;
    font-size: .8rem;
    font-weight: 600;
    gap: .45rem;
    position: relative;
    text-align: center;
    text-decoration: none;
    z-index: 1;
}

.pa-job-progress-number {
    align-items: center;
    background: #fff;
    border: 2px solid #ced4da;
    border-radius: 50%;
    display: inline-flex;
    height: 2.25rem;
    justify-content: center;
    width: 2.25rem;
}

.pa-job-progress-item.is-current a {
    color: #343434;
}

.pa-job-progress-item.is-current .pa-job-progress-number {
    border-color: var(--crm-red, #e40000);
    color: var(--crm-red, #e40000);
}

.pa-job-progress-item.is-previous .pa-job-progress-number {
    background: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.pa-job-progress-item a:hover {
    color: #343434;
}
/* Public Warwickshire appointeeship referral */
.referral-page,
.referral-login-page {
  min-height: 100vh;
  background: #f3f7f8;
  color: #1f2933;
}

.referral-page .btn-primary,
.referral-login-page .btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: #e22308;
  --bs-btn-border-color: #e22308;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #bd1d07;
  --bs-btn-hover-border-color: #b11b07;
  --bs-btn-focus-shadow-rgb: 226, 35, 8;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #b11b07;
  --bs-btn-active-border-color: #a41906;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #e22308;
  --bs-btn-disabled-border-color: #e22308;
}

.referral-login-page {
  background:
    radial-gradient(circle at top left, rgba(226, 35, 8, .10), transparent 34rem),
    linear-gradient(150deg, #f7fafb 0%, #eaf2f4 100%);
}

.referral-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.referral-login-card,
.referral-form-card,
.referral-success-card {
  background: #fff;
  border: 1px solid #dfe6e9;
  border-top: 5px solid #e22308;
  border-radius: 14px;
  box-shadow: 0 14px 38px rgba(31, 41, 51, .10);
}

.referral-login-card {
  width: min(100%, 520px);
  padding: clamp(1.5rem, 5vw, 3rem);
}

.referral-login-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.referral-login-brand img {
  width: min(100%, 290px);
  height: 74px;
  object-fit: contain;
  margin-bottom: 1.5rem;
}

.referral-login-brand h1 {
  font-size: clamp(1.8rem, 5vw, 2.35rem);
}

.eyebrow {
  margin: 0 0 .35rem;
  color: #9e240f;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.referral-login-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .35rem 1rem;
  padding-top: 1.5rem;
  margin-top: 1.75rem;
  border-top: 1px solid #e6ecef;
  color: #5f6b73;
  font-size: .88rem;
}

.referral-header {
  position: sticky;
  z-index: 1010;
  top: 0;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid #dce4e7;
  box-shadow: 0 3px 16px rgba(31, 41, 51, .06);
}

.referral-header__inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.referral-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #25323a;
  font-weight: 750;
  text-decoration: none;
}

.referral-brand img {
  width: 145px;
  height: 46px;
  object-fit: contain;
}

.referral-main {
  max-width: 1120px;
  padding-top: 2.25rem;
  padding-bottom: 4rem;
}

.referral-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.referral-intro h1 {
  margin-bottom: .5rem;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.referral-team {
  min-width: 220px;
  padding: .85rem 1rem;
  background: #fff;
  border: 1px solid #dce4e7;
  border-radius: 10px;
}

.referral-team span,
.referral-team strong {
  display: block;
}

.referral-team span {
  color: #69757d;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.referral-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .5rem;
  padding: 0;
  margin: 0 0 1rem;
  list-style: none;
}

.referral-steps li {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  padding: .75rem;
  color: #5e6b73;
  background: #e7edef;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 700;
}

.referral-steps span {
  display: grid;
  flex: 0 0 1.75rem;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  background: #fff;
  border-radius: 50%;
}

.referral-steps .is-current {
  color: #fff;
  background: #e22308;
}

.referral-steps .is-complete {
  color: #fff;
  background: #4a5962;
}

.referral-form-card {
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.referral-section-heading {
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e1e7ea;
}

.referral-section-heading p {
  margin: 0 0 .2rem;
  color: #9e240f;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.referral-section-heading h2 {
  margin: 0;
}

.referral-subsection {
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: #f7f9fa;
  border: 1px solid #e2e8eb;
  border-radius: 10px;
}

.referral-subsection h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.referral-form-card .form-label {
  font-weight: 700;
}

.referral-form-card .required {
  color: #b51f0d;
}

.referral-form-card [data-condition-name][hidden] {
  display: none !important;
}

.referral-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem 1rem;
  padding: 1rem;
  background: #f7f9fa;
  border: 1px solid #dfe6e9;
  border-radius: 8px;
}

.referral-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  margin-top: 2rem;
  border-top: 1px solid #e2e8eb;
}

.referral-review,
.referral-receipt {
  display: grid;
  gap: 0;
  overflow: hidden;
  margin: 1.5rem 0;
  border: 1px solid #dce4e7;
  border-radius: 10px;
}

.referral-review div,
.referral-receipt div {
  display: grid;
  grid-template-columns: minmax(150px, .6fr) 1.4fr;
  gap: 1rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid #e1e7ea;
}

.referral-review div:last-child,
.referral-receipt div:last-child {
  border-bottom: 0;
}

.referral-review dt,
.referral-receipt dt {
  color: #5f6b73;
}

.referral-review dd,
.referral-receipt dd {
  margin: 0;
  font-weight: 700;
}

.referral-declaration {
  padding: 1rem 1rem 1rem 2.75rem;
  background: #fff8e7;
  border: 1px solid #ead8a0;
  border-radius: 8px;
}

.referral-success {
  max-width: 820px;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.referral-success-card {
  padding: clamp(1.5rem, 5vw, 3.5rem);
  text-align: center;
}

.referral-success-icon {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  margin: 0 auto 1.25rem;
  color: #fff;
  background: #20854a;
  border-radius: 50%;
  font-size: 2rem;
}

.referral-success-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.5rem;
}

.referral-help {
  margin: 2rem 0 0;
  color: #5f6b73;
}

.page-loader {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: none;
  place-items: center;
  align-content: center;
  gap: 1rem;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(2px);
}

.page-loader.is-active {
  display: grid;
}

.page-loader p {
  font-weight: 750;
}

@media (max-width: 767.98px) {
  .referral-steps li {
    font-size: 0;
  }

  .referral-steps li {
    justify-content: center;
    padding: .55rem;
  }

  .referral-steps span {
    font-size: .85rem;
  }

  .referral-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .referral-check-grid {
    grid-template-columns: 1fr;
  }

  .referral-review div,
  .referral-receipt div {
    grid-template-columns: 1fr;
    gap: .2rem;
  }
}
