﻿/* ================== EXPLOITATION (scoped) ================== */

.exploitation-page .section-title {
    font-size: 24px;
    line-height: 24px;
    letter-spacing: .18px;
    color: rgba(255,255,255,.87);
    margin: 18px 0 14px 0;
}

/* --------- CARD principale (Overview) --------- */
.exploitation-page .card.panel {
    background: #1C1C1C;
    border-radius: 30px;
    padding: 24px 28px;
    min-height: 350px;
}

/* Griglia interna: KPI | separatore | pie | legenda */
.exploitation-page .metrics-flex {
    display: grid;
    grid-template-columns: 280px 1px 260px 1fr;
    column-gap: 26px;
    align-items: start;
}
.exploitation-page .left-column,
.exploitation-page .left-column .metric,
.exploitation-page .left-column .metric *,
.exploitation-page .metric h3 {
    text-align: left !important;
}
/* Colonna sinistra */
.exploitation-page .left-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

    .exploitation-page .left-column .metric {
        width: 100%;
        text-align: left;
    }

.exploitation-page .metric h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
    line-height: 24px;
    letter-spacing: .15px;
    font-weight: 500;
    color: rgba(255,255,255,.87);
    text-align: left;
}

/* Chip sabbia */
.exploitation-page .chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 61px;
    height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    background: #F0C08C;
    color: #101010;
    font-size: 20px;
    font-weight: 700;
    margin-top: 4px;
}

/* Separatore verticale */
.exploitation-page .vertical-separator {
    width: 1px;
    height: 100%;
    background: rgba(255,255,255,.12);
}

/* --------- PIE --------- */
.exploitation-page .chart-card {
    width: 204px;
    height: 204px;
    margin-top: 12px;
    position: relative;
}

    .exploitation-page .chart-card canvas {
        width: 100% !important;
        height: 100% !important;
    }

/* --------- LEGENDA --------- */
.exploitation-page .chart-legend {
    padding-top: 32px;
}

    .exploitation-page .chart-legend ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .exploitation-page .chart-legend li {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 16px;
        font-weight: 600;
        line-height: 1;
        color: #fff;
    }

       /* .exploitation-page .chart-legend li:first-child {
            color: rgba(255,255,255,.50);
        }*/

    .exploitation-page .chart-legend .dot {
        width: 16px;
        height: 16px;
        border-radius: 999px;
        display: inline-block;
    }

        .exploitation-page .chart-legend .dot.gov {
            background: rgba(240,192,140,.50);
        }

        .exploitation-page .chart-legend .dot.ind {
            background: #54A7FF;
        }

        .exploitation-page .chart-legend .dot.aca {
            background: #C8483C;
        }

        .exploitation-page .chart-legend .dot.civ {
            background: #2B8456;
        }

/* --------- Tooltip esterno (se usi external) --------- */
.exploitation-page .chartjs-tooltip {
    background: #E4E4E4;
    color: #000;
    border-radius: 4px;
    box-shadow: 0 3px 5px rgba(0,0,0,.20);
    padding: 8px 10px;
    font-size: 14px;
    letter-spacing: .25px;
    line-height: 20px;
}

/* --------- Sezione dettaglio --------- */
.exploitation-page .card.detail-card {
    background: #1C1C1C;
    border-radius: 31px;
    padding: 28px;
    position: relative;
    min-height: 350px;
}

