/**
 * Office portal — aligns with public Orbit theme (Sandra Associates)
 * Typography: Playfair Display (headings), Inter (body).
 */
:root {
    --orbit-red: #c41e3a;
    --orbit-red-dark: #9e1830;
    --orbit-black: #0d0d0d;
    --orbit-navy: #1a2744;
    --orbit-peach: #fde8d8;
    --orbit-muted: #5c6470;
    --orbit-font: "Inter", system-ui, sans-serif;
    --orbit-display: "Playfair Display", Georgia, "Times New Roman", serif;
    --orbit-radius: 12px;
}

.office-body {
    -webkit-tap-highlight-color: rgba(196, 30, 58, 0.15);
    font-family: var(--orbit-font);
    color: var(--orbit-black);
    background-color: #ebe6e0;
    background-image:
        radial-gradient(ellipse 120% 80% at 100% 0%, rgba(196, 30, 58, 0.09) 0%, transparent 55%),
        radial-gradient(ellipse 90% 70% at 0% 100%, rgba(26, 39, 68, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(253, 232, 216, 0.5) 0%, transparent 45%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.office-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.office-app .office-main {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
}

.office-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

/* Intrinsic width from HTML (e.g. 1024) must not win over flex/grid — min-width:0 + max-* keeps header sane */
.office-brand__img {
    display: block;
    flex-shrink: 1;
    min-width: 0;
    width: auto;
    height: auto;
    max-height: 36px;
    max-width: min(200px, 42vw);
    object-fit: contain;
    object-position: left center;
}

@media (min-width: 576px) {
    .office-brand__img {
        max-height: 40px;
        max-width: min(220px, 38vw);
    }
}

@media (min-width: 992px) {
    .office-brand__img {
        max-height: 44px;
        max-width: min(240px, 32vw);
    }
}

.office-brand__suffix {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--orbit-red);
    line-height: 1;
    padding: 0.35rem 0.55rem;
    border: 1px solid rgba(196, 30, 58, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.65);
}

.office-brand__img--login-mobile {
    width: auto;
    height: auto;
    max-height: 48px;
    max-width: min(220px, 88vw);
    object-fit: contain;
}

.office-login-mobile-brand {
    max-width: 100%;
}

.office-login-brand__logo {
    display: inline-block;
    max-width: 100%;
    vertical-align: top;
    padding: 0.55rem 0.9rem;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.office-brand__img--login-panel {
    display: block;
    width: auto;
    height: auto;
    max-height: 52px;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
}

.office-heading {
    font-family: var(--orbit-display);
    font-weight: 600;
    color: var(--orbit-navy);
}

.office-sidebar {
    min-height: calc(100vh - 73px);
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(12px);
}

@media (max-width: 991.98px) {
    .office-sidebar {
        min-height: auto;
        border-end: none !important;
        border-bottom: 1px solid rgba(13, 13, 13, 0.08);
    }

    .office-sidebar .nav.flex-column {
        flex-direction: row !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        gap: 0.15rem;
        padding-bottom: 0.35rem;
        margin-bottom: 0.15rem;
    }

    .office-sidebar .nav.flex-column .office-nav-link {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 0.55rem 0.85rem;
    }

    .office-sidebar .office-sidebar-divider {
        display: none;
    }

    .office-header .btn-sm {
        min-height: 2.5rem;
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }
}

@media (display-mode: standalone) {
    .office-header {
        padding-top: max(0.5rem, env(safe-area-inset-top));
    }

    .office-app .office-main {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

.office-nav-link {
    border-radius: 8px;
    color: var(--orbit-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.office-nav-link:hover,
.office-nav-link:focus {
    background: rgba(196, 30, 58, 0.08);
    color: var(--orbit-red);
}

.office-sidebar-divider {
    border: 0;
    border-top: 1px solid rgba(13, 13, 13, 0.08);
    opacity: 1;
}

/* ——— Guest / login ——— */
.office-main--guest {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 73px);
}

.office-login-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.office-login-row {
    min-height: min(560px, calc(100vh - 140px));
}

.office-login-brand {
    position: relative;
    padding: 2.5rem 2.75rem;
    border-radius: 20px;
    background: linear-gradient(145deg, var(--orbit-navy) 0%, #243352 48%, #1a2744 100%);
    color: #fff;
    overflow: hidden;
    box-shadow:
        0 24px 48px rgba(26, 39, 68, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.office-login-brand__eyebrow {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: rgba(253, 232, 216, 0.85);
}

.office-login-brand__title {
    font-family: var(--orbit-display);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
}

.office-login-brand__lead {
    font-size: 0.95rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.78);
    max-width: 28rem;
}

.office-login-brand__list li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 0.85rem;
    line-height: 1.45;
}

.office-login-brand__list li:last-child {
    margin-bottom: 0;
}

.office-login-brand__list i {
    flex-shrink: 0;
    margin-top: 0.15rem;
    color: var(--orbit-peach);
    font-size: 1.05rem;
}

.office-login-brand__deco {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    right: -100px;
    bottom: -100px;
    background: radial-gradient(circle, rgba(196, 30, 58, 0.35) 0%, transparent 70%);
    pointer-events: none;
}

.office-login-brand__deco::before {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    left: -200px;
    top: -80px;
    background: radial-gradient(circle, rgba(253, 232, 216, 0.12) 0%, transparent 65%);
}

.office-login-card {
    border-radius: 20px;
    box-shadow:
        0 20px 50px rgba(13, 13, 13, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset !important;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
}

.office-login-card__title {
    font-family: var(--orbit-display);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--orbit-navy);
}

.office-login-card__subtitle {
    font-size: 0.95rem;
    line-height: 1.5;
}

.office-input-group .input-group-text {
    background: #f8f6f4;
    border-color: rgba(13, 13, 13, 0.1);
    border-radius: 12px 0 0 12px;
    color: var(--orbit-muted);
    padding-left: 1rem;
    padding-right: 0.75rem;
}

.office-input-group .form-control {
    border-radius: 0 12px 12px 0;
    border-left: 0;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    font-size: 1rem;
}

.office-input-group .form-control:focus {
    box-shadow: none;
    border-color: rgba(13, 13, 13, 0.1);
}

.office-input-group:focus-within .input-group-text {
    border-color: var(--orbit-red);
    background: rgba(196, 30, 58, 0.06);
    color: var(--orbit-red-dark);
}

.office-input-group:focus-within .form-control {
    border-color: var(--orbit-red);
}

.office-login-form .btn-lg {
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.office-login-footnote {
    opacity: 0.9;
}

@media (max-width: 991.98px) {
    .office-login-row {
        min-height: auto;
    }
}

.office-card {
    border-radius: var(--orbit-radius);
    overflow: hidden;
}

.office-input {
    border-radius: 10px;
    border-color: rgba(13, 13, 13, 0.12);
}

.office-input:focus {
    border-color: var(--orbit-red);
    box-shadow: 0 0 0 0.2rem rgba(196, 30, 58, 0.15);
}

.office-btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--orbit-red);
    --bs-btn-border-color: var(--orbit-red);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--orbit-red-dark);
    --bs-btn-hover-border-color: var(--orbit-red-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--orbit-red-dark);
    --bs-btn-active-border-color: var(--orbit-red-dark);
    --bs-btn-disabled-color: rgba(255, 255, 255, 0.65);
    --bs-btn-disabled-bg: var(--orbit-red);
    --bs-btn-disabled-border-color: var(--orbit-red);
    font-weight: 700;
    border-radius: 10px;
    padding: 0.55rem 1.25rem;
}

/* Icon-only actions (e.g. customer cards) — keep tap targets comfortable */
.office-btn-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    min-width: 2.375rem;
}

.office-btn-icon-only.btn-sm {
    padding: 0.35rem;
    min-width: 2rem;
}

.office-stat {
    border-radius: var(--orbit-radius);
    background: linear-gradient(145deg, #fff 0%, #fff6f3 100%);
}

.office-stat__num {
    font-family: var(--orbit-display);
    color: var(--orbit-navy);
}

.office-table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--orbit-muted);
    font-weight: 700;
}

.office-badge-role {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--orbit-peach);
    color: var(--orbit-red-dark);
}

.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    color: var(--orbit-navy);
}

.pagination .page-item.active .page-link {
    background: var(--orbit-red);
    border-color: var(--orbit-red);
    color: #fff;
}

/* ——— Customer cards ——— */
.office-customer-card {
    position: relative;
    border: 1px solid rgba(26, 39, 68, 0.08) !important;
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 252, 250, 0.94) 45%, rgba(253, 232, 216, 0.22) 100%);
    box-shadow:
        0 4px 20px rgba(26, 39, 68, 0.07),
        0 0 0 1px rgba(255, 255, 255, 0.75) inset !important;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease;
    overflow: hidden;
}

