:root {
    --brand-gold: #be0f01;
    --brand-gold-dark: #970c01;
    --brand-charcoal: #021826;
    --brand-slate: #0a2a3c;
    --brand-bg: #f3f6f8;
    --brand-border: #dce3e8;
    --brand-muted: #64717c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--brand-bg);
    color: #1f2328;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    width: 280px !important;
    background: linear-gradient(180deg, var(--brand-charcoal), #111317);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
}

.brand-panel,
.guest-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-panel {
    padding: 24px 22px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-panel strong,
.guest-brand strong {
    display: block;
    font-size: 1rem;
    letter-spacing: .01em;
}

.brand-panel small,
.guest-brand small {
    display: block;
    opacity: .68;
    font-size: .78rem;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--brand-gold);
    color: #111;
    font-weight: 900;
    letter-spacing: -.04em;
    box-shadow: 0 8px 20px rgba(190,15,1,.18);
}

.sidebar-nav {
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav a,
.sidebar-nav .nav-disabled {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,.76);
    font-weight: 600;
    transition: .2s ease;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
}

.sidebar-nav a.active {
    background: var(--brand-gold);
    color: #021826;
}

.sidebar-nav i {
    width: 20px;
    text-align: center;
}

.sidebar-nav .nav-disabled {
    opacity: .38;
    cursor: not-allowed;
}

.nav-heading {
    padding: 16px 14px 6px;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,.35);
    font-weight: 800;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-user small {
    color: rgba(255,255,255,.55);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(190,15,1,.18);
    color: var(--brand-gold);
    display: grid;
    place-items: center;
    font-weight: 800;
}

.app-main {
    min-height: 100vh;
    margin-left: 280px;
}

.topbar {
    min-height: 92px;
    background: #fff;
    border-bottom: 1px solid var(--brand-border);
    padding: 18px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.topbar h1 {
    font-size: 1.35rem;
    margin: 0;
    font-weight: 800;
}

.topbar p {
    margin: 2px 0 0;
    color: var(--brand-muted);
    font-size: .88rem;
}

.content-wrap {
    padding: 28px;
}

.btn-brand {
    background: var(--brand-gold);
    border-color: var(--brand-gold);
    color: #111;
    font-weight: 700;
}

.btn-brand:hover,
.btn-brand:focus {
    background: var(--brand-gold-dark);
    border-color: var(--brand-gold-dark);
    color: #111;
}

.metric-card,
.panel-card {
    background: #fff;
    border: 1px solid var(--brand-border);
    box-shadow: 0 6px 22px rgba(18,24,33,.04);
}

.metric-card {
    min-height: 112px;
    border-radius: 16px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.metric-icon,
.record-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.metric-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(190,15,1,.14);
    color: #be0f01;
    font-size: 1.2rem;
}

.metric-card span {
    color: var(--brand-muted);
    font-size: .83rem;
    display: block;
}

.metric-card strong {
    display: block;
    margin-top: 2px;
    font-size: 1.85rem;
    line-height: 1;
}

.metric-card.muted {
    opacity: .62;
}

.panel-card {
    border-radius: 16px;
    overflow: hidden;
}

.panel-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--brand-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.panel-header p {
    margin: 3px 0 0;
    color: var(--brand-muted);
    font-size: .84rem;
}

.panel-body {
    padding: 22px;
}

.panel-footer {
    padding: 18px 22px;
    border-top: 1px solid var(--brand-border);
}

.record-row,
.vehicle-row {
    color: inherit;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--brand-border);
    transition: .18s ease;
}

.record-row:last-child,
.vehicle-row:last-child {
    border-bottom: 0;
}

.record-row:hover,
.vehicle-row:hover {
    background: #fafafa;
}

.record-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f2f3f5;
    color: #363b43;
}

.record-row strong,
.vehicle-row strong {
    display: block;
}

.record-row span,
.vehicle-row span {
    display: block;
    color: var(--brand-muted);
    font-size: .84rem;
    margin-top: 2px;
}

.activity-row {
    display: flex;
    gap: 13px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--brand-border);
}

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

.activity-dot {
    width: 9px;
    height: 9px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--brand-gold);
    box-shadow: 0 0 0 5px rgba(190,15,1,.12);
    flex: 0 0 auto;
}

.activity-row strong {
    display: block;
    font-size: .9rem;
}

.activity-row span {
    display: block;
    margin-top: 3px;
    color: var(--brand-muted);
    font-size: .78rem;
}

.empty-state {
    padding: 52px 24px;
    text-align: center;
    color: var(--brand-muted);
}

.empty-state.compact {
    padding: 34px 22px;
}

.empty-state > i {
    font-size: 2.3rem;
    color: #adb3bc;
}

.empty-state h3 {
    font-size: 1rem;
    color: #282d33;
    margin: 12px 0 6px;
}

.empty-state p {
    margin: 0 auto 18px;
    max-width: 460px;
}

.table thead th {
    background: #f8f9fa;
    border-bottom: 1px solid var(--brand-border);
    color: #525962;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 13px 16px;
}

.table tbody td {
    padding: 15px 16px;
    border-color: var(--brand-border);
}

