/* Your existing styles remain exactly the same */

select.kpi-filter-dropdown,
select.kpi-filter-dropdown:focus-visible {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
    background: transparent;
    border: none;
    outline: none;
    width: 17%;
}

/* .kpi-filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    margin-bottom: 30px;
    align-items: center;
} */

select.kpi-filter-dropdown {
    color: #5833AF;
    font-weight: 400;
    font-size: 22px;
    font-family: 'FuturaPT', sans-serif !important;
}

.kpi-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: center;
}

.kpi-filter-btn {
    background-color: #ffffff;
    color: #5833AF;
    padding: 2px 25px;
    display: inline-block;
    font-weight: 400;
    font-size: 22px;
    clip-path: polygon(0 0, 85% 0, 100% 25%, 100% 100%, 15% 100%, 0 75%);
    border: none;
}

.kpi-filter-btn.active,
.kpi-filter-btn:hover {
    background: #51D4E4;
    color: #5833AF;
    border-color: #51D4E4;
}

.kpi-filter-btn.toggle-more {
    background: transparent;
    color: #51D4E4;
    border: none;
}

.kpi-filter-btn.hidden-term {
    display: none;
}

.kpi-filter-btn.hidden-term.show {
    display: inline-block;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 0;
}


/* ===== Slider Container ===== */
.kpi-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    /* padding: 20px 0; */
}

.kpi-slider-wrapper {
    display: flex;
    transition: transform 0.5s ease;
    margin: 0 -10px;
}

.kpi-slider-container .slider-nav-btn.prev {
    position: absolute;
    top: 50%;
    z-index: 10;
    border: none;
    padding: 0;
}

.kpi-slider-container .slider-nav-btn.prev:hover,
.kpi-slider-container .slider-nav-btn.next:hover,
.kpi-slider-container .slider-nav-btn:focus-visible {
    background-color: transparent;
}

.kpi-slider-container .slider-nav-btn.next {
    right: 0;
    position: absolute;
    top: 50%;
    z-index: 10;
    border: none;
    padding: 0;
}

/* ===== Chart Card Styles (Base) ===== */
.kpi-chart-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    max-width: 100%;
    background-color: #51d4e424;
    border-radius: 30px;
    padding: 20px;
    height: 434.16px;
    margin-top: 20px;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kpi-chart-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);

}