.office-customer-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 16px 40px rgba(26, 39, 68, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.85) inset !important;
}

.office-customer-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--orbit-navy) 0%, var(--orbit-red) 55%, rgba(196, 30, 58, 0.65) 100%);
    opacity: 0.95;
}

.office-customer-card .card-body {
    position: relative;
    padding: 1.35rem 1.35rem 1.25rem;
}

.office-customer-card__head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.office-customer-card__avatar {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--orbit-display);
    font-size: 1.35rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(145deg, var(--orbit-navy) 0%, #2d3f5c 100%);
    box-shadow:
        0 6px 16px rgba(26, 39, 68, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.office-customer-card--inactive .office-customer-card__avatar {
    background: linear-gradient(145deg, #8a9099 0%, #6b7280 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.office-customer-card__title {
    font-family: var(--orbit-display);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--orbit-navy);
    margin: 0 0 0.35rem;
    word-break: break-word;
}

.office-customer-card__status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
}

.office-customer-card__status--active {
    background: rgba(25, 135, 84, 0.12);
    color: #146c43;
}

.office-customer-card__status--inactive {
    background: rgba(108, 117, 125, 0.14);
    color: #495057;
}

.office-customer-card__contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(26, 39, 68, 0.06);
}

.office-customer-card__contact-row {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--orbit-black);
}