.exploitation-page .detail-close {
    position: absolute;
    right: 14px;
    top: 10px;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

/* Lista con bullets verdi + divider */
.exploitation-page .detail-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

    .exploitation-page .detail-list li {
        position: relative;
        padding: 0 0 14px 18px;
        margin: 0 0 14px 0;
        color: #fff;
        font-size: 16px;
        font-weight: 300;
        line-height: 19px;
        border-bottom: 1px solid rgba(255,255,255,.12);
    }

        .exploitation-page .detail-list li:last-child {
            border-bottom: none;
            margin-bottom: 0;
            padding-bottom: 0;
        }

        .exploitation-page .detail-list li::before {
            content: "";
            position: absolute;
            left: 0;
            top: 6px;
            width: 6px;
            height: 6px;
            border-radius: 1px !important;
            background: #2B8456;
        }

/* Utilità */
.exploitation-page .hidden {
    display: none;
}

/* --------- Responsive --------- */
@media (max-width:1200px) {
    .exploitation-page .metrics-flex {
        grid-template-columns: 1fr;
        row-gap: 20px;
    }

    .exploitation-page .vertical-separator {
        display: none;
    }

    .exploitation-page .chart-legend {
        padding-top: 0;
    }

        .exploitation-page .chart-legend ul {
            flex-direction: row;
            flex-wrap: wrap;
            gap: 16px;
        }
}
.exploitation-page .left-column {
    align-items: flex-start !important;
    justify-content: flex-start !important;
}

/* Chip vicina al titolo, niente centrature ereditate */
.exploitation-page .chip {
    margin-top: 4px !important;
    align-self: flex-start !important;
}

/* ========= PATCH 2: griglia e separatore centrale ========= */
.exploitation-page .card.panel .metrics-flex {
    /* sinistra 420 | separatore | colonna pie 320 | legenda auto */
    grid-template-columns: 280px 1px 320px 1fr !important;
    align-items: stretch !important; /* per far “tirare” il separatore */
}

.exploitation-page .card.panel .vertical-separator {
    align-self: stretch !important;
    height: auto !important; /* occupa tutta la card */
}

/* ========= PATCH 3: pie e legenda come nel mock ========= */
.exploitation-page .chart-card {
    width: 204px !important;
    height: 204px !important;
    margin-top: 8px !important;
}

.exploitation-page .chart-legend {
    padding-top: 24px !important; /* allineata verticalmente al centro del pie */
    margin-left: 12px !important; /* piccolo offset dalla colonna pie */
}

    .exploitation-page .chart-legend ul {
        gap: 24px !important;
    }

    .exploitation-page .chart-legend li {
        gap: 12px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        line-height: 20px !important; /* gestisce “Civil Society” su 2 righe */
        color: #FFFFFF !important;
    }


    .exploitation-page .chart-legend .dot {
        width: 16px !important;
        height: 16px !important;
        border-radius: 999px !important;
    }

/* ========= PATCH 4: card padding & titolo sezione ========= */
.exploitation-page .card.panel {
    padding: 24px 28px !important; /* identico a Figma */
    border-radius: 30px !important;
    min-height: 350px !important;
}

.exploitation-page .section-title {
    margin: 18px 0 14px 0 !important;
    font-size: 24px !important;
    line-height: 24px !important;
}

/* ========= PATCH 5: lista “Government” (bullets + divider) ========= */
.exploitation-page .detail-list {
    list-style: none !important;
    margin: 8px 0 0 !important;
    padding: 0 !important;
}

    .exploitation-page .detail-list li {
        position: relative !important;
        padding: 0 0 14px 18px !important;
        margin: 0 0 14px 0 !important;
        color: #FFFFFF !important;
        font-size: 16px !important;
        font-weight: 300 !important;
        line-height: 19px !important;
        border-bottom: 1px solid rgba(255,255,255,0.12) !important;
    }

        .exploitation-page .detail-list li:last-child {
            border-bottom: none !important;
            margin-bottom: 0 !important;
            padding-bottom: 0 !important;
        }

        .exploitation-page .detail-list li::before {
            content: "" !important;
            position: absolute !important;
            left: 0 !important;
            top: 6px !important;
            width: 6px !important;
            height: 6px !important;
            border-radius: 1px !important;
            background: #2B8456 !important; /* bullet verde */
        }

/* ==== 1) KPI a sinistra (stop ai flex globali sulla .metric) ==== */
.exploitation-page .left-column .metric {
    display: block !important;
    align-items: unset !important;
    justify-content: unset !important;
    text-align: left !important;
}

    .exploitation-page .left-column .metric h3 {
        margin: 0 0 12px 16px !important;
        text-align: left !important;
    }

.exploitation-page .left-column .chip {
    margin-left: 16px !important;
}

/* ==== 2) Legenda: NESSUNA attenuazione di default ==== */
.exploitation-page .chart-legend li {
    opacity: 1 !important;
}

    .exploitation-page .chart-legend li.is-active {
        opacity: .55 !important;
    }
/* attenua SOLO quando si apre il dettaglio */

/* ==== 3) Bullets quadrati nel dettaglio ==== */
.exploitation-page .detail-list li::before {
    border-radius: 1px !important; /* quadrato */
}

/* ==== 4) Spazi/line-height legenda (gestione “Civil Society”) ==== */
.exploitation-page .chart-legend li {
    line-height: 20px !important;
}

.exploitation-page .chart-legend .lbl {
    display: inline-block;
    max-width: 140px; /* forza il wrap su 2 righe armoniche */
    white-space: normal;
}

/* ==== 6) Pie e legenda: distanza dal separatore + allineamento a destra ==== */
.exploitation-page .card.panel .metrics-flex {
    grid-template-columns: 280px 1px 360px 1fr !important; /* più spazio tra sep e pie */
    column-gap: 26px !important;
    align-items: stretch !important; /* sep a tutta altezza */
}

.exploitation-page .vertical-separator {
    height: auto !important;
    align-self: stretch !important;
}

.exploitation-page .chart-card {
    width: 204px !important;
    height: 204px !important;
    margin-left: 72px !important; /* stacca il pie dal separatore */
    margin-top: 8px !important;
    justify-self: start !important;
}

.exploitation-page .chart-legend {
    justify-self: end !important;
    align-self: center !important;
    padding-top: 0 !important;
    margin-right: 24px !important; /* verso il bordo destro card */
}

    .exploitation-page .chart-legend ul {
        gap: 24px !important;
    }

/* ==== Tooltip esterno: testo centrato, contenuto nel riquadro, % relativa ==== */
#pie-tooltip {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 93px;
    max-width: 200px;
    white-space: nowrap;
    text-align: center;
    padding: 8px 12px !important;
}
/* --- PIÙ SPAZIO TRA GRAFICO E LEGENDA --- */