.kpi-chart-wrapper .piechart-canvas {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.kpi-chart-wrapper .kpi-title {
    font-size: 22px;
    color: #fff;
    line-height: 23px;
    margin-bottom: 10px;
}

/* ===== Filtered Chart Cards (Grid View) ===== */
.filterings.kpi-chart-wrapper {
    background-color: transparent;
    border-radius: 0;
    padding: 20px;
    margin: 0;
    height: auto;
    transform: none;
    box-shadow: none;
}

.filterings.kpi-chart-wrapper:hover {
    transform: none;
    box-shadow: none;
}

.filterings.kpi-chart-wrapper.hidden {
    display: none;
}

.filterings.kpi-chart-wrapper .kpi-title {
    font-size: 22px;
    color: #5833AF;
    margin: 0;
}

.filterings.kpi-chart-wrapper .total {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
}

/* ===== Chart Summary ===== */
.kpi-summary {
    margin-top: 15px;
    font-size: 47px;
    font-weight: 600;
    color: #5833AF;
    text-align: center;
}

.kpi-slider-wrapper .kpi-summary .filtering-average {
    margin-top: 15px;
    font-size: 62px;
    color: #51D4E4;
    text-align: center;
}

.filterings.kpi-chart-wrapper .kpi-summary {
    margin: 0;
}

/* ===== Chart Legend ===== */
.chart-custom-legend {
    position: absolute;
    font-family: sans-serif;
    font-size: 14px;
    display: flex;
    gap: 15px;
    z-index: 10;
    flex-wrap: wrap;
}

.chart-custom-legend .legend-status,
.chart-custom-legend .legend-target {
    font-size: 13px;
    font-weight: 700;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #6347D1;
}

.icon-baseline {
    width: 14px;
    height: 14px;
    background: #FFF;
    border: 1px solid #ddd;
    border-radius: 50%;
    display: inline-block;
}

.icon-status {
    width: 14px;
    height: 14px;
    background: #51D4E4;
    border-radius: 50%;
    display: inline-block;
}

.icon-target {
    width: 14px;
    height: 14px;
    background: repeating-conic-gradient(#51D4E4 0% 25%, transparent 0% 50%);
    border-radius: 50%;
    display: inline-block;
}

/* ===== KPI Values ===== */
.kpi-values {
    display: flex;
    justify-content: space-between;
    background: #f5f5f5;
    padding: 10px;
    border-radius: 8px;
    margin: 15px 0;
}

/* ===== Modal Dialog ===== */
.kpi-pillar p {
    font-weight: 700;
}

.modal.show .modal-dialog {
    --bs-modal-width: 1400px;
}

.modal-dialog .modal-content {
    border-radius: 15px;
    overflow: hidden;
    height: auto;
}

.modal-dialog .modal-header {
    background: transparent;
    color: white;
    border-bottom: none;
    padding: 1.5rem;
    position: relative;
}

.modal-dialog .modal-header .btn-close {
    background: transparent !important;
    opacity: 1;
    height: 34px;
    width: 25px;
    padding: 0;
    border-radius: 0;
    position: absolute;
    right: 3rem;
    top: 80%;
    transform: translateY(-50%);
}

.modal-dialog .modal-header .btn-close:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

.modal-dialog .modal-body {
    padding: 30px 50px;
    flex: 0;
}

.modal-dialog .modal-footer {
    background: #ffffff;
    border-top: none;
    justify-content: center;
}

.modal-dialog .modal-footer .btn-secondary {
    background: #6347D1;
    border-color: #6347D1;
    padding: 10px 30px;
    border-radius: 25px;
}

.modal-dialog .modal-footer .btn-secondary:hover {
    background: #4a33a8;
    border-color: #4a33a8;
}

/* Modal Reference */
.modal-dialog .reference .reference-no {
    width: min-content;
}

.modal-dialog .reference .reference-no h2 {
    font-size: 20px;
    color: #fff;
    margin: 0;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #51D4E4;
}

/* Modal Title */
.modal-title.font-futurapt {
    color: #51D4E4;
    font-size: 22px;
    font-weight: 400;
    margin: 0;
    text-align: center;
}

/* ===== Modal Navigation ===== */
.modal-nav-btn {
    border: none;
    color: #51D4E4;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.3s;
    font-size: 60px;
    line-height: 1;
    padding: 0;
    background: transparent;
}

.modal-nav-btn:hover {
    color: #5932af;
    background-color: transparent;
}

.modal-nav-btn.prev {
    left: 1rem;
}

.modal-nav-btn.next {
    right: 3.5rem;
}

.modal-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ===== Modal Content Layout ===== */
.modal-parent .body-1,
.modal-parent .body-2 {
    width: 100%;
    gap: 31px;
    display: flex;
    flex-direction: row;
}

.modal-parent .body-1 .body-1-first {
    display: flex;
    gap: 25px;
    flex-direction: column;
}

.modal-parent .body-1 .body-1-first,
.modal-parent .body-1 .body-1-2,
.qualitative-update,
.kpi-trajectory-container {
    width: 50%;
}

/* KPI Titles */
.kpis-title {
    display: flex;
    flex-wrap: nowrap;
}

.kpis-title .kpi-titles {
    width: 70%;
    margin: 0;
}

.kpis-title .economy {
    /* width: 30%; */
    display: flex;
    align-content: flex-end;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.economy-logo {
    display: flex;
    justify-content: flex-end;
    width: 50%;
}

.kpi-titles {
    color: #51D4E4;
    font-weight: 700;
}

/* Pillar Terms */
.modal-parent .body-1 .pilla-term {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.modal-parent .body-1 .pilla-term p {
    font-family: 'FuturaPT-Bold', sans-serif;
    /* font-weight: 500; */
    font-size: 20px;
    color: #51D4E4;
    text-transform: capitalize;
    margin: 0;
}

/* KPI Description */
.kpi-brief-description {
    width: 90%;
}

.kpi-brief-description p,
.qualitative-update p {
    color: #5833AF;
    font-family: 'FuturaPT-Bold', sans-serif;
    font-size: 22px;
    line-height: 25px;
}

/* Qualitative Update & Trajectory */
.qualitative-update,
.kpi-trajectory-container {
    background-color: #51d4e440;
    padding: 30px;
    border-radius: 20px;
}

.qualitative-update {
    display: flex;
    align-items: center;
}

/* Macro Measure */
.macro-measure h2 {
    font-family: 'Xemx', sans-serif;
    font-size: 50px;
    font-weight: 400;
    color: #884FFF;
    line-height: 40px;
}

/* KPI Base Cards */
.kpi-base .card {
    background: #ede5ff;
    border: none;
    height: 187.92px;
    border-radius: 20px;
}

.kpi-base .card .card-body {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
}

.kpi-base .card .card-body h4 {
    font-size: 40px;
    font-weight: 700;
    color: #5833AF;
    line-height: 40px;
    word-break: break-word;
}

.kpi-base .card .card-body .font-futurapt {
    font-size: 22px;
    color: #5833AF;
}

/* ===== Slider Navigation ===== */
.slider-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.slider-prev,
.slider-next {
    background: #6347D1;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.slider-prev:hover,
.slider-next:hover {
    background: #4a33a8;
}

.slider-prev.disabled,
.slider-next.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
}

/* ===== Slider Dots ===== */
.slider-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: background 0.3s;
}

.slider-dot.active {
    background: #6347D1;
}

/* .modal-body .kpi-trajectory-container canvas {
    height: 351.1px !important;
} */

.kpi-trajectory-container.full-width {
    width: 100%;
    height: 400px;;
    max-width: 100%;
    flex: 0 0 100%;
}


/* ===== Media Queries ===== */
@media (max-width: 1024px) {
    .kpis-title .kpi-titles {
        width: 100%;
    }

    .economy-logo {
        width: auto;
        gap: 20px;
        position: absolute;
        top: 20px;
        left: 84px;
    }

    .elementor-shortcode select.kpi-filter-dropdown {
        width: 100%;
    }

    .modal-dialog .modal-body {
        padding: 30px 20px;
    }

    .kpi-trajectory-container {
        padding: 30px;
    }

    .modal-parent .body-1,
    .modal-parent .body-2 {
        flex-direction: column;
    }

    .modal-parent .body-1 .body-1-first,
    .modal-parent .body-1 .body-1-2,
    .qualitative-update,
    .kpi-trajectory-container {
        width: 100%;
    }

    .modal-body .kpi-trajectory-container canvas {
        height: 300px !important;
    }

    .macro-measure h2 {
        font-size: 32px;
        line-height: 33px;
    }
}

@media (max-width: 768px) {


    .elementor-shortcode select.kpi-filter-dropdown {
        width: 35%;
    }

    .kpi-slide {
        flex: 0 0 100%;
    }

    .modal-title {
        font-size: 20px;
        margin: 0 40px;
    }

    .modal-nav-btn.next {
        right: 3rem;
    }
}

@media (max-width: 767px) {


    .elementor-shortcode .kpi-filters {
        flex-wrap: wrap;
    }

    .elementor-shortcode select.kpi-filter-dropdown,
    select.kpi-filter-dropdown,
    select.kpi-filter-dropdown:focus-visible {
        width: 100%;
    }

    .kpi-trajectory-container {
        padding: 10px;
    }

    .body-1-2 .row {
        display: flex;
        flex-direction: row;
    }

    .body-1-2 .row .kpi-base {
        width: 33%;
        padding: 3px;
    }

    .kpi-base .card .card-body .font-futurapt {
        font-size: 15px;
    }

    .kpi-base .card .card-body h4 {
        font-size: 46px;
        height: auto;
    }

    .modal-dialog .modal-footer {
        flex-wrap: nowrap;
    }

    .modal-title.font-futurapt {
        font-size: 20px;
        line-height: 20px;
    }
}