/* Prime attestazioni: colori per ruolo (palette di riferimento dataviz, solo tema chiaro come il sito) */
.pa-root {
    --surface-1:      #fcfcfb;
    --text-primary:   #0b0b0b;
    --text-secondary: #52514e;
    --text-muted:     #898781;
    --grid:           #e1e0d9;
    --axis:           #c3c2b7;
    --border:         rgba(11, 11, 11, 0.10);
    --series-1:       #2a78d6;   /* Toscana, e serie singole */
    --series-2:       #eb6834;   /* Settentrione */
    --series-3:       #1baf7a;   /* Centro e Sud */
    --series-4:       #eda100;   /* Sicilia */
    --other:          #b4b2a9;   /* altre aree */
    color: var(--text-primary);
}
.pa-lead { color: var(--text-secondary); max-width: 60rem; }

.pa-filtri {
    display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end;
    padding: 12px 0 16px; border-bottom: 1px solid var(--grid); margin-bottom: 20px;
    position: sticky; top: 0; background: #fff; z-index: 5;
}
.pa-filtri label { font-size: .8rem; color: var(--text-secondary); display: flex; flex-direction: column; gap: 4px; }
.pa-filtri .form-select { min-width: 12rem; }
.pa-stato { font-size: .8rem; color: var(--text-muted); margin-left: auto; }

#pa-corpo { transition: opacity .15s; }
#pa-corpo.pa-carica { opacity: .45; }

.pa-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 12px; margin-bottom: 20px; }
.pa-tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.pa-tile .lbl { font-size: .8rem; color: var(--text-secondary); }
.pa-tile .num { font-size: 1.7rem; font-weight: 600; line-height: 1.15; margin-top: 2px; }
.pa-tile .sub { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.pa-tile a { color: inherit; }

.pa-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 16px 18px; margin-bottom: 20px; }
.pa-card h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 2px; }
.pa-h3 { font-size: .9rem; font-weight: 600; color: var(--text-secondary); margin: 18px 0 4px; }
.pa-sub { font-size: .82rem; color: var(--text-secondary); margin: 0 0 10px; }
.pa-nota { font-size: .78rem; color: var(--text-muted); margin: 6px 0 0; }
.pa-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

/* Altezze che includono la fascia dell'asse x: niente scroll interni */
.pa-plot { position: relative; width: 100%; }
.pa-plot-alto  { height: 300px; }
.pa-plot-basso { height: 170px; }
.pa-plot-aree  { height: 420px; }
.pa-plot-tipi  { height: 220px; }

.pa-legenda { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .8rem; color: var(--text-secondary); margin: 4px 0 8px; }
.pa-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.pa-legenda i { display: inline-block; width: 14px; height: 2px; border-radius: 1px; }
.pa-legenda i.box { width: 10px; height: 10px; border-radius: 2px; }

.pa-tabella { margin-top: 12px; max-height: 360px; overflow: auto; }
.pa-root table { font-size: .82rem; width: 100%; }
.pa-root table th { font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--axis); }
.pa-root table td, .pa-root table th { padding: 4px 8px; }
.pa-root table td.n, .pa-root table th.n { text-align: right; font-variant-numeric: tabular-nums; }
.pa-root table tbody tr { border-bottom: 1px solid var(--grid); }
.pa-root table tr.cliccabile { cursor: pointer; }
.pa-root table tr.cliccabile:hover, .pa-root table tr.cliccabile:focus { background: #f2f1ed; outline: none; }
.pa-barra { display: inline-block; height: 8px; border-radius: 0 4px 4px 0; background: var(--series-1); vertical-align: middle; }

#pa-voci table td:first-child { white-space: nowrap; }
.pa-tipo { display: inline-block; min-width: 1.2em; font-weight: 700; }