.table-subtext {
    color: var(--brand-muted);
    font-size: .8rem;
    margin-top: 2px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-active {
    background: #e5f6ec;
    color: #1d6b3c;
}

.status-on_hold {
    background: #fff2d8;
    color: #8a5b00;
}

.status-blocked {
    background: #fde7e7;
    color: #a62c2c;
}

.mobile-record-list {
    padding: 12px;
}

.mobile-record-card {
    display: block;
    color: inherit;
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
}

.mobile-record-card strong,
.mobile-record-card span,
.mobile-record-card small {
    display: block;
}

.mobile-record-card span {
    color: var(--brand-muted);
    margin-top: 4px;
}

.mobile-record-card small {
    color: var(--brand-muted);
    margin-top: 6px;
}

.search-form {
    width: min(100%, 520px);
}

.form-label {
    font-weight: 700;
    font-size: .86rem;
}

.form-control,
.form-select,
.input-group-text {
    min-height: 44px;
    border-color: #d8dce2;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 .2rem rgba(190,15,1,.15);
}

.sticky-actions {
    position: sticky;
    bottom: 18px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--brand-border);
    box-shadow: 0 8px 30px rgba(18,24,33,.09);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    z-index: 10;
}

.detail-list > div {
    display: grid;
    grid-template-columns: 125px 1fr;
    gap: 18px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--brand-border);
}

.detail-list > div:last-child {
    border-bottom: 0;
}

.detail-list span,
.detail-grid span {
    color: var(--brand-muted);
    font-size: .8rem;
}

.detail-list strong,
.detail-grid strong {
    font-size: .9rem;
}

.registration-plate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f4cf21;
    color: #101010;
    border: 2px solid #111;
    border-radius: 5px;
    padding: 5px 10px;
    min-width: 104px;
    font-family: "Arial Narrow", Arial, sans-serif;
    font-weight: 900;
    letter-spacing: .08em;
    white-space: nowrap;
}

.registration-plate.large {
    font-size: 1.35rem;
    min-width: 160px;
    padding: 8px 14px;
}

.registration-input {
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: .08em;
}

.vehicle-hero {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid var(--brand-border);
}

.vehicle-hero h2 {
    font-size: 1.25rem;
    margin: 0;
    font-weight: 800;
}

.vehicle-hero p {
    color: var(--brand-muted);
    margin: 3px 0 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
}

.detail-grid > div {
    padding: 18px 22px;
    border-bottom: 1px solid var(--brand-border);
    border-right: 1px solid var(--brand-border);
}

.detail-grid > div:nth-child(even) {
    border-right: 0;
}

.detail-grid span,
.detail-grid strong {
    display: block;
}

.detail-grid strong {
    margin-top: 5px;
}

.grid-span-2 {
    grid-column: span 2;
}

.preserve-lines {
    white-space: pre-line;
}

.guest-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(190,15,1,.18), transparent 34%),
        linear-gradient(135deg, #021826, #282b31);
}

.guest-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.guest-card {
    width: min(100%, 500px);
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 30px 80px rgba(0,0,0,.25);
}

.guest-brand {
    margin-bottom: 30px;
}

.guest-brand small {
    color: var(--brand-muted);
    opacity: 1;
}

.eyebrow {
    display: inline-block;
    color: #be0f01;
    background: rgba(190,15,1,.14);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 12px;
}

.pagination {
    margin-bottom: 0;
}

.page-link {
    color: #24282e;
}

.page-item.active .page-link {
    background: var(--brand-gold);
    border-color: var(--brand-gold);
    color: #111;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
    }

    .app-main {
        margin-left: 0;
    }

    .topbar {
        min-height: 78px;
        padding: 14px 16px;
    }

    .topbar-actions .btn {
        font-size: 0;
        width: 44px;
        height: 44px;
        display: inline-grid;
        place-items: center;
        padding: 0;
    }

    .topbar-actions .btn i {
        font-size: 1rem;
        margin: 0 !important;
    }

    .content-wrap {
        padding: 18px 14px 86px;
    }
}