.office-customer-card__contact-row i {
    flex-shrink: 0;
    margin-top: 0.12rem;
    font-size: 0.95rem;
    color: var(--orbit-red);
    opacity: 0.85;
}

.office-customer-card__contact-row a {
    color: inherit;
    text-decoration: none;
}

.office-customer-card__contact-row a:hover {
    color: var(--orbit-red);
}

.office-customer-card__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.office-customer-card__toolbar .btn {
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.8125rem;
}

.office-customer-card__section-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--orbit-muted);
    margin: 0 0 0.65rem;
}

.office-customer-card__invoices {
    padding: 0.75rem 0.85rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(26, 39, 68, 0.04) 0%, rgba(196, 30, 58, 0.04) 100%);
    border: 1px solid rgba(26, 39, 68, 0.06);
    flex: 1 1 auto;
    min-height: 0;
}

.office-customer-card__invoice {
    display: block;
    padding: 0.55rem 0.65rem;
    margin-bottom: 0.45rem;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(26, 39, 68, 0.05);
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.office-customer-card__invoice[data-office-customer-card-invoice-view] {
    cursor: pointer;
}

.office-customer-card__invoice:last-child {
    margin-bottom: 0;
}

.office-customer-card__invoice:hover {
    background: #fff;
    border-color: rgba(196, 30, 58, 0.22);
    transform: translateX(2px);
}

.office-customer-card__invoice-num {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--orbit-navy);
}

.office-customer-card__invoice:hover .office-customer-card__invoice-num {
    color: var(--orbit-red-dark);
}

.office-customer-card__invoice-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: var(--orbit-muted);
}

.office-customer-card__invoice-amt {
    font-family: ui-monospace, monospace;
    font-weight: 600;
    color: var(--orbit-black);
}

.office-customer-card__empty {
    font-size: 0.8125rem;
    color: var(--orbit-muted);
    margin: 0;
    font-style: italic;
}

.office-customer-card__cta {
    display: grid;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.15rem;
}

.office-customer-card__cta .btn {
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.8125rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.office-customer-card__cta .btn-outline-dark {
    border-color: rgba(26, 39, 68, 0.2);
    color: var(--orbit-navy);
}

.office-customer-card__cta .btn-outline-dark:hover {
    background: var(--orbit-navy);
    border-color: var(--orbit-navy);
    color: #fff;
}

/* Customers index — empty state */
.office-customers-empty {
    border-radius: var(--orbit-radius);
    border: 1px dashed rgba(26, 39, 68, 0.15) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(253, 232, 216, 0.2) 100%);
    box-shadow: 0 4px 24px rgba(26, 39, 68, 0.06) !important;
}