/* 1) Allarga la 3ª colonna (contenitore del pie) così la 4ª parte più a destra */
.exploitation-page .card.panel .metrics-flex {
    grid-template-columns: 280px 1px 420px 1fr !important; /* prima era 360/380 */
    column-gap: 40px !important; /* leggermente più gap globale */
}

/* 2) Pie: resta staccato dal separatore */
.exploitation-page .chart-card {
    margin-left: 96px !important; /* prima 72/88; aumenta lo “scarto” dal separatore */
}

/* 3) Legenda: spostala ancora a destra rispetto al pie */
.exploitation-page .chart-legend {
    margin-left: 64px !important; /* distanza “fra pie e legenda” */
    margin-right: 32px !important; /* respiro verso il bordo card */
    justify-self: end !important;
    align-self: center !important;
}

/* 4) Mantieni tutto pulito su schermi medi/piccoli */
@media (max-width: 1400px) {
    .exploitation-page .card.panel .metrics-flex {
        grid-template-columns: 280px 1px 380px 1fr !important;
        column-gap: 32px !important;
    }

    .exploitation-page .chart-card {
        margin-left: 80px !important;
    }

    .exploitation-page .chart-legend {
        margin-left: 48px !important;
        margin-right: 24px !important;
    }
}

@media (max-width: 1200px) {
    .exploitation-page .card.panel .metrics-flex {
        grid-template-columns: 1fr !important;
    }

    .exploitation-page .chart-card {
        margin-left: 0 !important;
    }

    .exploitation-page .chart-legend {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}
.exploitation-page .right-grid, .right-grid-2col {
    display: grid;
    gap: 120px;
    flex: 1;
}
/* link a tutta riga nel dettaglio */
.exploitation-page .detail-list .detail-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

    .exploitation-page .detail-list .detail-link:hover div {
        text-decoration: underline;
    }

.exploitation-page .detail-list .no-link {
    opacity: .7;
    cursor: default;
}
.exploitation-page .detail-list .strategy {
    margin: 4px 0 0;
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    color: rgba(255,255,255,.70);
}