@media (max-width: 575.98px) {
    .guest-card {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .metric-card {
        min-height: 104px;
        padding: 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .metric-card strong {
        font-size: 1.5rem;
    }

    .panel-header,
    .panel-body {
        padding: 17px;
    }

    .vehicle-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .vehicle-row > .flex-grow-1 {
        min-width: calc(100% - 130px);
    }

    .detail-list > div {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 14px 17px;
    }

    .vehicle-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-grid > div,
    .detail-grid > div:nth-child(even) {
        border-right: 0;
    }

    .grid-span-2 {
        grid-column: span 1;
    }

    .sticky-actions {
        position: fixed;
        inset: auto 10px 10px 10px;
        justify-content: stretch;
    }

    .sticky-actions .btn {
        flex: 1;
    }
}


/* Stage 2: enquiries and quotes */

.filter-bar {
    width: min(100%, 720px);
}

.registration-plate.small {
    min-width: 88px;
    padding: 3px 7px;
    font-size: .78rem;
}

.enquiry-status-new,
.enquiry-status-awaiting_photos,
.enquiry-status-awaiting_estimate,
.enquiry-status-quote_preparation,
.quote-status-draft {
    background: #eef1f5;
    color: #4e5865;
}

.enquiry-status-inspection_booked,
.enquiry-status-quote_sent,
.enquiry-status-awaiting_response,
.quote-status-sent {
    background: #e5f0ff;
    color: #245ea9;
}

.enquiry-status-accepted,
.enquiry-status-converted_to_job,
.quote-status-accepted {
    background: #e5f6ec;
    color: #1d6b3c;
}

.enquiry-status-declined,
.enquiry-status-cancelled,
.quote-status-declined {
    background: #fde7e7;
    color: #a62c2c;
}

.enquiry-status-no_response,
.quote-status-expired,
.quote-status-superseded {
    background: #fff2d8;
    color: #8a5b00;
}

.section-heading {
    margin: 0 0 8px;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #5e6671;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
}

.photo-card {
    overflow: hidden;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    background: #fff;
}

.photo-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    background: #e9ebee;
}

.photo-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
}

.photo-meta strong,
.photo-meta span {
    display: block;
}

.photo-meta strong {
    font-size: .82rem;
}

.photo-meta span {
    color: var(--brand-muted);
    font-size: .72rem;
    margin-top: 2px;
}

.value-panel {
    padding: 34px 28px;
}

.value-panel span {
    display: block;
    color: var(--brand-muted);
    font-size: .85rem;
}

.value-panel strong {
    display: block;
    margin-top: 5px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1;
}

.quote-items {
    padding: 16px;
    display: grid;
    gap: 16px;
}

.quote-item-row {
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    padding: 18px;
    background: #fbfbfc;
}

.quote-item-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.quote-item-heading strong {
    font-size: .88rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.line-total-label,
.quote-line-total {
    display: block;
}

.line-total-label {
    color: var(--brand-muted);
    font-size: .78rem;
    margin-top: 28px;
}

.quote-line-total {
    font-size: 1.25rem;
    margin-top: 2px;
}

.quote-summary-card {
    position: sticky;
    top: 116px;
}

.quote-totals > div,
.quote-view-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px solid var(--brand-border);
}

.quote-totals span,
.quote-view-summary span {
    color: var(--brand-muted);
}

.quote-totals strong,
.quote-view-summary strong {
    white-space: nowrap;
}

.quote-totals .grand-total,
.quote-view-summary .grand-total {
    margin-top: 7px;
    padding-top: 16px;
    border-top: 3px solid #082636;
    border-bottom: 0;
    font-size: 1.25rem;
}

.quote-view-header {
    padding: 24px;
    border-bottom: 1px solid var(--brand-border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.quote-view-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 850;
}

.quote-view-header p {
    margin: 5px 0 0;
    color: var(--brand-muted);
}

.quote-party-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--brand-border);
}

.quote-party-grid > div {
    min-height: 120px;
    padding: 20px 22px;
    border-right: 1px solid var(--brand-border);
}

.quote-party-grid > div:last-child {
    border-right: 0;
}