.office-customers-empty__icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
    color: var(--orbit-red);
    background: rgba(196, 30, 58, 0.1);
}

@media (prefers-reduced-motion: reduce) {
    .office-customer-card,
    .office-customer-card__invoice {
        transition: none;
    }

    .office-customer-card:hover {
        transform: none;
    }

    .office-customer-card__invoice:hover {
        transform: none;
    }
}

.office-customer-card--open-detail {
    cursor: pointer;
}

.office-customer-card--open-detail .office-customer-card__toolbar .btn,
.office-customer-card--open-detail .office-customer-card__toolbar form,
.office-customer-card--open-detail .office-customer-card__cta .btn {
    cursor: pointer;
}

/* ——— Customer detail modal (carousel) ——— */
.office-customer-detail-modal {
    max-width: min(96vw, 68rem);
}

.office-customer-detail-modal__content {
    border-radius: var(--orbit-radius);
    overflow: hidden;
    background: linear-gradient(180deg, #fff 0%, rgba(253, 248, 245, 0.98) 100%);
}

.office-customer-detail-modal__header {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 1.25rem;
}

.office-customer-detail-modal__body {
    position: relative;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    padding-bottom: 1.5rem;
}

/* Full-body overlay while a carousel slide is loading via XHR (stay on current slide until success). */
.office-customer-modal-ajax-pending {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(2px);
    border-radius: 0 0 var(--bs-modal-inner-border-radius, 0.5rem) var(--bs-modal-inner-border-radius, 0.5rem);
    pointer-events: all;
}

.office-customer-modal__carousel {
    position: relative;
}

.office-customer-modal__slide-inner {
    min-height: 18rem;
}

.office-customer-modal__slide-inner--edit {
    min-height: 16rem;
}

.office-customer-modal__edit-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(26, 39, 68, 0.1);
}

.office-customer-modal__edit-back {
    border-radius: 10px;
    font-weight: 600;
}

