.mkpi {
    position: relative;
    overflow: hidden;
    border-radius: 1.2rem;
    border: 1px solid color-mix(in srgb, var(--bs-secondary) 16%, white);
    background:
        radial-gradient(
            circle at top right,
            color-mix(in srgb, var(--bs-primary) 5%, white),
            transparent 28%
        ),
        linear-gradient(180deg, #ffffff 0%, #fcfcfd 100%);
    padding: 1rem 1rem 0.95rem;
    box-shadow:
        0 14px 30px rgba(15, 23, 42, 0.06),
        0 1px 0 rgba(255, 255, 255, 0.7) inset;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
    opacity: 0;
    transform: translateY(10px);
    isolation: isolate;
}

.mkpi::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--bs-primary) 78%, white),
        color-mix(in srgb, var(--bs-primary) 26%, white) 58%,
        transparent 100%
    );
    opacity: 0.95;
}

.mkpi::after {
    content: "";
    position: absolute;
    right: -28px;
    top: -34px;
    width: 118px;
    height: 118px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bs-primary) 7%, white);
    filter: blur(10px);
    opacity: 0.55;
    z-index: 0;
    pointer-events: none;
}

.mkpi:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--bs-primary) 20%, white);
    box-shadow:
        0 18px 36px rgba(15, 23, 42, 0.09),
        0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.mkpi.is-visible {
    opacity: 1;
    transform: none;
}

.mkpi__top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
}

.mkpi__meta {
    min-width: 0;
    flex: 1 1 auto;
}

.mkpi__title {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    color: #667085;
}

.mkpi__value {
    margin-top: 0.18rem;
    font-size: 1.78rem;
    font-weight: 900;
    line-height: 1.06;
    color: #18253d;
    letter-spacing: -0.025em;
}

.mkpi__subtitle {
    margin-top: 0.34rem;
    font-size: 0.82rem;
    color: #8792a6;
    line-height: 1.45;
}

.mkpi__icon {
    position: relative;
    z-index: 2;
    width: 50px;
    height: 50px;
    border-radius: 1rem;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--bs-primary) 12%, white),
        color-mix(in srgb, var(--bs-primary) 6%, white)
    );
    color: var(--bs-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 50px;
    border: 1px solid color-mix(in srgb, var(--bs-primary) 16%, white);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 8px 18px rgba(15, 23, 42, 0.04);
}

.mkpi__icon i {
    font-size: 1rem;
    line-height: 1;
}

.mkpi__trend {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.24rem 0.62rem;
    border-radius: 999px;
    margin-top: 0.78rem;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid transparent;
}

.mkpi__trend--up {
    background: color-mix(in srgb, #16a34a 10%, white);
    color: #15803d;
    border-color: color-mix(in srgb, #16a34a 14%, white);
}

.mkpi__trend--down {
    background: color-mix(in srgb, #dc2626 10%, white);
    color: #dc2626;
    border-color: color-mix(in srgb, #dc2626 14%, white);
}

.mkpi__chart {
    position: relative;
    z-index: 2;
    margin-top: 0.82rem;
    min-height: 88px;
    padding: 0.55rem 0.55rem 0.2rem;
    border-radius: 1rem;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--bs-primary) 5%, white),
        color-mix(in srgb, var(--bs-primary) 2%, white)
    );
    border: 1px solid color-mix(in srgb, var(--bs-secondary) 10%, white);
}

.mkpi__chart canvas,
.mkpi__chart svg {
    margin: 0 auto;
}

.mkpi__chart .chartjs-tooltip {
    border-radius: 0.8rem !important;
    border: 1px solid color-mix(in srgb, var(--bs-secondary) 14%, white) !important;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12) !important;
}

.mkpi__chart .chartjs-legend {
    display: none !important;
}

.mkpi:has([data-chart-type="donut"]) .mkpi__chart {
    min-height: 118px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(
        circle at center,
        color-mix(in srgb, var(--bs-primary) 4%, white),
        transparent 58%
    );
}

[data-bs-theme="dark"] .mkpi {
    background:
        radial-gradient(
            circle at top right,
            color-mix(in srgb, var(--bs-primary) 10%, #1f2637),
            transparent 30%
        ),
        linear-gradient(180deg, #1f2637 0%, #1c2535 100%);
    border-color: #344054;
    box-shadow: none;
}

[data-bs-theme="dark"] .mkpi::before {
    opacity: 0.72;
}

[data-bs-theme="dark"] .mkpi::after {
    background: color-mix(in srgb, var(--bs-primary) 10%, #1f2637);
    opacity: 0.35;
}

[data-bs-theme="dark"] .mkpi:hover {
    border-color: color-mix(in srgb, var(--bs-primary) 24%, #1f2637);
    box-shadow: none;
}

[data-bs-theme="dark"] .mkpi__title {
    color: #9aa6b8;
}

[data-bs-theme="dark"] .mkpi__value {
    color: #f8f9fa;
}

[data-bs-theme="dark"] .mkpi__subtitle {
    color: #98a2b3;
}

[data-bs-theme="dark"] .mkpi__icon {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--bs-primary) 16%, #1f2637),
        color-mix(in srgb, var(--bs-primary) 10%, #1f2637)
    );
    border-color: color-mix(in srgb, var(--bs-primary) 18%, #1f2637);
    box-shadow: none;
}

[data-bs-theme="dark"] .mkpi__chart {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--bs-primary) 7%, #1f2637),
        color-mix(in srgb, var(--bs-primary) 3%, #1f2637)
    );
    border-color: #344054;
}