.quote-party-grid span {
    display: block;
    color: var(--brand-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 750;
}

.quote-party-grid strong {
    display: block;
    margin-top: 7px;
    font-size: 1rem;
}

.quote-party-grid p {
    margin: 5px 0 0;
    color: var(--brand-muted);
    font-size: .84rem;
}

.quote-table thead th {
    background: #082636;
    color: #fff;
}

.quote-view-summary {
    width: min(100%, 440px);
    padding: 24px;
    margin-left: auto;
}

.acceptance-card {
    border-color: #b7dec5;
}

.acceptance-card .panel-header {
    background: #f3fbf6;
}

@media (max-width: 991.98px) {
    .quote-summary-card {
        position: static;
    }

    .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .filter-bar .input-group {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .filter-bar .input-group > .form-select,
    .filter-bar .input-group > .btn {
        grid-column: span 2;
        border-radius: .375rem !important;
        margin-top: 8px;
    }

    .filter-bar .input-group > .input-group-text {
        border-radius: .375rem 0 0 .375rem !important;
    }

    .filter-bar .input-group > .form-control {
        border-radius: 0 .375rem .375rem 0 !important;
    }

    .quote-party-grid {
        grid-template-columns: 1fr;
    }

    .quote-party-grid > div {
        min-height: 0;
        border-right: 0;
        border-bottom: 1px solid var(--brand-border);
    }

    .quote-party-grid > div:last-child {
        border-bottom: 0;
    }

    .quote-view-header {
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .photo-grid {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .quote-items {
        padding: 10px;
    }

    .quote-item-row {
        padding: 14px;
    }

    .line-total-label {
        margin-top: 0;
    }

    .quote-view-summary {
        width: 100%;
        padding: 18px;
    }
}


/* Customer search and quick-create improvements */
.customer-search-box {
    position: relative;
}

.customer-search-results {
    margin-top: 8px;
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(18, 24, 33, .12);
}

.customer-search-result {
    width: 100%;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 0;
    border-bottom: 1px solid var(--brand-border);
    background: #fff;
    color: inherit;
    text-align: left;
}

.customer-search-result:last-of-type {
    border-bottom: 0;
}

.customer-search-result:hover,
.customer-search-result:focus {
    background: #f8f7f2;
    outline: none;
}

.customer-result-icon,
.selected-customer-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(190, 15, 1, .16);
    color: #a50d01;
}

.customer-result-copy {
    min-width: 0;
}

.customer-result-copy strong,
.customer-result-copy small {
    display: block;
}

.customer-result-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-result-copy small,
.customer-result-vehicles {
    color: var(--brand-muted);
    font-size: .78rem;
}

.customer-result-copy small {
    margin-top: 2px;
}

.customer-result-vehicles {
    white-space: nowrap;
}

.customer-search-empty {
    padding: 18px;
    color: var(--brand-muted);
    text-align: center;
}

.selected-customer-card {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 10px;
    padding: 11px 13px;
    border: 1px solid #cde7d7;
    border-radius: 11px;
    background: #f2fbf5;
}

.selected-customer-card strong,
.selected-customer-card small {
    display: block;
}

.selected-customer-card small {
    margin-top: 2px;
    color: var(--brand-muted);
    font-size: .78rem;
}

.selected-customer-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dff3e6;
    color: #1d6b3c;
}

.quick-customer-divider {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--brand-border);
}

.quick-customer-divider > span {
    color: var(--brand-muted);
    font-weight: 700;
}

.quick-customer-panel {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid #dec98e;
    border-radius: 14px;
    background: #fffdf6;
}

.quick-customer-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.quick-customer-heading h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.quick-customer-heading p {
    margin: 3px 0 0;
    color: var(--brand-muted);
    font-size: .82rem;
}

.quick-mode-disabled {
    opacity: .45;
    pointer-events: none;
}

.quick-section-rule {
    margin: 2px 0;
    border-color: #e6dbba;
    opacity: 1;
}

/* More spacious quote item layout */
.quote-item-row {
    padding: 22px;
    background: #fff;
}

.quote-item-grid .form-label {
    min-height: 20px;
    line-height: 1.25;
    white-space: normal;
}

.optional-label {
    margin-left: 4px;
    color: var(--brand-muted);
    font-size: .68rem;
    font-weight: 600;
}

.quote-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--brand-border);
}

.quote-item-total {
    min-width: 140px;
    text-align: right;
}

.quote-item-footer .line-total-label {
    margin-top: 0;
}

@media (max-width: 767.98px) {
    .quick-customer-divider,
    .quick-customer-heading,
    .quote-item-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .quick-customer-divider .btn,
    .quick-customer-heading .btn {
        width: 100%;
    }

    .customer-search-result {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .customer-result-vehicles {
        display: none;
    }

    .quote-item-total {
        min-width: 0;
        text-align: left;
    }
}


/* Stage 3: bodyshop jobs, invoices and payments */

.metric-link {
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.metric-link:hover {
    color: inherit;
    transform: translateY(-2px);
    border-color: rgba(190, 15, 1, .55);
    box-shadow: 0 12px 30px rgba(18, 24, 33, .09);
}

.filter-bar {
    width: min(100%, 720px);
}

.filter-bar .form-select {
    max-width: 210px;
}

.mini-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-metric-grid a {
    color: inherit;
    padding: 28px;
    border-right: 1px solid var(--brand-border);
    transition: background .18s ease;
}

.mini-metric-grid a:last-child {
    border-right: 0;
}

.mini-metric-grid a:hover {
    background: #fafafa;
}

.mini-metric-grid span,
.mini-metric-grid strong {
    display: block;
}

.mini-metric-grid span {
    color: var(--brand-muted);
    font-size: .82rem;
}

.mini-metric-grid strong {
    margin-top: 6px;
    font-size: 2rem;
}

.job-status-awaiting_booking,
.job-status-booked {
    background: #edf1f5;
    color: #46505c;
}

.job-status-vehicle_received,
.job-status-strip_down,
.job-status-body_repair,
.job-status-preparation,
.job-status-paint,
.job-status-reassembly,
.job-status-quality_control,
.job-status-valeting {
    background: #e5eefc;
    color: #234f93;
}

.job-status-awaiting_parts {
    background: #fff2d8;
    color: #8a5b00;
}

.job-status-ready_for_collection {
    background: #e3f6ea;
    color: #146b39;
}

.job-status-collected,
.job-status-completed {
    background: #dbf3e4;
    color: #0e6534;
}

.job-status-cancelled {
    background: #fde7e7;
    color: #9d2929;
}

.invoice-status-draft {
    background: #edf1f5;
    color: #46505c;
}

.invoice-status-sent {
    background: #e5eefc;
    color: #234f93;
}

.invoice-status-part_paid {
    background: #fff2d8;
    color: #8a5b00;
}

.invoice-status-paid {
    background: #dbf3e4;
    color: #0e6534;
}

.invoice-status-overdue,
.invoice-status-void {
    background: #fde7e7;
    color: #9d2929;
}

.job-hero,
.invoice-view-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    border-bottom: 1px solid var(--brand-border);
}

.job-hero h2,
.invoice-view-header h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 850;
}