.office-customer-modal__edit-topbar-label {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.office-customer-modal__edit-body {
    max-height: min(70vh, 42rem);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.office-customer-modal__slide-inner--invoice {
    min-height: 16rem;
}

/* Invoice panel: side controls like Bootstrap carousel; hidden until edge-hover (desktop) or swipe (touch). */
.office-customer-modal__invoice-body-wrap {
    position: relative;
    touch-action: pan-y;
}

.office-customer-modal__invoice-body-wrap .office-customer-modal__invoice-carousel-btn:not(.d-none) {
    z-index: 2;
    top: 50%;
    bottom: auto;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    max-width: 2.75rem;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.96);
    background-image: none;
    border: 1px solid rgba(26, 39, 68, 0.2);
    box-shadow:
        0 1px 2px rgba(26, 39, 68, 0.06),
        0 4px 14px rgba(26, 39, 68, 0.1);
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.office-customer-modal__invoice-body-wrap .office-customer-modal__invoice-carousel-btn.carousel-control-prev:not(.d-none) {
    left: 0.5rem;
    right: auto;
}

.office-customer-modal__invoice-body-wrap .office-customer-modal__invoice-carousel-btn.carousel-control-next:not(.d-none) {
    right: 0.5rem;
    left: auto;
}

.office-customer-modal__invoice-body-wrap--edge-left .office-customer-modal__invoice-carousel-btn.carousel-control-prev:not(.d-none):hover,
.office-customer-modal__invoice-body-wrap--edge-right .office-customer-modal__invoice-carousel-btn.carousel-control-next:not(.d-none):hover {
    background-color: #fff;
    border-color: rgba(196, 30, 58, 0.35);
    box-shadow:
        0 2px 4px rgba(26, 39, 68, 0.08),
        0 6px 18px rgba(196, 30, 58, 0.12);
}

/* Edge reveal: not behind (hover:hover) media query — many desktops report hover:none with touch-capable hardware. */
.office-customer-modal__invoice-body-wrap--edge-left .office-customer-modal__invoice-carousel-btn.carousel-control-prev:not(.d-none),
.office-customer-modal__invoice-body-wrap--edge-right .office-customer-modal__invoice-carousel-btn.carousel-control-next:not(.d-none) {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.office-customer-modal__invoice-body-wrap .office-customer-modal__invoice-carousel-btn:not(.d-none):focus-visible {
    opacity: 1;
    pointer-events: auto;
    background-color: #fff;
    border-color: rgba(196, 30, 58, 0.4);
    outline: 2px solid rgba(196, 30, 58, 0.45);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .office-customer-modal__invoice-body-wrap .office-customer-modal__invoice-carousel-btn:not(.d-none) {
        transition: none;
    }
}

/* Dark chevrons on light modal (BS carousel icons are white-tinted for dark backgrounds). */
.office-customer-modal__invoice-body-wrap .carousel-control-prev-icon,
.office-customer-modal__invoice-body-wrap .carousel-control-next-icon {
    filter: invert(0.35) grayscale(1);
    width: 1.35rem;
    height: 1.35rem;
}

.office-customer-modal__invoice-body-wrap .office-customer-modal__invoice-carousel-btn:hover .carousel-control-prev-icon,
.office-customer-modal__invoice-body-wrap .office-customer-modal__invoice-carousel-btn:hover .carousel-control-next-icon,
.office-customer-modal__invoice-body-wrap .office-customer-modal__invoice-carousel-btn:focus .carousel-control-prev-icon,
.office-customer-modal__invoice-body-wrap .office-customer-modal__invoice-carousel-btn:focus .carousel-control-next-icon {
    filter: invert(0.2) grayscale(1);
}

.office-customer-modal__invoice-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(26, 39, 68, 0.1);
}

.office-customer-modal__invoice-back {
    border-radius: 10px;
    font-weight: 600;
}

.office-customer-modal__invoice-body {
    position: relative;
    z-index: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    max-height: min(72vh, 44rem);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.office-customer-modal__slide-inner--services {
    min-height: 16rem;
}

.office-customer-modal__services-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(26, 39, 68, 0.1);
}

.office-customer-modal__services-back {
    border-radius: 10px;
    font-weight: 600;
}

.office-customer-modal__services-body {
    max-height: min(70vh, 42rem);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.office-customer-modal__invoice-block:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.office-customer-modal__invoice-block--cancelled {
    opacity: 0.88;
}

.office-customer-card__invoice--cancelled {
    opacity: 0.88;
}

.office-customer-card__invoice--cancelled .office-customer-card__invoice-amt {
    text-decoration: line-through;
}

.office-customer-modal__hero {
    position: relative;
    border-radius: calc(var(--orbit-radius) - 2px);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.office-customer-modal__hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        125deg,
        var(--orbit-navy) 0%,
        #243352 42%,
        rgba(196, 30, 58, 0.88) 100%
    );
}

.office-customer-modal__hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.12) 0%, transparent 45%);
    pointer-events: none;
}

.office-customer-modal__hero-content {
    position: relative;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.5rem 1.35rem 1.65rem;
    color: #fff;
}

.office-customer-modal__avatar {
    flex-shrink: 0;
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--orbit-display);
    font-size: 1.65rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.office-customer-modal__name {
    color: #fff;
    font-size: 1.35rem;
}

.office-customer-modal__pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.office-customer-modal__pill--ok {
    color: #c8f5dc;
}

.office-customer-modal__pill--off {
    color: #fde8d8;
}

.office-customer-modal__hero-contact {
    font-size: 0.9rem;
}

.office-customer-modal__hero-line {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.office-customer-modal__hero-line i {
    margin-top: 0.15rem;
    opacity: 0.85;
}

.office-customer-modal__hero-line a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.office-customer-modal__hero-line a:hover {
    color: var(--orbit-peach);
}

.office-customer-modal__hero-line--multiline span {
    white-space: pre-wrap;
    line-height: 1.45;
}

.office-customer-modal__grid {
    margin-bottom: 0.25rem;
}

.office-customer-modal__panel {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(26, 39, 68, 0.08);
    border-radius: var(--orbit-radius);
    padding: 1rem 1.1rem 1.15rem;
    box-shadow: 0 4px 20px rgba(26, 39, 68, 0.05);
}

.office-customer-modal__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(26, 39, 68, 0.08);
}

.office-customer-modal__panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    font-family: var(--orbit-font);
}

.office-customer-modal__invoice-list li + li {
    margin-top: 0.35rem;
}

.office-customer-modal__invoice-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.office-customer-modal__invoice-row:hover {
    background: rgba(196, 30, 58, 0.06);
    border-color: rgba(196, 30, 58, 0.12);
    color: inherit;
}

