/* Shared admin custom styles */

/* Global admin page preloader */
.admin-page-preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

[data-bs-theme="dark"] .admin-page-preloader {
    background-color: rgba(37, 41, 60, 0.98);
}

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

.admin-page-preloader__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.15rem;
    width: min(100%, 22rem);
    padding: 2rem 1.75rem 1.85rem;
    text-align: center;
    border-radius: 1rem;
    background-color: var(--bs-paper-bg, #fff);
    border: 1px solid rgba(var(--bs-primary-rgb, 115, 103, 240), 0.12);
    box-shadow:
        0 0.25rem 1.5rem rgba(47, 43, 61, 0.08),
        0 0 0 1px rgba(47, 43, 61, 0.03);
    transform: translateY(8px) scale(0.98);
    opacity: 0;
    transition: transform 0.32s ease, opacity 0.32s ease;
}

.admin-page-preloader.is-visible .admin-page-preloader__card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

[data-bs-theme="dark"] .admin-page-preloader__card {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 0.5rem 2rem rgba(15, 17, 26, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.04);
}

.admin-page-preloader__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.admin-page-preloader__logo {
    display: inline-flex;
    line-height: 0;
}

.admin-page-preloader__brand-text {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--bs-heading-color, #2f2b3d);
}

[data-bs-theme="dark"] .admin-page-preloader__brand-text {
    color: var(--bs-heading-color, #e6e6f0);
}

.admin-page-preloader__spinner {
    position: relative;
    width: 3.5rem;
    height: 3.5rem;
}

.admin-page-preloader__spinner-ring,
.admin-page-preloader__spinner-core {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.admin-page-preloader__spinner-ring {
    border: 3px solid rgba(var(--bs-primary-rgb, 115, 103, 240), 0.14);
    border-top-color: var(--bs-primary, #7367f0);
    border-right-color: color-mix(in srgb, var(--bs-primary, #7367f0) 55%, transparent);
    animation: admin-page-preloader-spin 0.85s linear infinite;
}

.admin-page-preloader__spinner-core {
    inset: 0.55rem;
    background: radial-gradient(
        circle,
        rgba(var(--bs-primary-rgb, 115, 103, 240), 0.2) 0%,
        rgba(var(--bs-primary-rgb, 115, 103, 240), 0.05) 55%,
        transparent 72%
    );
    animation: admin-page-preloader-pulse 1.4s ease-in-out infinite;
}

.admin-page-preloader__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-heading-color, #2f2b3d);
}

.admin-page-preloader__subtitle {
    font-size: 0.82rem;
    color: var(--bs-secondary-color, #82808b);
    line-height: 1.45;
    max-width: 16rem;
}

.admin-page-preloader__dots {
    display: inline-flex;
    gap: 0.1rem;
    margin-left: 0.1rem;
}

.admin-page-preloader__dots span {
    display: inline-block;
    width: 0.28rem;
    height: 0.28rem;
    border-radius: 50%;
    background-color: var(--bs-primary, #7367f0);
    opacity: 0.25;
    animation: admin-page-preloader-dot 1s ease-in-out infinite;
}

.admin-page-preloader__dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.admin-page-preloader__dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes admin-page-preloader-dot {
    0%,
    80%,
    100% {
        opacity: 0.25;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

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

@keyframes admin-page-preloader-pulse {
    0%,
    100% {
        transform: scale(0.92);
        opacity: 0.65;
    }

    50% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-page-preloader,
    .admin-page-preloader__card,
    .admin-page-preloader__spinner-ring,
    .admin-page-preloader__spinner-core,
    .admin-page-preloader__dots span {
        animation: none !important;
        transition: none !important;
    }

    .admin-page-preloader__card {
        transform: none;
        opacity: 1;
    }
}

/* Admin list search (js-admin-search-* in custom_script.js) */
.js-admin-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.js-admin-search-input::-ms-clear {
    display: none;
}
.admin-search-field {
    min-width: min(100%, 280px);
}

.admin-search-field .js-admin-search-clear {
    z-index: 3;
}

/* Admin dd-mm-yyyy date fields (.js-date-ddmmyyyy) */
.admin-date-input-wrap {
    display: block;
    position: relative;
}

.admin-date-input-wrap .form-control {
    padding-right: 2.75rem;
}

.admin-date-input-toggle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--bs-secondary-color);
    line-height: 1;
    cursor: pointer;
}

.admin-date-input-toggle .icon-base {
    display: block;
    font-size: 1.125rem;
    line-height: 1;
}

.admin-date-input-toggle:hover,
.admin-date-input-toggle:focus {
    color: var(--bs-primary);
    outline: none;
    box-shadow: none;
}

.admin-date-input-wrap .flatpickr-calendar {
    z-index: 1080;
}

.flatpickr-calendar {
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.12);
    border-radius: 0.5rem;
}

.flatpickr-day.today {
    border-color: var(--bs-primary);
    font-weight: 600;
}

.flatpickr-day.today:not(.selected) {
    background: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
}

.flatpickr-day:not(.flatpickr-disabled):not(.selected):hover {
    background: rgba(var(--bs-primary-rgb), 0.08);
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    opacity: 0.45;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    font-weight: 600;
}

/* Admin list toolbar — keep search, actions, per-page on one row */
.admin-list-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.75rem;
    margin-left: auto;
    min-width: 0;
    max-width: 100%;
}

.admin-list-toolbar .admin-search-field {
    flex: 1 1 200px;
    min-width: 200px;
    max-width: 280px;
}

.admin-list-toolbar__controls {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.75rem;
    flex-shrink: 0;
}

.admin-list-toolbar__end {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

.admin-list-per-page-select {
    width: 5.2rem;
    min-width: 5.2rem;
    flex-shrink: 0;
}

.admin-list-toolbar__filter-select {
    width: auto;
    min-width: 11rem;
    flex-shrink: 0;
}

.admin-list-toolbar__date {
    width: auto;
    min-width: 9.5rem;
    flex-shrink: 0;
}

.admin-list-toolbar--wide {
    overflow-x: auto;
    padding-bottom: 0.15rem;
}

.admin-list-toolbar--wide .admin-list-toolbar__controls {
    flex-wrap: nowrap;
}

@media (max-width: 1199.98px) {
    .admin-list-toolbar {
        flex-wrap: wrap;
        width: 100%;
        margin-left: 0;
    }

    .admin-list-toolbar__controls {
        flex-wrap: wrap;
    }
}

.admin-list-pagination {
    border-top: 1px solid rgba(47, 43, 61, 0.08);
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.js-admin-search-table-shell {
    position: relative;
}

.admin-search-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 6;
    height: 4px;
    overflow: hidden;
    background-color: rgba(var(--bs-primary-rgb, 115, 103, 240), 0.12);
    border-radius: 4px 4px 0 0;
    pointer-events: none;
}

.admin-search-progress__track {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.admin-search-progress__bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 38%;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(
        90deg,
        rgba(var(--bs-primary-rgb, 115, 103, 240), 0.35),
        var(--bs-primary, #7367f0) 55%,
        rgba(var(--bs-primary-rgb, 115, 103, 240), 0.85)
    );
    animation: admin-search-progress-slide 1.15s ease-in-out infinite;
}

.js-admin-search-table-shell.is-loading .js-admin-search-table-body {
    opacity: 0.72;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

@keyframes admin-search-progress-slide {
    0% {
        transform: translateX(-110%);
    }

    100% {
        transform: translateX(320%);
    }
}

.js-admin-search-table-shell.is-loading .js-admin-search-skeleton,
.js-admin-search-table-shell.is-loading .js-admin-search-progress.d-none {
    display: none !important;
}

.customer-sort-link {
    transition: color 0.2s ease;
}

.customer-sort-link:hover .customer-sort-icon {
    color: #7367f0 !important;
}

.customer-sort-icon {
    font-size: 0.95rem;
}

.customers-index-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.customers-index-table {
    width: 100%;
    min-width: 72rem;
    border-collapse: separate;
    border-spacing: 0;
    --customers-sticky-bg: #fff;
    --customers-sticky-hover-bg: #f3f2f7;
    --customers-sticky-shadow-left: 6px 0 10px -8px rgba(15, 23, 42, 0.18);
    --customers-sticky-shadow-right: -8px 0 12px -10px rgba(15, 23, 42, 0.28);
}

[data-bs-theme="dark"] .customers-index-table {
    --customers-sticky-bg: #2f3349;
    --customers-sticky-hover-bg: #363a52;
}

.customers-index-table thead th {
    background-color: var(--customers-sticky-bg);
}

.customers-index-table__check {
    width: 2.75rem;
    min-width: 2.75rem;
    max-width: 2.75rem;
    padding-right: 0.25rem;
    position: sticky;
    left: 0;
    z-index: 5;
    background-color: var(--customers-sticky-bg) !important;
    box-shadow: inset 0 0 0 9999px var(--customers-sticky-bg), var(--customers-sticky-shadow-left);
}

.customers-index-table__name {
    min-width: 14rem;
    max-width: 18rem;
    position: sticky;
    left: 2.75rem;
    z-index: 6;
    background-color: var(--customers-sticky-bg) !important;
    box-shadow: inset 0 0 0 9999px var(--customers-sticky-bg), var(--customers-sticky-shadow-left);
}

.customers-index-table__name > .d-flex > div:last-child {
    min-width: 0;
    overflow: hidden;
}

.customers-index-table__name .fw-semibold,
.customers-index-table__name .small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customers-index-table thead .customers-index-table__check {
    z-index: 7;
}

.customers-index-table thead .customers-index-table__name {
    z-index: 8;
}

.customers-index-table__actions {
    width: 14rem;
    min-width: 14rem;
    position: sticky;
    right: 0;
    z-index: 5;
    background-color: var(--customers-sticky-bg) !important;
    box-shadow: inset 0 0 0 9999px var(--customers-sticky-bg), var(--customers-sticky-shadow-right);
}

.customers-index-table thead .customers-index-table__actions {
    z-index: 7;
}

.customers-index-table__action-group {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

.customers-index-table__action-group .btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.customers-index-table.table-hover > tbody > tr:hover > .customers-index-table__check,
.customers-index-table.table-hover > tbody > tr:hover > .customers-index-table__name {
    background-color: var(--customers-sticky-hover-bg) !important;
    box-shadow: inset 0 0 0 9999px var(--customers-sticky-hover-bg), var(--customers-sticky-shadow-left);
}

.customers-index-table.table-hover > tbody > tr:hover > .customers-index-table__actions {
    background-color: var(--customers-sticky-hover-bg) !important;
    box-shadow: inset 0 0 0 9999px var(--customers-sticky-hover-bg), var(--customers-sticky-shadow-right);
}

.service-clients-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.service-clients-table {
    width: 100%;
    min-width: 64rem;
    border-collapse: separate;
    border-spacing: 0;
    --service-clients-sticky-bg: #fff;
    --service-clients-sticky-hover-bg: #f3f2f7;
    --service-clients-sticky-shadow-left: 6px 0 10px -8px rgba(15, 23, 42, 0.18);
    --service-clients-sticky-shadow-right: -8px 0 12px -10px rgba(15, 23, 42, 0.28);
}

[data-bs-theme="dark"] .service-clients-table {
    --service-clients-sticky-bg: #2f3349;
    --service-clients-sticky-hover-bg: #363a52;
}

.service-clients-table thead th {
    background-color: var(--service-clients-sticky-bg);
}

.service-clients-table__family-head {
    min-width: 14rem;
    max-width: 18rem;
    position: sticky;
    left: 0;
    z-index: 6;
    background-color: var(--service-clients-sticky-bg) !important;
    box-shadow: inset 0 0 0 9999px var(--service-clients-sticky-bg), var(--service-clients-sticky-shadow-left);
}

.service-clients-table thead .service-clients-table__family-head {
    z-index: 8;
}

.service-clients-table__family-head .fw-semibold,
.service-clients-table__family-head .small {
    display: block;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-clients-table__actions {
    width: 7rem;
    min-width: 7rem;
    position: sticky;
    right: 0;
    z-index: 5;
    background-color: var(--service-clients-sticky-bg) !important;
    box-shadow: inset 0 0 0 9999px var(--service-clients-sticky-bg), var(--service-clients-sticky-shadow-right);
}

.service-clients-table thead .service-clients-table__actions {
    z-index: 7;
}

.service-clients-table.table-hover > tbody > tr:hover > .service-clients-table__family-head {
    background-color: var(--service-clients-sticky-hover-bg) !important;
    box-shadow: inset 0 0 0 9999px var(--service-clients-sticky-hover-bg), var(--service-clients-sticky-shadow-left);
}

.service-clients-table.table-hover > tbody > tr:hover > .service-clients-table__actions {
    background-color: var(--service-clients-sticky-hover-bg) !important;
    box-shadow: inset 0 0 0 9999px var(--service-clients-sticky-hover-bg), var(--service-clients-sticky-shadow-right);
}

.service-documentation-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.service-documentation-table {
    width: 100%;
    min-width: 72rem;
    border-collapse: separate;
    border-spacing: 0;
    --service-documentation-sticky-bg: #fff;
    --service-documentation-sticky-hover-bg: #f3f2f7;
    --service-documentation-sticky-shadow-left: 6px 0 10px -8px rgba(15, 23, 42, 0.18);
    --service-documentation-sticky-shadow-right: -8px 0 12px -10px rgba(15, 23, 42, 0.28);
}

[data-bs-theme="dark"] .service-documentation-table {
    --service-documentation-sticky-bg: #2f3349;
    --service-documentation-sticky-hover-bg: #363a52;
}

.service-documentation-table thead th {
    background-color: var(--service-documentation-sticky-bg);
}

.service-documentation-table__file {
    min-width: 14rem;
    max-width: 18rem;
    position: sticky;
    left: 0;
    z-index: 6;
    background-color: var(--service-documentation-sticky-bg) !important;
    box-shadow: inset 0 0 0 9999px var(--service-documentation-sticky-bg), var(--service-documentation-sticky-shadow-left);
}

.service-documentation-table thead .service-documentation-table__file {
    z-index: 8;
}

.service-documentation-table__file .service-documentation-table__file-name {
    display: block;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-documentation-table__actions {
    width: 9.5rem;
    min-width: 9.5rem;
    position: sticky;
    right: 0;
    z-index: 5;
    background-color: var(--service-documentation-sticky-bg) !important;
    box-shadow: inset 0 0 0 9999px var(--service-documentation-sticky-bg), var(--service-documentation-sticky-shadow-right);
}

.service-documentation-table thead .service-documentation-table__actions {
    z-index: 7;
}

.service-documentation-table__action-group {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

.service-documentation-table__action-group .btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.service-documentation-table.table-hover > tbody > tr:hover > .service-documentation-table__file {
    background-color: var(--service-documentation-sticky-hover-bg) !important;
    box-shadow: inset 0 0 0 9999px var(--service-documentation-sticky-hover-bg), var(--service-documentation-sticky-shadow-left);
}

.service-documentation-table.table-hover > tbody > tr:hover > .service-documentation-table__actions {
    background-color: var(--service-documentation-sticky-hover-bg) !important;
    box-shadow: inset 0 0 0 9999px var(--service-documentation-sticky-hover-bg), var(--service-documentation-sticky-shadow-right);
}

/* Scrollable filter / bulk modals (form wraps header+body+footer) */
.modal-dialog-scrollable .customer-filter-modal {
    max-height: 100%;
    overflow: hidden;
}

.modal-dialog-scrollable .customer-filter-modal > form {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 3.5rem);
    min-height: 0;
    overflow: hidden;
}

.modal-dialog-scrollable .customer-filter-modal .modal-header,
.modal-dialog-scrollable .customer-filter-modal .modal-footer {
    flex-shrink: 0;
}

.modal-dialog-scrollable .customer-filter-modal .modal-body {
    padding-top: 1.25rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 575.98px) {
    .modal-dialog-scrollable .customer-filter-modal > form {
        max-height: calc(100vh - 1rem);
    }
}

.customer-filter-modal .form-label {
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.customer-filter-modal .form-select[multiple] {
    min-height: 130px;
}

.customer-filter-modal .select2-container--default .select2-selection--multiple {
    min-height: 42px;
    border-color: #d9dee3;
    padding: 0.25rem 0.35rem;
    border-radius: 0.5rem;
}

.customer-filter-modal .select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #7367f0;
    box-shadow: 0 0 0 0.2rem rgba(115, 103, 240, 0.16);
}

.customer-filter-modal .select2-container .select2-search--inline .select2-search__field {
    margin-top: 0.25rem;
}

.customer-filter-modal .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: rgba(115, 103, 240, 0.12);
    border: 1px solid rgba(115, 103, 240, 0.25);
    color: #5f57d5;
    padding: 0.1rem 0.5rem;
}

.customer-filter-modal .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #5f57d5;
    margin-right: 0.35rem;
}

.customer-filter-modal .select2-dropdown {
    border-color: #d9dee3;
}

/* Title-case fields while typing or pasting (see assets/js/custom.js) */
input.capitalize-words,
textarea.capitalize-words {
    text-transform: none;
}

/* Client index — compact KPI row */
.client-stats-row {
    margin-bottom: 0;
}

.client-stat-card {
    border-radius: 0.75rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

.client-stat-card:hover {
    box-shadow: 0 0.25rem 1rem rgba(47, 43, 61, 0.1) !important;
}

.client-stat-card--link {
    cursor: pointer;
}

.client-stat-card .card-body {
    padding: 1rem 1.125rem;
}

.client-stat-card .avatar-sm {
    width: 2.5rem;
    height: 2.5rem;
}

.client-stat-card .avatar-sm .avatar-initial {
    font-size: 1.125rem;
}

.client-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.client-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--bs-heading-color, #2f2b3d);
    word-break: break-word;
}

.client-stat-value--money {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0.3rem;
    min-width: 0;
}

.client-stat-currency {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--bs-secondary-color, #6d6b77);
}

.client-stat-amount {
    min-width: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-stat-meta {
    font-size: 0.6875rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media (max-width: 575.98px) {
    .client-stat-card .card-body {
        padding: 0.75rem 0.875rem;
    }

    .client-stat-value,
    .client-stat-amount {
        font-size: 1.05rem;
    }
}

/* Activity timeline (service detail, client profile, leads) */
.timeline {
    position: relative;
    padding-left: 0;
    list-style: none;
}

.timeline-item {
    position: relative;
    padding-left: 2.75rem;
}

/* .timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 0.9375rem;
    top: 2rem;
    bottom: 0;
    width: 2px;
    background-color: var(--bs-border-color, #e6e6e8);
} */

.timeline-indicator {
    position: absolute;
    left: 0;
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 50%;
    background-color: var(--bs-body-bg, #fff);
    border: 2px solid var(--bs-border-color, #e6e6e8);
    color: var(--bs-secondary-color, #82808b);
    font-size: 0.875rem;
    z-index: 1;
}

.timeline-indicator-primary {
    border-color: var(--bs-primary, #7367f0);
    color: var(--bs-primary, #7367f0);
}

.timeline-indicator-success {
    border-color: var(--bs-success, #28c76f);
    color: var(--bs-success, #28c76f);
}

.timeline-indicator-warning {
    border-color: var(--bs-warning, #ff9f43);
    color: var(--bs-warning, #ff9f43);
}

.timeline-indicator-danger {
    border-color: var(--bs-danger, #ff4c51);
    color: var(--bs-danger, #ff4c51);
}

.timeline-indicator-info {
    border-color: var(--bs-info, #00cfe8);
    color: var(--bs-info, #00cfe8);
}

.timeline-indicator-secondary {
    border-color: var(--bs-secondary, #a8aaae);
    color: var(--bs-secondary, #a8aaae);
}

/* Service entry detail page */
.service-detail-hero {
    position: relative;
    overflow: visible;
}

.service-detail-hero .dropdown {
    position: relative;
    z-index: 6;
}

.service-detail-hero::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--bs-primary, #7367f0), var(--bs-info, #00cfe8));
    border-radius: 0.75rem 0 0 0.75rem;
}

.service-detail-avatar {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.service-detail-lifecycle-track {
    min-width: 100%;
    width: max-content;
}

.service-detail-lifecycle-step {
    flex: 0 0 5.5rem;
}

.service-detail-lifecycle-line {
    flex: 1 1 1.5rem;
    min-width: 1rem;
    max-width: 3rem;
    margin-top: 1.125rem;
}

.service-detail-lifecycle-dot {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.8125rem;
}

@media (min-width: 1200px) {
    .service-detail-lifecycle-step {
        flex: 1 1 0;
    }

    .service-detail-lifecycle-line {
        flex: 1 1 0;
        max-width: none;
    }
}

.service-detail-tiles > [class*="col-"] {
    min-width: 0;
}

.service-detail-tile {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    border: 1px solid var(--bs-border-color, #e6e6e8);
    border-radius: 0.5rem;
    padding: 0.625rem 0.75rem;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    background: var(--bs-body-bg, #fff);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.service-detail-tile:hover {
    border-color: rgba(115, 103, 240, 0.35);
    box-shadow: 0 0.125rem 0.375rem rgba(47, 43, 61, 0.05);
}

.service-detail-tile__icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
    margin-bottom: 0;
}

.service-detail-tile__body {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    line-height: 1.3;
    overflow: hidden;
}

.service-detail-tile__label {
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--bs-secondary-color, #a5a3ae);
    margin-bottom: 0.125rem;
}

.service-detail-tile__value {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-body-color, #2f2b3d);
    word-break: break-word;
    overflow-wrap: anywhere;
}

a.service-detail-tile__value {
    color: var(--bs-primary, #7367f0);
}

a.service-detail-tile__value:hover {
    text-decoration: underline !important;
}

.service-detail-tile__meta {
    font-size: 0.6875rem;
    color: var(--bs-secondary-color, #a5a3ae);
    margin-top: 0.125rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
    word-break: break-word;
}

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

@media (max-width: 575.98px) {
    .service-detail-meta-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.service-detail-meta-item {
    min-width: 0;
    border: 1px solid var(--bs-border-color, #e6e6e8);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bs-body-bg, #fff);
}

.service-detail-meta-item__label {
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--bs-secondary-color, #a5a3ae);
    margin-bottom: 0.125rem;
}

.service-detail-meta-item__value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-body-color, #2f2b3d);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.service-detail-progress-card {
    background: linear-gradient(135deg, rgba(115, 103, 240, 0.06), rgba(0, 207, 232, 0.04));
    border: 1px solid rgba(115, 103, 240, 0.12);
    border-radius: 0.75rem;
}

.service-detail-ring {
    --ring-value: 0;
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    background: conic-gradient(var(--bs-success, #28c76f) calc(var(--ring-value) * 1%), var(--bs-border-color, #e6e6e8) 0);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.service-detail-ring__inner {
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 50%;
    background: var(--bs-body-bg, #fff);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.service-detail-ring__value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--bs-heading-color, #2f2b3d);
}

.service-detail-ring__label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color, #82808b);
}

.service-detail-tabs .nav-link {
    border: 0;
    border-radius: 0.5rem;
    font-weight: 600;
    color: var(--bs-body-color);
    padding: 0.5rem 1rem;
    background: transparent;
}

.service-detail-tabs .nav-link.active {
    background: var(--bs-primary, #7367f0);
    color: #fff;
}

.service-detail-tabs .nav-link.active .badge.bg-label-primary {
    background-color: #fff !important;
    color: var(--bs-primary, #7367f0) !important;
}

.service-detail-sidebar {
    position: sticky;
    top: 5.5rem;
}

.service-followup-link {
    display: block;
    border: 1px solid var(--bs-border-color, #e6e6e8);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.service-followup-link:hover {
    border-color: rgba(115, 103, 240, 0.4);
    background-color: rgba(115, 103, 240, 0.04);
    color: inherit;
    transform: translateY(-1px);
}

.service-doc-card {
    border: 1px solid var(--bs-border-color, #e6e6e8);
    border-radius: 0.75rem;
    padding: 1rem 1.125rem;
    height: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.service-doc-card:hover {
    border-color: rgba(115, 103, 240, 0.35);
    box-shadow: 0 0.25rem 0.75rem rgba(47, 43, 61, 0.08);
}

.service-doc-card__icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(115, 103, 240, 0.1);
    color: var(--bs-primary, #7367f0);
}

.service-payment-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.75rem;
}

.service-payment-summary__item {
    border: 1px solid var(--bs-border-color, #e6e6e8);
    border-radius: 0.625rem;
    padding: 0.75rem 1rem;
    text-align: center;
}

.service-payment-summary__value {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
}

.service-empty-state {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.service-empty-state__icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(115, 103, 240, 0.1);
    color: var(--bs-primary, #7367f0);
    margin-bottom: 1rem;
}

/* Customer wizard — identification documents table */
.customer-documents-table-wrap {
    border: 1px solid var(--bs-border-color, #e6e6e8);
    border-radius: 0.625rem;
}

.customer-documents-table {
    --bs-table-hover-bg: rgba(115, 103, 240, 0.04);
    margin-bottom: 0;
}

.customer-documents-table thead th {
    background: var(--bs-gray-50, #f8f8f9);
    border-bottom: 1px solid var(--bs-border-color, #e6e6e8);
    color: var(--bs-secondary-color, #6d6b77);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.65rem 0.85rem;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
}

.customer-documents-table tbody td {
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(47, 43, 61, 0.08));
    padding: 0.55rem 0.85rem;
    vertical-align: middle;
}

.customer-documents-table tbody tr:last-child td {
    border-bottom: 0;
}

.customer-documents-table__actions {
    width: 3rem;
}

.document-type-select-wrap .document-required-mark {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
    position: absolute;
    right: 2.1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
}

.document-type-select-wrap.is-required .js-document-type-select {
    padding-right: 1.5rem;
}

.customer-documents-table .form-control-sm,
.customer-documents-table .form-select-sm {
    min-height: calc(1.5em + 0.65rem + 2px);
}

.customer-documents-table .js-document-preview-link {
    color: var(--bs-primary, #7367f0);
}

.document-file-help-floating {
    background: var(--bs-gray-900, #2f2b3d);
    border-radius: 0.375rem;
    box-shadow: 0 0.25rem 1rem rgba(47, 43, 61, 0.18);
    color: #fff;
    display: none;
    font-size: 0.8125rem;
    left: 0;
    line-height: 1.45;
    max-width: min(18rem, calc(100vw - 1rem));
    padding: 0.5rem 0.75rem;
    pointer-events: none;
    position: fixed;
    top: 0;
    z-index: 1090;
}

/* Documents index — grouped by client */
.documents-by-client-table {
    width: 100%;
}

.documents-by-client-table td {
    padding-bottom: 0.5rem;
    padding-top: 0.5rem;
    vertical-align: middle;
}

.documents-by-client-table td:first-child {
    color: var(--bs-secondary-color, #6d6b77);
    width: 3rem;
}

.documents-by-client-table__docs {
    width: auto;
}

.documents-by-client-table__actions {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

.document-stack-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-start;
    margin-bottom: 0.35rem;
    min-height: 1.5rem;
}

.document-stack-head-spacer {
    margin-bottom: 0.35rem;
    min-height: 1.5rem;
}

.document-stack-count {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.45rem;
}

.document-stack-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.document-stack-list--actions {
    align-items: flex-end;
}

.document-stack-item {
    align-items: center;
    display: flex;
    gap: 0.45rem;
    min-height: 1.75rem;
}

.document-stack-item--name {
    justify-content: flex-start;
}

.document-stack-item--actions {
    justify-content: flex-end;
}

.document-stack-item__text {
    font-size: 0.875rem;
    line-height: 1.25;
}

.document-stack-item__actions {
    display: inline-flex;
    flex-shrink: 0;
    gap: 0.25rem;
}

.document-stack-item__actions .btn-icon {
    height: 1.75rem;
    width: 1.75rem;
}

tr.js-document-stack .document-stack-item--extra {
    display: none;
}

tr.js-document-stack[data-expanded='1'] .document-stack-item--extra {
    display: flex;
}

tr.js-document-stack .js-document-stack-toggle {
    color: var(--bs-primary, #7367f0);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
}

tr.js-document-stack .js-document-stack-toggle:hover {
    color: var(--bs-primary, #7367f0);
    text-decoration: underline;
}

.document-status-dot {
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    height: 0.45rem;
    width: 0.45rem;
}

.document-status-dot--active {
    background-color: var(--bs-success, #28c76f);
}

.document-status-dot--inactive {
    background-color: var(--bs-danger, #ff4c51);
}

/* Employee bank / family / runsheet task accordion */
.employee-bank-accordion .accordion-button,
.employee-family-accordion .accordion-button,
.runsheet-task-accordion .accordion-button {
    font-size: 0.9375rem;
    font-weight: 600;
}

.employee-bank-accordion__header,
.employee-family-accordion__header,
.runsheet-task-accordion__header {
    margin: 0;
    gap: 0.5rem;
    padding-right: 0.75rem;
    background-color: var(--bs-accordion-btn-bg, var(--bs-body-bg));
}

.employee-bank-accordion__header .accordion-button,
.employee-family-accordion__header .accordion-button,
.runsheet-task-accordion__header .accordion-button {
    box-shadow: none;
    width: auto;
    flex: 1 1 auto;
}

.employee-bank-accordion .accordion-button.has-remove-action,
.employee-family-accordion .accordion-button.has-remove-action,
.runsheet-task-accordion .accordion-button.has-remove-action {
    padding-right: 1.25rem;
}

.employee-bank-accordion__remove,
.employee-family-accordion__remove,
.runsheet-task-accordion__remove {
    position: static;
    transform: none;
    z-index: 3;
}

.employee-bank-accordion .accordion-button:not(.collapsed),
.employee-family-accordion .accordion-button:not(.collapsed),
.runsheet-task-accordion .accordion-button:not(.collapsed) {
    box-shadow: none;
}

.employee-bank-accordion .accordion-item,
.employee-family-accordion .accordion-item,
.runsheet-task-accordion .accordion-item {
    border-radius: 0.5rem;
    overflow: hidden;
}

.employee-bank-accordion .accordion-item + .accordion-item,
.employee-family-accordion .accordion-item + .accordion-item,
.runsheet-task-accordion .accordion-item + .accordion-item {
    margin-top: 0.5rem;
}

input[name^="nominee_age_"] {
    min-width: 4.75rem;
    width: 100%;
    -moz-appearance: textfield;
    appearance: textfield;
}

input[name^="nominee_age_"]::-webkit-outer-spin-button,
input[name^="nominee_age_"]::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}