.job-hero p,
.invoice-view-header p {
    margin: 4px 0 0;
    color: var(--brand-muted);
}

.job-hero-status {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 8px;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: .72rem;
    font-weight: 800;
}

.priority-normal {
    background: #eff1f4;
    color: #525b66;
}

.priority-high {
    background: #fff2d8;
    color: #8a5b00;
}

.priority-urgent {
    background: #fde7e7;
    color: #9d2929;
}

.job-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.job-detail-grid > div {
    padding: 17px 20px;
    border-right: 1px solid var(--brand-border);
    border-bottom: 1px solid var(--brand-border);
    min-width: 0;
}

.job-detail-grid > div:nth-child(4n) {
    border-right: 0;
}

.job-detail-grid span,
.job-detail-grid strong {
    display: block;
}

.job-detail-grid span {
    color: var(--brand-muted);
    font-size: .76rem;
    margin-bottom: 5px;
}

.job-detail-grid strong {
    font-size: .88rem;
    overflow-wrap: anywhere;
}

.job-approved-total {
    padding: 18px 22px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    border-top: 1px solid var(--brand-border);
    background: #fafafa;
}

.job-approved-total span {
    color: var(--brand-muted);
    font-weight: 700;
}

.job-approved-total strong {
    font-size: 1.25rem;
}

.release-warning {
    border-radius: 16px;
    padding: 18px 22px;
    background: #bd2525;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 10px 28px rgba(150, 25, 25, .22);
}

.release-warning span,
.release-warning strong {
    display: block;
}

.release-warning span {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    opacity: .75;
    font-weight: 800;
}

.release-warning strong {
    font-size: 1.08rem;
    margin-top: 3px;
}

.paid-banner {
    border-radius: 16px;
    padding: 18px 22px;
    background: #16713f;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 28px rgba(20, 105, 57, .18);
}

.paid-banner > i {
    font-size: 1.75rem;
}

.paid-banner span,
.paid-banner strong {
    display: block;
}

.paid-banner span {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    opacity: .75;
    font-weight: 800;
}

.paid-banner strong {
    font-size: 1.08rem;
}

.timeline-row,
.payment-row,
.status-history-row {
    display: flex;
    gap: 14px;
    padding: 17px 22px;
    border-bottom: 1px solid var(--brand-border);
}

.timeline-row:last-child,
.payment-row:last-child,
.status-history-row:last-child {
    border-bottom: 0;
}

.timeline-icon,
.payment-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(190, 15, 1, .14);
    color: #be0f01;
    flex: 0 0 auto;
}

.timeline-row span,
.timeline-row small,
.payment-row span,
.status-history-row span {
    color: var(--brand-muted);
    font-size: .78rem;
}

.timeline-row p,
.payment-row p,
.status-history-row p {
    margin: 7px 0 4px;
    font-size: .88rem;
}

.status-history-row .activity-dot {
    margin: 6px 4px 0 0;
}

.invoice-balance-card {
    border: 1px solid var(--brand-border);
    background: #f7f8fa;
    border-radius: 12px;
    padding: 14px;
}

.invoice-balance-card span,
.invoice-balance-card strong {
    display: block;
}

.invoice-balance-card span {
    color: var(--brand-muted);
    font-size: .78rem;
}

.invoice-balance-card strong {
    margin-top: 3px;
    font-size: 1.12rem;
}

.invoice-source-header {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.invoice-source-header > div {
    padding: 18px 22px;
    border-right: 1px solid var(--brand-border);
}

.invoice-source-header > div:last-child {
    border-right: 0;
}

.invoice-source-header span,
.invoice-source-header strong {
    display: block;
}

.invoice-source-header span {
    color: var(--brand-muted);
    font-size: .76rem;
    margin-bottom: 4px;
}

.balance-total {
    margin-top: 7px;
    padding-top: 14px !important;
    border-top: 2px solid #082636 !important;
    color: #111;
    font-size: 1.12rem;
}

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

    .job-detail-grid > div:nth-child(4n) {
        border-right: 1px solid var(--brand-border);
    }

    .job-detail-grid > div:nth-child(2n) {
        border-right: 0;
    }
}

