/* =====================================================
   Page Transparence — tableau de bord public
   Style « audit comptable » épuré : filets clairs,
   fonds sobres, accents de couleur ponctuels.
   ===================================================== */

.transparency-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 24px 80px;
    /* Opaque : le contenu flotte sur l’image de fond plein écran et la masque. */
    background: var(--paper);
}

.dashboard { display: block; }

.transparency-page__head { margin-bottom: 36px; }

/* ---------- Bandeau de contrôle ---------- */
.audit-bar {
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 20px 22px;
    margin-bottom: 32px;
}

.audit-bar__period {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0 0 16px;
}

.audit-bar__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.audit-bar__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 240px;
}

.audit-bar__label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 600;
}

.audit-bar select {
    appearance: none;
    font-family: var(--body);
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    background: var(--paper);
    border: 1.5px solid var(--border);
    border-radius: 0;
    padding: 12px 40px 12px 14px;
    width: 100%;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 5l6 6 6-6' fill='none' stroke='%231A1A1A' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.audit-bar select:focus { outline: none; }
.audit-bar select:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ---------- Grille des 9 KPIs ---------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 48px;
    border-top: 1px solid var(--border);
}

.kpi {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 26px 24px;
    min-height: 116px;
    border-bottom: 1px solid var(--border);
}

.kpi__label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-weight: 600;
}

.kpi__value {
    order: -1;
    align-self: flex-start;
    font-family: var(--display);
    font-size: clamp(28px, 4vw, 46px);
    line-height: 0.95;
}

/* Accent de couleur en filet : le jaune illisible en texte reste sous le chiffre. */
.kpi--accent .kpi__value {
    padding-bottom: 6px;
    border-bottom: 5px solid var(--yellow);
}
.kpi--strikers .kpi__value {
    padding-bottom: 6px;
    border-bottom: 5px solid var(--red);
}

/* ---------- Graphiques ---------- */
.charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 48px;
}

.chart {
    border: 1px solid var(--border);
    background: var(--paper);
    padding: 22px 22px 26px;
}

.chart__title {
    font-family: var(--body);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 18px;
}

.chart__empty { color: var(--muted); font-size: 15px; }

/* ---------- Camembert (pie) ---------- */
.pie {
    display: grid;
    grid-template-columns: 1fr 160px;
    align-items: center;
    gap: 22px;
}

.pie__svg {
    width: 160px;
    height: 160px;
}

.pie__bg { stroke: var(--surface); }
.pie__slice { transition: opacity 0.15s ease; }
.pie__slice:hover { opacity: 0.85; }

.pie__pct-label {
    font-family: var(--mono);
    font-size: 3px;
    font-weight: 700;
    pointer-events: none;
}

.pie__slice { cursor: help; }

.pie__legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pie__legend-row {
    display: grid;
    grid-template-columns: 12px 1fr;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    text-align: left;
}

.pie__swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.pie__entry { font-weight: 600; }

/* ---------- Bloc indépendance & frais ---------- */
.guarantee {
    border: 1px solid var(--border);
    background: var(--paper);
    padding: 36px 32px 40px;
}

.guarantee__rule {
    text-align: center;
    font-size: clamp(18px, 2.6vw, 26px);
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 32px;
}

.guarantee__rule mark {
    background: var(--yellow);
    color: var(--ink);
    padding: 2px 6px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.guarantee__examples {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.guarantee__example { border: 1px solid var(--border); padding: 20px; background: var(--surface); }

.guarantee__example-head {
    display: block;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 14px;
    margin-bottom: 10px;
}

.guarantee__example p { margin: 0; font-size: 16px; line-height: 1.5; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .charts { grid-template-columns: 1fr; }
    .guarantee__examples { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .pie { grid-template-columns: 1fr; justify-items: center; }
    .pie__legend { width: 100%; }
}

/* ---------- Carte régionale ---------- */
.region-map {
    margin: 32px 0 48px;
    border: 1px solid var(--border);
    padding: 24px;
    background: var(--paper);
}

.region-map__head { margin-bottom: 20px; }

.region-map__lede {
    margin: 0;
    color: var(--ink-soft);
    font-size: 15px;
}

.region-map__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 28px;
    align-items: start;
}

.region-map__svg {
    width: 100%;
    height: auto;
    display: block;
}

.region-map__region {
    fill: var(--red);
    stroke: var(--ink);
    /* viewBox is ~110 units wide → tiny stroke value gives a hairline
       regardless of the rendered map size. Bumped only marginally on
       hover so the outline highlights without redrawing the layout. */
    stroke-width: 0.1;
    cursor: help;
    transition: stroke-width 140ms ease;
}

.region-map__region--bucket-0 { fill: var(--surface); fill-opacity: 1; }
.region-map__region--bucket-1 { fill-opacity: 0.22; }
.region-map__region--bucket-2 { fill-opacity: 0.42; }
.region-map__region--bucket-3 { fill-opacity: 0.62; }
.region-map__region--bucket-4 { fill-opacity: 0.82; }
.region-map__region--bucket-5 { fill-opacity: 1; }

.region-map__region:hover,
.region-map__region:focus {
    stroke-width: 0.25;
    outline: none;
}

.region-map__legend {
    border-left: 1px solid var(--border);
    padding-left: 20px;
}

.region-map__legend-title {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.region-map__scale {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    font-size: 14px;
    color: var(--ink-soft);
}

.region-map__scale li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 0;
}

.region-map__swatch {
    display: inline-block;
    width: 22px;
    height: 14px;
    background: var(--red);
    border: 1px solid var(--border);
}

.region-map__swatch--0 { background: var(--surface); }
.region-map__swatch--1 { opacity: 1; background: var(--red); filter: opacity(0.22); }
.region-map__swatch--2 { background: var(--red); filter: opacity(0.42); }
.region-map__swatch--3 { background: var(--red); filter: opacity(0.62); }
.region-map__swatch--4 { background: var(--red); filter: opacity(0.82); }
.region-map__swatch--5 { background: var(--red); filter: opacity(1); }

.region-map__nota {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-soft);
    margin: 0;
}

.region-map__credits {
    margin: 20px 0 0;
    text-align: right;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.region-map__credits a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.region-map__credits a:hover { color: var(--ink); }

@media (max-width: 760px) {
    .region-map__layout {
        grid-template-columns: 1fr;
    }
    .region-map__legend {
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 20px 0 0;
    }
}

/* ---------- Nota bene ---------- */
.transparency-page__nota {
    text-align: center;
    font-style: italic;
    color: #B0B0B0;
    font-size: 15px;
    margin: 28px 0 0;
}