.office-customer-modal__invoice-no {
    font-weight: 600;
    font-size: 0.9rem;
}

.office-customer-modal__invoice-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
}

.office-customer-modal__invoice-amt {
    font-weight: 600;
    color: var(--orbit-navy);
    font-variant-numeric: tabular-nums;
}

.office-customer-modal__svc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.55rem 0.5rem;
    border-radius: 10px;
    border: 1px solid rgba(26, 39, 68, 0.06);
    background: rgba(253, 248, 245, 0.6);
}

.office-customer-modal__svc-row + .office-customer-modal__svc-row {
    margin-top: 0.45rem;
}

.office-customer-modal__svc-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.office-customer-modal__svc-name {
    font-weight: 600;
    font-size: 0.88rem;
}

.office-customer-modal__svc-amt {
    font-size: 0.82rem;
    color: var(--orbit-muted);
}

.office-customer-modal__svc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.office-customer-modal__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.35rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(26, 39, 68, 0.08);
}

/* ——— Customer / service form offcanvas ——— */
.office-customer-offcanvas {
    --bs-offcanvas-width: min(100vw - 0.5rem, 40rem);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(253, 248, 245, 0.98) 100%);
    box-shadow: -12px 0 40px rgba(26, 39, 68, 0.12);
}

.office-customer-charges-offcanvas {
    --bs-offcanvas-width: min(100vw - 0.5rem, 40rem);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(253, 248, 245, 0.98) 100%);
    box-shadow: -12px 0 40px rgba(26, 39, 68, 0.12);
}

.office-customer-charges-offcanvas .offcanvas-header {
    background: rgba(255, 255, 255, 0.85);
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.office-customer-charges-offcanvas__body {
    overflow-y: auto;
}

.office-service-offcanvas {
    --bs-offcanvas-width: min(100vw - 0.5rem, 28rem);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(253, 248, 245, 0.98) 100%);
    box-shadow: -12px 0 40px rgba(26, 39, 68, 0.12);
}

.office-customer-offcanvas .offcanvas-header,
.office-service-offcanvas .offcanvas-header {
    background: rgba(255, 255, 255, 0.85);
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.office-customer-offcanvas__body,
.office-service-offcanvas__body {
    overflow-y: auto;
}

.office-nav-group {
    margin-bottom: 0.15rem;
}

.office-nav-link--sub {
    font-size: 0.82rem;
    padding-top: 0.35rem !important;
    padding-bottom: 0.35rem !important;
    padding-left: 2rem !important;
    color: var(--orbit-muted);
    font-weight: 600;
}

.office-nav-link--sub:hover,
.office-nav-link--sub:focus {
    background: rgba(196, 30, 58, 0.08);
    color: var(--orbit-red);
}

/* ——— Customer edit: service charge cards ——— */
.office-service-profile-embed--charges-panel {
    margin-top: 0;
    padding-top: 0;
}

.office-service-profile-embed__toolbar--solo {
    padding-bottom: 0.65rem;
    border-bottom: none;
}

.office-service-profile-embed__loader {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.office-service-profile-embed__toolbar {
    padding-bottom: 0.35rem;
    border-bottom: none;
}

.office-service-profile-embed__save-col {
    flex-shrink: 0;
    min-width: min(100%, 14rem);
}

.office-service-profile-embed__save-btn {
    font-size: 0.95rem;
    padding: 0.6rem 1.1rem;
    border-radius: 12px;
}

.office-service-profile-embed__search {
    border-color: rgba(26, 39, 68, 0.1) !important;
}

.office-service-profile-embed__search .form-control {
    border-radius: 12px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
}

.office-service-profile-embed__section-title {
    font-family: var(--orbit-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--orbit-navy);
    margin: 0 0 1rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid rgba(196, 30, 58, 0.2);
}

.office-cust-svc-col {
    min-width: 0;
}

.office-cust-svc-card {
    border-radius: 16px;
    border: 1px solid rgba(26, 39, 68, 0.1);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 252, 249, 0.96) 55%, rgba(253, 232, 216, 0.12) 100%);
    box-shadow:
        0 8px 28px rgba(26, 39, 68, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.7) inset;
    padding: 1.2rem 1.25rem 1.35rem;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.office-cust-svc-col[data-has-charge="1"] .office-cust-svc-card {
    border-color: rgba(196, 30, 58, 0.28);
    box-shadow:
        0 10px 32px rgba(26, 39, 68, 0.1),
        0 0 0 1px rgba(196, 30, 58, 0.1) inset;
}

.office-cust-svc-card:hover {
    border-color: rgba(26, 39, 68, 0.16);
    box-shadow:
        0 12px 36px rgba(26, 39, 68, 0.11),
        0 0 0 1px rgba(255, 255, 255, 0.85) inset;
}

.office-cust-svc-card__head {
    margin-bottom: 1rem;
}

.office-cust-svc-card__period {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--orbit-red-dark);
    background: rgba(196, 30, 58, 0.1);
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    margin-bottom: 0.5rem;
}