@media (max-width: 767.98px) {
    .filter-bar .input-group {
        display: grid;
        grid-template-columns: 44px 1fr;
    }

    .filter-bar .input-group > * {
        border-radius: 0;
        width: auto;
        max-width: none;
    }

    .filter-bar .input-group > :first-child {
        border-radius: 8px 0 0 0;
    }

    .filter-bar .input-group > :nth-child(2) {
        border-radius: 0 8px 0 0;
    }

    .filter-bar .form-select,
    .filter-bar .btn {
        grid-column: span 2;
    }

    .filter-bar .input-group > :last-child {
        border-radius: 0 0 8px 8px;
    }

    .job-hero,
    .invoice-view-header {
        flex-direction: column;
    }

    .job-hero-status {
        align-items: flex-start;
    }

    .invoice-source-header {
        grid-template-columns: 1fr;
    }

    .invoice-source-header > div {
        border-right: 0;
        border-bottom: 1px solid var(--brand-border);
    }

    .invoice-source-header > div:last-child {
        border-bottom: 0;
    }
}

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

    .job-detail-grid > div,
    .job-detail-grid > div:nth-child(2n),
    .job-detail-grid > div:nth-child(4n) {
        border-right: 0;
    }

    .release-warning {
        align-items: stretch;
        flex-direction: column;
    }

    .release-warning .btn {
        width: 100%;
    }

    .payment-row {
        flex-wrap: wrap;
    }

    .payment-row form {
        width: 100%;
    }

    .payment-row form .btn {
        width: 100%;
    }

    .mini-metric-grid {
        grid-template-columns: 1fr;
    }

    .mini-metric-grid a {
        border-right: 0;
        border-bottom: 1px solid var(--brand-border);
    }

    .mini-metric-grid a:last-child {
        border-bottom: 0;
    }
}


/* Stage 4 customer portal and workshop workflow */
.public-portal-body {
    min-height: 100vh;
    background: #f3f4f6;
}

.public-portal-header {
    background: #021826;
    color: #fff;
    padding: 18px 0;
    border-bottom: 3px solid #be0f01;
}

.public-portal-header strong {
    font-size: 1rem;
}

.public-portal-header small {
    color: rgba(255,255,255,.62);
}

.public-portal-footer {
    padding: 28px 0;
    text-align: center;
    color: #737b86;
    font-size: .82rem;
}

.public-card {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 34px rgba(18,24,33,.06);
}

.public-card-header {
    padding: 24px;
    border-bottom: 1px solid var(--brand-border);
}

.public-card-header h1,
.public-card-header h2 {
    margin: 0;
    font-weight: 850;
}

.public-card-header h1 {
    font-size: 1.65rem;
}

.public-card-header h2 {
    font-size: 1.25rem;
}

.public-card-header p {
    margin: 5px 0 0;
    color: var(--brand-muted);
}

.public-totals {
    margin-left: auto;
    width: min(100%, 480px);
    padding: 22px 24px;
}

.public-totals > div,
.payment-summary {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 7px 0;
}

.public-totals .grand-total {
    margin-top: 7px;
    padding-top: 14px;
    border-top: 2px solid #082636;
    font-size: 1.2rem;
}

.public-notes {
    margin: 0 24px 24px;
    padding: 18px;
    background: #f7f8fa;
    border-left: 4px solid var(--brand-gold);
    border-radius: 8px;
}

.public-notes h2 {
    font-size: .95rem;
    margin: 0 0 8px;
}

.public-result-icon {
    font-size: 3.5rem;
    display: inline-block;
    margin-bottom: 12px;
}

.repair-progress {
    height: 13px;
    background: #e6e8ec;
    border-radius: 999px;
}

.repair-progress .progress-bar {
    background: var(--brand-gold);
}

.customer-timeline {
    padding: 12px 24px 24px;
}

.customer-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--brand-border);
}

.customer-timeline-item:last-child {
    border-bottom: 0;
}

.timeline-marker {
    width: 12px;
    height: 12px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--brand-gold);
    box-shadow: 0 0 0 5px rgba(190,15,1,.13);
}

.customer-photo-grid,
.staff-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.customer-photo-grid a,
.staff-photo-grid a {
    color: inherit;
}

.customer-photo-grid img,
.staff-photo-grid img {
    display: block;
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--brand-border);
}

.customer-photo-grid span {
    display: block;
    margin-top: 6px;
    font-size: .78rem;
    color: var(--brand-muted);
}

.supplement-public-card,
.supplement-row {
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 14px;
}

.supplement-row {
    border-width: 0 0 1px;
    border-radius: 0;
    margin: 0;
}

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

.supplement-row span {
    display: block;
    color: var(--brand-muted);
    font-size: .8rem;
}

.supplement-row p {
    margin: 10px 0;
    font-size: .88rem;
}

.payment-summary {
    align-items: center;
    background: #f7f8fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 22px;
}

.payment-summary span {
    color: var(--brand-muted);
}

.payment-summary strong {
    font-size: 1.8rem;
    color: #be0f01;
}

.job-summary-hero {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--brand-border);
}

.job-summary-hero h2 {
    margin: 14px 0 2px;
    font-size: 1.25rem;
    font-weight: 800;
}

.job-summary-hero p {
    margin: 0;
    color: var(--brand-muted);
}

.job-progress-card {
    width: min(100%, 340px);
    padding: 18px;
    border: 1px solid var(--brand-border);
    background: #f8f9fa;
    border-radius: 14px;
}

.job-progress-card small {
    display: block;
    margin-top: 10px;
    color: var(--brand-muted);
}

.workflow-card {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    padding: 18px;
    color: inherit;
    box-shadow: 0 6px 22px rgba(18,24,33,.04);
}

.workflow-card > i:first-child {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #f0f1f3;
    font-size: 1.2rem;
}

.workflow-card > div {
    flex: 1;
}

.workflow-card strong,
.workflow-card span {
    display: block;
}

