.pivot-table {
    --pivot-accent: var(--blue, #3f5aa9);
    --pivot-accent-soft: rgba(63, 90, 169, 0.08);
    --pivot-border: #d4dce6;
    --pivot-header: #f4f7fb;
    --pivot-group: #eef3f8;
    --pivot-empty: #c3cad3;
    --pivot-label-width: 17rem;
    --pivot-column-width: 12rem;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--pivot-border);
    border-block-start: 3px solid var(--pivot-accent);
    border-radius: 0.4rem;
    background: #fff;
    box-shadow: 0 0.2rem 0.55rem rgba(31, 45, 61, 0.08);
}

    .pivot-table [hidden] {
        display: none !important;
    }

.pivot-table__toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
    margin: 0;
    padding: 0.4rem 0.5rem;
    border-block-end: 1px solid var(--pivot-border);
    background: var(--pivot-header);
}

.pivot-table__toolbar-button {
    min-width: 2.25rem;
}

.pivot-table__scroll {
    width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    scrollbar-width: thin;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.pivot-table__table {
    width: 100%;
    min-width: max-content;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    color: #414850;
    font-variant-numeric: tabular-nums;
}

    .pivot-table__table th,
    .pivot-table__table td {
        min-width: var(--pivot-column-width);
        padding: 0.2rem 0.5rem;
        text-align: center;
        vertical-align: middle;
        border-inline-end: 1px solid var(--pivot-border);
        border-block-end: 1px solid var(--pivot-border);
        background: #fff;
    }

    .pivot-table__table tr > :last-child {
        border-inline-end: 0;
    }

.pivot-table__head th {
    color: var(--pivot-accent);
    background: linear-gradient(180deg, #f9fbfe 0%, var(--pivot-header) 100%);
}

.pivot-table--sticky-header .pivot-table__head th {
    position: sticky;
    inset-block-start: 0;
    z-index: 4;
}

.pivot-table__corner,
.pivot-table__group-title-cell,
.pivot-table__row-label {
    width: var(--pivot-label-width) !important;
    min-width: var(--pivot-label-width) !important;
    max-width: var(--pivot-label-width) !important;
}

.pivot-table--sticky-labels .pivot-table__corner,
.pivot-table--sticky-labels .pivot-table__group-title-cell,
.pivot-table--sticky-labels .pivot-table__row-label {
    position: sticky;
    inset-inline-start: 0;
    z-index: 3;
}

.pivot-table--sticky-header.pivot-table--sticky-labels .pivot-table__corner {
    z-index: 6;
}

.pivot-table__column-header {
    padding: 0.3rem !important;
}

.pivot-table__column-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    padding: 0.32rem 0.5rem;
    border-radius: 0.25rem;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(63, 90, 169, 0.09);
}

.pivot-table__column-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.pivot-table__column-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.pivot-table__column-subtitle {
    margin-block-start: 0.2rem;
    padding-block-end: 0.1rem;
    border-block-end: 2px solid var(--orange, #f5a623);
    font-size: 0.82rem;
    font-weight: 700;
}

.pivot-table__column-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid #ccd3dc;
    border-radius: 0.35rem;
    color: #4b535c;
    background: #fff;
    cursor: pointer;
}

    .pivot-table__column-toggle:hover,
    .pivot-table__column-toggle:focus-visible {
        color: var(--pivot-accent);
        border-color: var(--pivot-accent);
        outline: 0;
        box-shadow: 0 0 0 0.15rem var(--pivot-accent-soft);
    }

.pivot-table__group-summary th,
.pivot-table__group-summary td {
    padding: 0.3rem;
    color: var(--pivot-accent);
    background: var(--pivot-group);
}

.pivot-table__group-summary {
    box-shadow: inset 0 1px 0 #fff;
}

.pivot-table__group-title-cell {
    z-index: 3;
}

.pivot-table__group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-height: 2.35rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid rgba(63, 90, 169, 0.08);
    border-radius: 0.25rem;
    color: var(--pivot-accent);
    background: rgba(255, 255, 255, 0.62);
    font: inherit;
    font-weight: 700;
    text-align: start;
    cursor: pointer;
}

.pivot-table__group-title {
    padding-block-end: 0.15rem;
    border-block-end: 2px solid var(--orange, #f5a623);
}

.pivot-table--sticky-labels .pivot-table__section-title-cell .pivot-table__group-title {
    position: sticky;
    inset-inline-start: calc(0.85rem + 1px);
    z-index: 3;
}

.pivot-table__group-chevron {
    transition: transform 160ms ease;
}

.pivot-table__group-toggle[aria-expanded="false"] .pivot-table__group-chevron {
    transform: rotate(-90deg);
}

[dir="rtl"] .pivot-table__group-toggle[aria-expanded="false"] .pivot-table__group-chevron {
    transform: rotate(90deg);
}

.pivot-table__section-title-cell {
    padding: 0.3rem !important;
    background: var(--pivot-group) !important;
}

.pivot-table__summary-cell {
    padding: 0.3rem !important;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center !important;
}

    .pivot-table__summary-cell .pivot-table__value {
        display: block;
        min-height: 2.35rem;
        padding: 0.45rem 0.5rem;
        border: 1px solid rgba(63, 90, 169, 0.08);
        border-radius: 0.25rem;
        color: var(--pivot-accent);
        background: rgba(255, 255, 255, 0.62);
    }

.pivot-table__row-label {
    color: #3f454d;
    background: #fafbfc !important;
    font-weight: 600;
    text-align: end !important;
}

.pivot-table__group-body tr:nth-child(even) td,
.pivot-table__group-body tr:nth-child(even) .pivot-table__row-label {
    background: #fbfcfe !important;
}

.pivot-table__group-body tr:hover td,
.pivot-table__group-body tr:hover .pivot-table__row-label {
    background: #eef6ff !important;
}

.pivot-table__value-cell--empty {
    color: var(--pivot-empty);
}

.pivot-table__empty-value {
    font-size: 1.05rem;
    font-weight: 700;
}

.pivot-table__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    color: #8c96a3;
    background: #edf0f3;
}

.pivot-table__status--active {
    color: #fff;
    background: #00a478;
}

@media (max-width: 767.98px) {
    .pivot-table {
        --pivot-label-width: 11.5rem;
        --pivot-column-width: 9.5rem;
    }

    .pivot-table__scroll {
        max-height: none;
    }

    .pivot-table__table th,
    .pivot-table__table td {
        padding: 0.3rem 0.45rem;
    }

    .pivot-table__column-title {
        font-size: 0.95rem;
    }
}