.office-cust-svc-card__name {
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    color: var(--orbit-navy);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.office-cust-svc-card__field {
    margin-top: auto;
}

.office-cust-svc-card__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--orbit-muted);
    margin-bottom: 0.45rem;
}

.office-cust-svc-card__input-group {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(26, 39, 68, 0.06);
}

.office-cust-svc-card__input-group .input-group-text,
.office-cust-svc-card__input-group .form-control {
    border-color: rgba(26, 39, 68, 0.12);
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    font-size: 1.1rem;
}

.office-cust-svc-card__rupee {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--orbit-navy);
    background: rgba(26, 39, 68, 0.06) !important;
    min-width: 3rem;
    justify-content: center;
}

.office-cust-svc-card__input:focus {
    border-color: var(--orbit-red);
    box-shadow: none;
}

.office-cust-svc-card__input-group:focus-within .office-cust-svc-card__rupee {
    border-color: var(--orbit-red);
    background: rgba(196, 30, 58, 0.08) !important;
    color: var(--orbit-red-dark);
}

@media (max-width: 575.98px) {
    .office-cust-svc-card__name {
        font-size: 1rem;
    }

    .office-cust-svc-card__input-group .form-control {
        font-size: 1rem;
    }
}

/* Customer card: billed services badge + popover */
.office-cust-svc-badge {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: default;
    padding: 0.4rem 0.65rem;
    border: 1px solid transparent;
}

.office-cust-svc-badge--on {
    color: var(--orbit-navy);
    background: rgba(253, 232, 216, 0.85);
    border-color: rgba(196, 30, 58, 0.2);
}

.office-cust-svc-badge--empty {
    color: var(--orbit-muted);
    background: rgba(26, 39, 68, 0.06);
    border-color: rgba(26, 39, 68, 0.08);
}

.popover.office-cust-svc-popover {
    max-width: min(22rem, 92vw);
    border-radius: 14px;
    border: 1px solid rgba(26, 39, 68, 0.1);
    box-shadow: 0 12px 36px rgba(26, 39, 68, 0.15);
}

.popover.office-cust-svc-popover .popover-header {
    font-family: var(--orbit-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--orbit-navy);
    background: rgba(253, 232, 216, 0.35);
    border-bottom-color: rgba(26, 39, 68, 0.08);
}

.popover.office-cust-svc-popover .popover-body {
    padding: 0.75rem 0.85rem;
}

.office-cust-svc-popover__body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.office-cust-svc-popover__row {
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(26, 39, 68, 0.06);
}

.office-cust-svc-popover__row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.office-cust-svc-charges-btn[data-bs-toggle='popover'],
.office-cust-svc-inactive-note[data-bs-toggle='popover'] {
    cursor: help;
}

/* —— Invoices index —— */
.office-invoices-filters .form-label {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.office-invoices-empty__icon {
    font-size: 2.75rem;
    line-height: 1;
    opacity: 0.35;
}

.office-invoices-accordion__item {
    border-radius: var(--orbit-radius, 12px) !important;
    overflow: hidden;
}

.office-invoices-accordion__btn {
    font-weight: 600;
    color: var(--orbit-navy);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(253, 232, 216, 0.35) 100%);
    box-shadow: none !important;
}

.office-invoices-accordion__btn:not(.collapsed) {
    background: #fff;
    border-bottom: 1px solid rgba(26, 39, 68, 0.08);
}

.office-invoices-accordion__title {
    font-family: var(--orbit-display);
    font-size: 1rem;
}

.office-invoices-table thead th {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.68rem;
}

.office-invoices-table__row--cancelled {
    opacity: 0.82;
}