.workflow-card span {
    margin-top: 3px;
    color: var(--brand-muted);
    font-size: .82rem;
}

.workflow-card.complete {
    border-color: #abd7bc;
    background: #f5fcf8;
}

.workflow-card.complete > i:first-child {
    background: #dff4e7;
    color: #207244;
}

.job-update-row {
    padding: 18px 22px;
    border-bottom: 1px solid var(--brand-border);
}

.job-update-row:last-child {
    border-bottom: 0;
}

.job-update-row span {
    display: block;
    color: var(--brand-muted);
    font-size: .78rem;
    margin-top: 3px;
}

.staff-photo-card {
    overflow: hidden;
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    background: #fff;
}

.staff-photo-card img {
    border: 0;
    border-radius: 0;
}

.staff-photo-card > div {
    padding: 9px;
}

.staff-photo-card strong,
.staff-photo-card small {
    display: block;
}

.staff-photo-card small {
    color: var(--brand-muted);
    margin: 2px 0 5px;
}

.qc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.qc-check {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    padding: 14px;
}

.qc-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.qc-check span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 2px solid #b8bec7;
    border-radius: 8px;
    color: transparent;
}

.qc-check input:checked + span {
    background: #25834f;
    border-color: #25834f;
    color: #fff;
}

.release-warning {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #a91f2a;
    color: #fff;
    padding: 18px 22px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(169,31,42,.18);
}

.release-warning > i {
    font-size: 1.8rem;
}

.release-warning strong,
.release-warning span {
    display: block;
}

.release-warning strong {
    font-size: 1.05rem;
}

.release-warning span {
    opacity: .88;
}

.supplement-total-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7f8fa;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    padding: 18px;
}

.supplement-total-preview strong {
    font-size: 1.5rem;
    color: #be0f01;
}

.payment-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--brand-border);
}

.payment-link-row:last-child {
    border-bottom: 0;
}

.payment-link-row strong,
.payment-link-row span {
    display: block;
}

.payment-link-row span {
    color: var(--brand-muted);
    font-size: .78rem;
    margin-top: 2px;
}

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

    .job-progress-card {
        width: 100%;
    }

    .qc-grid {
        grid-template-columns: 1fr;
    }

    .public-card-header {
        padding: 20px;
    }

    .public-totals {
        padding: 20px;
    }

    .customer-photo-grid,
    .staff-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* ================================================================
   PCR PAISLEY CRASH REPAIR BRANDING
   Navy: #021826 | Red: #be0f01 | White: #ffffff
   ================================================================ */

