/* Componenti specifici della dashboard Patrimonio (le basi sono in style.css, condivise con Ortigia). */

.stackbar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.stackbar span { display: block; height: 100%; min-width: 3px; }

.verdicts { list-style: none; margin: 0; padding: 0; }
.verdicts li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--grid); }
.verdicts li:last-child { border-bottom: 0; }
.verdicts li > div { flex: 1; min-width: 0; }
.verdicts p { margin: 2px 0 0; color: var(--ink-2); font-size: var(--fs-sm); }
.verdicts .vi { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: var(--fs-xs); background: var(--surface-2); color: var(--ink-2); }
.verdicts .lv-ok .vi { background: rgba(12,163,12,.14); color: var(--good-ink); }
.verdicts .lv-warn .vi { background: rgba(250,178,25,.22); color: var(--ink); }
.verdicts .lv-bad .vi { background: rgba(208,59,59,.16); color: var(--bad-ink); }
.verdicts .lv-info .vi { background: var(--accent-soft); color: var(--accent-ink); }

.alloc { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 20px; align-items: center; }
@media (max-width: 560px) { .alloc { grid-template-columns: 1fr; } .alloc .donut { max-width: 200px; margin: 0 auto; } }
.donut { width: 100%; height: auto; display: block; }
.donut .d-c { font-size: 20px; font-weight: 650; fill: var(--ink); }
.donut .d-s { font-size: 12px; fill: var(--muted); }
.alloc td:first-child { white-space: normal; }
i.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: 0; }

.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bars, .line { width: 100%; height: auto; display: block; }
.ax { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }

td.desc { max-width: 28rem; white-space: normal; word-break: break-word; }
.cat-sel, .cls-sel { min-height: 36px; padding: 4px 8px; font-size: var(--fs-sm); width: auto; max-width: 14rem; }
body.privacy .priv-blur { filter: blur(6px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form[hidden] { display: none; }

/* ---------- Dove vanno i soldi ---------- */
.cat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.cat-card { appearance: none; text-align: left; font: inherit; color: inherit; cursor: pointer; display: grid; grid-template-columns: 44px 1fr; gap: 6px 12px; align-items: center; align-content: start;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 14px; padding: 14px; }
.cat-card:hover { border-color: var(--axis); }
.cat-card.on { border-color: var(--accent); background: var(--accent-soft); }
.cat-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cat-ic { grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; font-size: 1.4rem; line-height: 1; }
.cat-main { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.cat-l { font-weight: 600; font-size: var(--fs-md); line-height: 1.3; }
.cat-p { font-size: var(--fs-xl); font-weight: 650; font-variant-numeric: tabular-nums; }
.cat-bar { height: 6px; background: var(--grid); border-radius: 999px; overflow: hidden; }
.cat-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.cat-m { grid-column: 2; font-size: var(--fs-sm); color: var(--muted); }
.cat-subs { grid-column: 1 / -1; list-style: none; margin: 6px 0 0; padding: 8px 0 0; border-top: 1px solid var(--grid); font-size: var(--fs-sm); color: var(--ink-2); }
.cat-subs li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; font-variant-numeric: tabular-nums; }
form.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
dialog.modal form.row { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }

/* ---------- Indice di salute ---------- */
.hl-top { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.hl-score { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums;
  border: 8px solid var(--grid); color: var(--ink); }
.hl-score.lv-ok { border-color: var(--good); }
.hl-score.lv-warn { border-color: var(--warn); }
.hl-score.lv-bad { border-color: var(--bad); }
.hl-giud { font-size: var(--fs-xl); font-weight: 650; }
.hl-act { margin: 6px 0 0; color: var(--ink-2); }
.hl-subs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); margin-top: 18px; }
.hl-sub { appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 14px; padding: 14px; min-height: 44px; }
.hl-sub:hover { border-color: var(--axis); }
.hl-sub[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); }
.hl-sub:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hl-sub-n { font-weight: 600; }
.hl-sub-p { font-size: var(--fs-xl); font-weight: 650; font-variant-numeric: tabular-nums; }
.hl-sub .hl-bar { grid-column: 1 / -1; }
.hl-bar { display: block; height: 6px; background: var(--grid); border-radius: 999px; overflow: hidden; }
.hl-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.hl-det { margin-top: 14px; }
.hl-ind { list-style: none; margin: 0; padding: 0; }
.hl-ind li { padding: 12px 0; border-bottom: 1px solid var(--grid); }
.hl-ind li:last-child { border-bottom: 0; }
.hl-ind li.off p { color: var(--muted); }
.hl-ind-h { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.hl-ind p { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--ink-2); }
@media (max-width: 480px) { .hl-top { grid-template-columns: 1fr; justify-items: start; } .hl-score { width: 88px; height: 88px; font-size: 2.2rem; } }