.sidebar {
    background:
        radial-gradient(circle at 20% 0%, rgba(190, 15, 1, .13), transparent 28%),
        linear-gradient(180deg, #021826 0%, #00131f 100%);
}

.brand-panel {
    min-height: 142px;
    padding: 17px 16px 15px;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 9px;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.brand-logo {
    display: block;
    width: 100%;
    max-width: 242px;
    height: auto;
    margin: 0 auto;
    border-radius: 7px;
}

.brand-panel-copy {
    padding: 0 4px;
    text-align: center;
}

.brand-panel-copy strong {
    display: block;
    color: #ffffff;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .03em;
}

.brand-panel-copy small {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, .56);
    font-size: .69rem;
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, #d01608, #a70d02);
    color: #ffffff;
    box-shadow: 0 9px 22px rgba(190, 15, 1, .22);
}

.sidebar-nav a.active i,
.sidebar-nav a.active span {
    color: #ffffff;
}

.btn-brand {
    background: linear-gradient(135deg, #d01608, #ad0d02);
    border-color: #be0f01;
    color: #ffffff;
    box-shadow: 0 7px 18px rgba(190, 15, 1, .14);
}

.btn-brand:hover,
.btn-brand:focus,
.btn-brand:active {
    background: #970c01 !important;
    border-color: #970c01 !important;
    color: #ffffff !important;
}

.metric-icon,
.record-icon {
    background: rgba(190, 15, 1, .10);
    color: #be0f01;
}

.activity-dot {
    background: #be0f01;
    box-shadow: 0 0 0 5px rgba(190, 15, 1, .11);
}

.form-control:focus,
.form-select:focus {
    border-color: #be0f01;
    box-shadow: 0 0 0 .2rem rgba(190, 15, 1, .13);
}

.page-item.active .page-link {
    background: #be0f01;
    border-color: #be0f01;
    color: #ffffff;
}

.eyebrow {
    color: #a70d02;
    background: rgba(190, 15, 1, .10);
}

.guest-body {
    background:
        radial-gradient(circle at top right, rgba(190, 15, 1, .24), transparent 34%),
        radial-gradient(circle at bottom left, rgba(255, 255, 255, .04), transparent 34%),
        linear-gradient(135deg, #021826, #00131f);
}

.guest-card {
    border-top: 4px solid #be0f01;
}

.guest-brand {
    display: block;
    text-align: center;
}

.guest-brand-logo {
    display: block;
    width: min(100%, 390px);
    height: auto;
    margin: 0 auto 14px;
    border-radius: 9px;
}

.guest-brand-copy strong {
    display: block;
    color: #021826;
    font-size: .96rem;
    font-weight: 800;
}

.guest-brand-copy small {
    display: block;
    margin-top: 3px;
    color: #64717c;
    font-size: .78rem;
}

.public-portal-header {
    background:
        radial-gradient(circle at 15% 0%, rgba(190, 15, 1, .19), transparent 30%),
        linear-gradient(135deg, #021826, #00131f);
    border-bottom: 4px solid #be0f01;
}

.public-brand-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
}

.public-brand-logo {
    display: block;
    width: min(100%, 310px);
    height: auto;
    border-radius: 7px;
}

.public-brand-copy {
    padding-left: 19px;
    border-left: 2px solid #be0f01;
}

.public-brand-copy strong {
    color: #ffffff;
    font-size: 1rem;
    letter-spacing: .02em;
}

.public-brand-copy small {
    margin-top: 3px;
    color: rgba(255,255,255,.62);
}

.public-portal-footer {
    border-top: 3px solid #be0f01;
    background: #021826;
    color: rgba(255, 255, 255, .72);
}

.public-card-header {
    border-top: 3px solid #be0f01;
}

.repair-progress .progress-bar {
    background: linear-gradient(90deg, #be0f01, #e32616);
}

.quote-view-header,
.vehicle-hero {
    border-top: 3px solid #be0f01;
}

.quote-view-summary .grand-total strong,
.invoice-summary .grand-total strong {
    color: #be0f01;
}

@media (max-width: 767.98px) {
    .public-brand-wrap {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .public-brand-logo {
        width: min(100%, 280px);
    }

    .public-brand-copy {
        padding-left: 0;
        border-left: 0;
    }
}


/* ================================================================
   MOBILE NAVIGATION DRAWER FIX
   Keeps the Bootstrap backdrop behind the drawer and restores
   touch/click access to all navigation links.
   ================================================================ */

@media (max-width: 991.98px) {
    .sidebar.offcanvas-lg {
        width: min(88vw, 320px) !important;
        max-width: 320px;
        z-index: 1060 !important;
        pointer-events: auto;
        touch-action: pan-y;
        overflow: hidden;
        box-shadow: 18px 0 45px rgba(0, 0, 0, .30);
    }

    .sidebar.offcanvas-lg.show,
    .sidebar.offcanvas-lg.showing {
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .sidebar .offcanvas-header,
    .sidebar .brand-panel,
    .sidebar .sidebar-nav,
    .sidebar .sidebar-user {
        position: relative;
        z-index: 2;
        pointer-events: auto;
    }

    .sidebar-nav {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .sidebar-nav a {
        position: relative;
        z-index: 3;
        pointer-events: auto !important;
        touch-action: manipulation;
    }

    .offcanvas-backdrop {
        z-index: 1050 !important;
        pointer-events: auto;
    }

    .offcanvas-backdrop.show {
        opacity: .56;
    }

    body.offcanvas-open,
    body:has(.sidebar.show),
    body:has(.sidebar.showing) {
        overflow: hidden;
    }
}


/* STAGE 5: STAFF, REPORTS AND SETTINGS */
.attention-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px; padding:16px; }
.attention-card { display:flex; align-items:center; gap:14px; padding:16px; border:1px solid var(--brand-border); border-radius:12px; color:inherit; background:#fff; transition:.18s ease; }
.attention-card:hover { transform:translateY(-1px); border-color:rgba(190,15,1,.35); box-shadow:0 8px 22px rgba(18,24,33,.06); }
.attention-card > i:first-child { width:42px; height:42px; display:grid; place-items:center; border-radius:10px; background:rgba(190,15,1,.10); color:#be0f01; font-size:1.1rem; }
.attention-card strong { display:block; font-size:1.25rem; line-height:1; }
.attention-card span { display:block; margin-top:4px; color:var(--brand-muted); font-size:.82rem; }
.filter-bar { display:grid; grid-template-columns:minmax(220px,1fr) 180px 150px auto; gap:10px; width:min(100%,780px); }
.permission-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:14px; padding:20px; }
.permission-card { border:1px solid var(--brand-border); border-radius:12px; padding:16px; background:#fafbfc; }
.permission-card strong { display:block; color:#021826; }
.permission-card span { display:block; color:var(--brand-muted); font-size:.83rem; line-height:1.5; margin-top:5px; }
.report-filter { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; }
.report-filter > div:not(.dropdown) { min-width:175px; }
.report-list > div { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:15px 20px; border-bottom:1px solid var(--brand-border); }
.report-list > div:last-child { border-bottom:0; }
.report-list span { color:var(--brand-muted); }
.report-list strong { font-size:1.05rem; }
.table tfoot th { background:#f6f8f9; padding:14px 16px; border-top:2px solid #cfd6dc; }
@media(max-width:991.98px){ .filter-bar{grid-template-columns:1fr 1fr;} }
@media(max-width:575.98px){ .filter-bar{grid-template-columns:1fr;} .report-filter{display:grid;grid-template-columns:1fr 1fr;} .report-filter .btn,.report-filter .dropdown{width:100%;} .report-filter .dropdown .btn{width:100%;} }
