/* ==========================================================================
   Aureo — viste
   ========================================================================== */

/* --------------------------------------------------------------------------
   Intestazioni di pagina
   -------------------------------------------------------------------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 8px 0 24px;
  animation: rise 0.5s var(--ease) both;
}

.page-head-copy {
  min-width: 0;
}

.page-head .eyebrow {
  margin-bottom: 7px;
}

.page-head h1 {
  font-size: clamp(27px, 3.6vw, 38px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.page-head p {
  margin-top: 7px;
  font-size: 13.5px;
  color: var(--text-2);
  letter-spacing: -0.005em;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.greeting-name {
  background: linear-gradient(100deg, #fff 20%, color-mix(in srgb, var(--accent) 70%, white 30%));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* --------------------------------------------------------------------------
   Hero patrimonio
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 26px;
  padding: 30px 32px;
  border-radius: 26px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--accent) 19%, transparent), transparent 52%),
    radial-gradient(100% 130% at 100% 10%, rgba(191, 90, 242, 0.13), transparent 55%),
    linear-gradient(150deg, rgba(24, 24, 34, 0.94), rgba(10, 10, 15, 0.9));
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: rise 0.55s var(--ease) both;
}

.hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -100px;
  bottom: -200px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  filter: blur(70px);
  pointer-events: none;
}

.hero-main {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.48);
}

.hero-label .icon {
  color: var(--accent);
}

.hero-value {
  margin-top: 10px;
  font-size: clamp(38px, 5.4vw, 56px);
  font-weight: 680;
  letter-spacing: -0.055em;
  line-height: 1.02;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.hero-value .currency {
  font-size: 0.52em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: -0.02em;
  margin-right: 4px;
  vertical-align: 0.16em;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.hero-meta .pill {
  background: rgba(255, 255, 255, 0.08);
}

.hero-meta-text {
  font-size: 11.5px;
  color: var(--text-3);
}

.hero-splits {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero-split {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 128px;
  padding: 10px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.hero-split-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.hero-split-label .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.hero-split-value {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.hero-chart {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.hero-chart-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
}

.hero-chart .chart {
  min-height: 88px;
}

/* --------------------------------------------------------------------------
   KPI
   -------------------------------------------------------------------------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 16px;
  overflow: hidden;
  animation: rise 0.55s var(--ease) both;
}

.kpi:nth-child(1) { animation-delay: 0.04s; }
.kpi:nth-child(2) { animation-delay: 0.08s; }
.kpi:nth-child(3) { animation-delay: 0.12s; }

.kpi-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.005em;
}

.kpi-value {
  margin-top: -2px;
  font-size: clamp(23px, 2.6vw, 28px);
  font-weight: 650;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.kpi-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
}

.kpi-foot-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10.5px;
  color: var(--text-3);
}

.kpi-foot-copy .pill {
  align-self: flex-start;
}

.kpi-spark {
  width: 92px;
  height: 36px;
  flex-shrink: 0;
  opacity: 0.95;
}

/* --------------------------------------------------------------------------
   Layout dashboard
   -------------------------------------------------------------------------- */

.dash-row {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.dash-row-bottom {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}

.dash-row > .card {
  animation: rise 0.55s var(--ease) both;
  animation-delay: 0.1s;
}

.dash-row-bottom > .card {
  animation-delay: 0.16s;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 14px;
}

.section-head h2 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.section-head p {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-3);
}

.chart-card {
  padding: 22px 22px 14px;
  min-width: 0;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--text-2);
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart {
  position: relative;
  width: 100%;
}

.chart-svg {
  display: block;
  overflow: visible;
}

.chart-axis {
  fill: rgba(235, 235, 245, 0.36);
  font-family: var(--font);
  font-size: 9.8px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.chart-xlabel {
  fill: rgba(235, 235, 245, 0.46);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0.02em;
}

.chart-line {
  animation: chartIn 0.9s var(--ease) both;
}

.chart-area {
  animation: chartIn 1s var(--ease) both;
}

.chart-bar {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: barIn 0.75s var(--spring) both;
  transition: fill 0.2s;
}

.chart-hover-dot {
  transition: cx 0.08s linear, cy 0.08s linear;
}

.chart-crosshair {
  transition: opacity 0.15s;
  pointer-events: none;
}

.chart-tip {
  position: absolute;
  z-index: 6;
  min-width: 150px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(22, 22, 29, 0.94);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 11px;
  color: var(--text-2);
  opacity: 0;
  transform: translate(-50%, -100%);
  pointer-events: none;
  transition: opacity 0.12s var(--ease);
  white-space: nowrap;
}

.chart-tip.is-visible {
  opacity: 1;
}

.tip-title {
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}

.tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}

.tip-row span:nth-child(2) {
  margin-right: auto;
}

.tip-row b {
  color: var(--text);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  padding-left: 10px;
}

.tip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Donut
   -------------------------------------------------------------------------- */

.donut-card {
  padding: 22px 20px 16px;
  min-width: 0;
}

.donut-layout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.donut-figure {
  position: relative;
  width: min(196px, 58vw);
  aspect-ratio: 1;
  margin: 0 auto;
}

.donut-figure svg {
  width: 100%;
  height: 100%;
}

.donut-arc {
  transition: opacity 0.2s var(--ease), stroke-width 0.2s var(--ease);
  animation: arcIn 0.8s var(--ease) both;
  cursor: pointer;
}

.donut-arc:hover {
  stroke-width: 26;
}

.donut-arc.is-dim {
  opacity: 0.26;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
  padding: 0 34px;
  text-align: center;
}

.donut-center-label {
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.donut-center-value {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.legend-item {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 7px;
  width: 100%;
  padding: 6px 7px;
  border-radius: 8px;
  text-align: left;
  transition: background 0.16s var(--ease), opacity 0.16s var(--ease);
}

.legend-dot {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.legend-name {
  grid-column: 2;
  grid-row: 1;
}

.legend-value {
  grid-column: 2;
  grid-row: 2;
}

.legend-pct {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.legend-item:hover,
.legend-item:focus-visible {
  background: rgba(255, 255, 255, 0.05);
}

.legend-item.is-dim {
  opacity: 0.36;
}

.legend-name {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-value {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.legend-pct {
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  min-width: 27px;
  text-align: right;
}

/* --------------------------------------------------------------------------
   Movimenti
   -------------------------------------------------------------------------- */

.txn-list {
  display: flex;
  flex-direction: column;
}

.txn-day {
  margin-top: 4px;
}

.txn-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 12px 7px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--text-3);
}

.txn-day-total {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
  font-size: 11px;
  color: var(--text-3);
}

.txn-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 13px;
  text-align: left;
  transition: background 0.16s var(--ease);
}

.txn-row:hover,
.txn-row:focus-visible {
  background: rgba(255, 255, 255, 0.045);
}

.txn-main {
  min-width: 0;
}

.txn-desc {
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.txn-cat {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.txn-amount {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.txn-amount.income {
  color: var(--green);
}

.txn-amount.expense {
  color: var(--text);
}

.txn-arrow {
  color: var(--text-3);
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  margin-left: 2px;
  transform: translateX(-3px);
}

.txn-row:hover .txn-arrow {
  opacity: 1;
  transform: translateX(0);
}

.txn-row-compact .txn-desc {
  font-size: 12.5px;
}

/* Filtri movimenti */
.filters {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.search-box .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--field);
  font-size: 12.5px;
  color: var(--text);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.search-box input::placeholder {
  color: var(--text-3);
}

.search-box input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: rgba(118, 118, 128, 0.22);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-wrap .icon {
  position: absolute;
  right: 9px;
  color: var(--text-3);
  pointer-events: none;
}

.select {
  appearance: none;
  height: 36px;
  padding: 0 30px 0 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--field);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}

.select:hover {
  color: var(--text);
}

.select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.txn-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.summary-item {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.summary-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.summary-value {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.summary-item .pill {
  align-self: flex-start;
  margin-top: 2px;
}

.txn-panel {
  padding: 8px 10px 12px;
  min-width: 0;
}

.txn-panel .filters {
  margin: -8px -10px 8px;
  padding: 12px 14px;
}

.txn-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  gap: 10px;
}

.txn-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.txn-reset {
  font-size: 11px;
  font-weight: 600;
}

.txn-reset[hidden] {
  display: none;
}

.txn-count {
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .txn-head-hint {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Obiettivi
   -------------------------------------------------------------------------- */

.goals-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.goal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 20px;
  text-align: left;
  overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  animation: rise 0.55s var(--ease) both;
}

.goal-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 1), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.goal-card::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -70px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: var(--c, var(--accent));
  opacity: 0.11;
  filter: blur(36px);
  pointer-events: none;
}

.goal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.goal-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: var(--c, var(--accent));
  background: color-mix(in srgb, var(--c, var(--accent)) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 18%, transparent);
}

.goal-name {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.goal-amount {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.goal-amount strong {
  color: var(--text);
  font-weight: 650;
  font-size: 12.5px;
}

.goal-progress {
  margin-top: 16px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.goal-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c, var(--accent)) 75%, white 8%), var(--c, var(--accent)));
  box-shadow: 0 0 12px color-mix(in srgb, var(--c, var(--accent)) 45%, transparent);
  animation: progressIn 0.9s var(--ease) both;
}

.goal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
}

.goal-deadline {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-3);
}

.goal-pct {
  font-size: 11px;
  font-weight: 700;
  color: var(--c, var(--accent));
  font-variant-numeric: tabular-nums;
}

.goal-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 208px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.017);
  color: var(--text-3);
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s;
}

.goal-add:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  color: var(--accent);
  transform: translateY(-2px);
}

.goal-add-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.goal-add-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.savings-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 28px 30px;
  overflow: hidden;
  position: relative;
  animation: rise 0.55s var(--ease) both;
}

.savings-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 160% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%),
    radial-gradient(60% 120% at 0% 100%, rgba(48, 209, 88, 0.09), transparent 60%);
  pointer-events: none;
}

.savings-hero > * {
  position: relative;
  z-index: 1;
}

.savings-value {
  font-size: clamp(34px, 4.6vw, 48px);
  font-weight: 680;
  letter-spacing: -0.05em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.savings-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-2);
}

.savings-meta strong {
  color: var(--text);
  font-weight: 650;
}

.savings-progress {
  margin-top: 20px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  max-width: 520px;
}

.savings-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--teal));
  box-shadow: 0 0 18px rgba(48, 209, 88, 0.4);
  animation: progressIn 1s var(--ease) both;
}

.ring {
  --pct: 0%;
  --c: var(--accent);
  position: relative;
  display: grid;
  place-items: center;
  width: var(--size, 104px);
  height: var(--size, 104px);
  border-radius: 50%;
  background: conic-gradient(from -90deg, var(--c) var(--pct), rgba(255, 255, 255, 0.07) 0);
  flex-shrink: 0;
  animation: ringIn 1s var(--ease) both;
}

.ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #0c0c12;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ring-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.ring-value {
  font-size: calc(var(--size, 104px) * 0.18);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.ring-label {
  margin-top: 3px;
  font-size: calc(var(--size, 104px) * 0.082);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* --------------------------------------------------------------------------
   Analisi
   -------------------------------------------------------------------------- */

.insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.insight {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 17px 18px;
  animation: rise 0.55s var(--ease) both;
}

.insight:nth-child(2) { animation-delay: 0.05s; }
.insight:nth-child(3) { animation-delay: 0.1s; }

.insight-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  color: var(--c, var(--accent));
  background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent);
}

.insight-title {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.insight-text {
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.42;
  color: var(--text-2);
  letter-spacing: -0.005em;
}

.insight-text strong {
  color: var(--text);
  font-weight: 650;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.analysis-grid .span-2 {
  grid-column: span 2;
}

.category-list {
  display: flex;
  flex-direction: column;
}

.category-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.category-row:last-child {
  border-bottom: 0;
}

.category-main {
  min-width: 0;
}

.category-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
}

.category-name {
  font-weight: 550;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-amount {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}

.category-bar {
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.category-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--c, var(--accent));
  opacity: 0.85;
  animation: progressIn 0.8s var(--ease) both;
}

.category-delta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 54px;
  text-align: right;
}

.category-share {
  font-size: 10.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.category-delta .pill {
  font-size: 9.5px;
  padding: 2px 6px;
}

.biggest-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.biggest-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.biggest-row:last-child {
  border-bottom: 0;
}

.biggest-rank {
  width: 20px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.biggest-main {
  min-width: 0;
  flex: 1;
}

.biggest-desc {
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.biggest-meta {
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-3);
}

.biggest-amount {
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Impostazioni
   -------------------------------------------------------------------------- */

.privacy-page {
  overflow: auto;
}

.privacy-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

.privacy-content .page-head {
  margin-top: 0;
  flex-wrap: wrap;
}

.privacy-content h2 {
  margin: 24px 0 8px;
  font-size: 16px;
}

.privacy-content h2:first-child {
  margin-top: 0;
}

.privacy-content section p {
  margin: 0 0 12px;
  color: var(--text-2);
  line-height: 1.65;
}

.privacy-content section p:last-child {
  margin-bottom: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-card {
  padding: 22px;
  animation: rise 0.55s var(--ease) both;
}

.settings-card.span-2 {
  grid-column: span 2;
}

.settings-title {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.settings-sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.45;
}

.settings-body {
  margin-top: 18px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 21px;
}

.profile-fields {
  flex: 1;
  min-width: 0;
}

.swatches {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sw);
  border: 2px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.18s var(--ease), border-color 0.18s;
  position: relative;
}

.swatch:hover {
  transform: scale(1.1);
}

.swatch.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.swatch.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.setting-row:first-child {
  padding-top: 0;
}

.setting-label {
  font-size: 12.5px;
  font-weight: 550;
}

.setting-help {
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--text-3);
  line-height: 1.4;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 25px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.32);
  transition: background 0.22s var(--ease);
  cursor: pointer;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  transition: transform 0.22s var(--spring);
}

.switch input:checked + .switch-track {
  background: var(--green);
}

.switch input:checked + .switch-track::after {
  transform: translateX(17px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.about-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
}

.about-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.about-list .icon {
  color: var(--green);
  flex-shrink: 0;
  margin-top: 1px;
}

.info-box {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  margin-top: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-3);
}

.info-box .icon {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.name-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ==========================================================================
   Modali, form, toast
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  animation: overlayIn 0.22s ease both;
}

.modal-overlay.is-closing {
  animation: overlayOut 0.18s ease both;
  pointer-events: none;
}

.modal {
  position: relative;
  width: min(540px, 100%);
  max-height: min(88vh, 860px);
  max-height: min(88dvh, 860px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 24px 24px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background:
    radial-gradient(110% 80% at 50% 0%, rgba(255, 255, 255, 0.05), transparent 48%),
    linear-gradient(180deg, #15151b, #0b0b10);
  box-shadow: 0 50px 140px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: modalIn 0.4s var(--spring) both;
  scrollbar-width: none;
}

.modal::-webkit-scrollbar {
  display: none;
}

.modal.is-closing {
  animation: modalOut 0.18s ease both;
}

.modal-sm {
  width: min(420px, 100%);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 -24px 20px;
  padding: 24px 24px 16px;
  border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, rgba(21, 21, 27, 0.97), rgba(21, 21, 27, 0.88));
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.modal-head-copy {
  flex: 1;
  min-width: 0;
}

.modal-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.modal-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
  transition: background 0.16s, color 0.16s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.sheet-handle {
  display: none;
  position: absolute;
  top: 9px;
  left: 50%;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transform: translateX(-50%);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field > label {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.input,
.textarea,
.select-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(118, 118, 128, 0.16);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-3);
}

.input:focus,
.textarea:focus,
.select-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: rgba(118, 118, 128, 0.22);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.textarea {
  resize: vertical;
  min-height: 74px;
  line-height: 1.45;
}

.input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

.amount-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(118, 118, 128, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.075);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.amount-row:focus-within {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.amount-currency {
  font-size: 24px;
  font-weight: 650;
  color: var(--text-3);
  letter-spacing: -0.03em;
}

.amount-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.amount-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.amount-suffix {
  font-size: 12px;
  color: var(--text-3);
  align-self: flex-end;
  padding-bottom: 6px;
}

.type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: rgba(118, 118, 128, 0.18);
  border: 1px solid var(--line);
}

.type-toggle button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 33px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
  transition: background 0.18s, color 0.18s;
}

.type-toggle button:hover {
  color: var(--text-2);
}

.type-toggle button.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.type-toggle button[data-type="income"].is-active .icon {
  color: var(--green);
}

.type-toggle button[data-type="expense"].is-active .icon {
  color: var(--red);
}

.category-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.cat-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 4px 8px;
  min-height: 68px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-3);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.16s;
}

.cat-option .icon {
  color: var(--c);
  transition: transform 0.16s var(--spring);
}

.cat-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
}

.cat-option.is-active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--c) 42%, transparent);
  background: color-mix(in srgb, var(--c) 13%, transparent);
}

.cat-option.is-active .icon {
  transform: scale(1.12);
}

.form-error {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(255, 69, 58, 0.1);
  border: 1px solid rgba(255, 69, 58, 0.2);
  color: #ff8d85;
  font-size: 11.5px;
}

.form-error.is-visible {
  display: flex;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
}

.modal-actions .spacer {
  flex: 1;
}

.modal-actions .btn {
  height: 42px;
  border-radius: 12px;
}

.modal-actions .btn-primary {
  min-width: 120px;
}

.confirm-copy {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
}

.confirm-copy strong {
  color: var(--text);
  font-weight: 600;
}

/* Dettaglio obiettivo */
.detail-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}

.detail-hero-copy {
  flex: 1;
  min-width: 0;
}

.detail-label {
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
}

.detail-value {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.detail-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-3);
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.detail-stat {
  padding: 11px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-stat strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.contrib-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  max-height: 224px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.contrib-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.contrib-row:last-child {
  border-bottom: 0;
}

.contrib-date {
  font-size: 11px;
  color: var(--text-3);
  min-width: 78px;
}

.contrib-note {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contrib-amount {
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.contrib-remove {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--text-3);
  opacity: 0.6;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.contrib-remove:hover {
  opacity: 1;
  color: var(--red);
  background: rgba(255, 69, 58, 0.1);
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 4px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
}

.icon-picker {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.icon-choice {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.icon-choice:hover {
  color: var(--text);
}

.icon-choice.is-active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft);
}

/* Toast */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px 10px 13px;
  border-radius: 12px;
  background: rgba(28, 28, 35, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 20px 50px -16px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 550;
  animation: toastIn 0.35s var(--spring) both;
}

.toast .icon {
  color: var(--green);
  flex-shrink: 0;
}

.toast.is-leaving {
  animation: toastOut 0.25s ease both;
}

.toast-tone-error .icon {
  color: var(--red);
}

.toast-tone-info .icon {
  color: var(--accent);
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes overlayOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes modalOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(10px) scale(0.985); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(8px); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (min-width: 1200px) {
  .dash-row .donut-layout { flex-direction: row; align-items: center; gap: 14px; }
  .dash-row .donut-figure { width: 132px; margin: 0; flex: 0 0 132px; }
  .dash-row .donut-legend { flex: 1; min-width: 0; }
}

@media (max-width: 1240px) {
  :root { --sidebar-w: 236px; }
  .view { padding-left: 26px; padding-right: 26px; }
  .topbar { padding-left: 26px; padding-right: 26px; }
  .goal-card { padding: 18px; }
  .savings-hero { padding: 24px; }
}

@media (max-width: 1199px) {
  .dash-row { grid-template-columns: minmax(0, 1fr); }
  .dash-row .donut-layout { flex-direction: row; align-items: center; gap: 18px; }
  .dash-row .donut-figure { width: 180px; margin: 0; flex-shrink: 0; }
  .dash-row .donut-legend { flex: 1; }
}

@media (min-width: 721px) and (max-width: 1199px) {
  .dash-row .donut-layout { justify-content: center; gap: 26px; }
  .dash-row .donut-legend { flex: 0 1 360px; }
}

@media (max-width: 1080px) {
  .hero-splits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .hero-split { min-width: 0; padding: 10px 12px; }
  .goals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insights { grid-template-columns: 1fr; }
  .insight { padding: 14px 16px; }
  .analysis-grid { grid-template-columns: minmax(0, 1fr); }
  .analysis-grid .span-2 { grid-column: span 1; }
}

@media (max-width: 920px) {
  :root { --sidebar-w: 0px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { height: 100dvh; }
  .tabbar { display: block; }
  .view { padding: 4px 20px calc(110px + env(safe-area-inset-bottom)); }
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions" "month month";
    align-items: center;
    padding: 12px 20px;
    column-gap: 10px;
    row-gap: 8px;
    min-height: 62px;
    background: linear-gradient(to bottom, rgba(5, 5, 7, 0.93) 30%, rgba(5, 5, 7, 0.72) 75%, rgba(5, 5, 7, 0));
  }
  .topbar-context { display: none; }
  .topbar-mobile-brand { display: flex; grid-area: brand; }
  .topbar-actions { margin-left: 0; gap: 8px; grid-area: actions; justify-self: end; }
  .topbar .month-nav {
    grid-area: month;
    width: 100%;
    justify-content: space-between;
    margin-top: 0;
    background: rgba(118, 118, 128, 0.12);
  }
  .topbar .month-label { flex: 1; font-size: 12px; }
  .topbar .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
  .topbar .btn-primary { height: 34px; padding: 0 12px; font-size: 11.5px; border-radius: 10px; }
  .topbar .btn-primary .btn-label { display: none; }
  .topbar .btn-primary .icon { margin: 0; }
  .page-head { margin-top: 12px; margin-bottom: 20px; }
  .page-head h1 { font-size: 27px; }
  .page-head-actions .btn-label { display: none; }
  .page-head-actions .btn { padding: 0 11px; }
  .hero { padding: 24px; }
  .hero-chart-label { display: none; }
  .toast-root { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .modal-overlay {
    place-items: end center;
    padding: 0;
    align-items: end;
  }
  .modal {
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    padding: 0 20px calc(20px + env(safe-area-inset-bottom));
    animation: sheetIn 0.42s var(--spring) both;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .modal.is-closing { animation: sheetOut 0.2s ease both; }
  .modal-head {
    margin: 0 -20px 16px;
    padding: 27px 20px 14px;
    border-radius: 24px 24px 0 0;
  }
  .sheet-handle { display: block; }
  .amount-input { font-size: 27px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .modal-actions { position: sticky; bottom: 0; padding-top: 10px; background: linear-gradient(to top, #0b0b10 70%, transparent); }
  .category-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-card.span-2 { grid-column: span 1; }
}

@keyframes sheetIn {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes sheetOut {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

@media (max-width: 720px) {
  .view { padding-left: 16px; padding-right: 16px; }
  .topbar { padding-left: 16px; padding-right: 16px; }
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .hero-chart { max-width: 100%; }
  .hero-chart .chart { min-height: 70px; }
  .kpi-grid { grid-template-columns: 1fr; gap: 12px; }
  .kpi {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "top spark" "value spark" "foot foot";
    align-items: center;
    gap: 8px 14px;
    padding: 16px 18px;
  }
  .kpi-top { grid-area: top; }
  .kpi-value { grid-area: value; }
  .kpi-spark { grid-area: spark; width: 104px; height: 46px; }
  .kpi-foot { grid-area: foot; min-height: 0; }
  .goals-grid { grid-template-columns: 1fr; }
  .goal-card { padding: 18px; }
  .txn-summary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .summary-item:last-child { grid-column: span 2; }
  .filters { gap: 8px; }
  .search-box { flex-basis: 100%; }
  .segmented { flex: 1; }
  .segmented button { flex: 1; }
  .select-wrap { flex: 1; }
  .select { width: 100%; }
  .dash-row .donut-layout { flex-direction: column; }
  .dash-row .donut-figure { width: min(190px, 60vw); margin: 0 auto; }
  .detail-stats { grid-template-columns: 1fr 1fr; }
  .detail-stats .detail-stat:last-child { grid-column: span 2; }
  .modal-actions .btn { flex: 1; }
  .modal-actions .btn-danger { flex: 0 0 auto; }
  .settings-actions .btn { flex: 1; }
  .category-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .savings-hero { padding: 22px; grid-template-columns: 1fr; gap: 20px; }
  .ring-big { justify-self: start; }
  .page-head { flex-wrap: wrap; align-items: flex-start; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; }
  .page-head-actions .btn .btn-label { display: inline; }
  .page-head-actions .btn-primary { flex: 1; }
  .topbar .month-nav { display: flex; }
}

@media (max-width: 480px) {
  .hero-value { font-size: 36px; }
  .hero-splits { display: grid; grid-template-columns: 1fr 1fr; }
  .hero-split { min-width: 0; }
  .hero-split:last-child { grid-column: span 2; }
  .hero { padding: 20px; border-radius: 22px; }
  .page-head h1 { font-size: 24px; }
  .page-head p { font-size: 12.5px; }
  .kpi-spark { width: 82px; }
  .txn-row { padding: 8px 6px; gap: 10px; grid-template-columns: 36px minmax(0, 1fr) auto; }
  .txn-desc { font-size: 12.5px; }
  .txn-amount { font-size: 12.5px; }
  .txn-arrow { display: none; }
  .donut-legend { width: 100%; }
  .legend-pct { display: none; }
  .category-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .amount-input { font-size: 25px; }
  .modal { padding-left: 16px; padding-right: 16px; }
  .modal-head { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .savings-meta { gap: 6px 14px; font-size: 11px; }
}

/* Riduzione del movimento */
html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-delay: 0ms !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Completamenti
   -------------------------------------------------------------------------- */

.topbar-settings {
  display: none;
}

.goal-mini-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.goal-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 8px;
  border-radius: 12px;
  text-align: left;
  transition: background 0.16s var(--ease);
}

.goal-mini:hover {
  background: rgba(255, 255, 255, 0.04);
}

.goal-mini .cat-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.goal-mini-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.goal-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.goal-mini-name {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.goal-mini-pct {
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.goal-mini .goal-progress {
  display: block;
  margin-top: 6px;
  height: 4px;
}

.goal-mini-sub {
  display: block;
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.tip-extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-3);
}

.tip-extra b {
  color: var(--text-2);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.quick-amount {
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.quick-amount:hover {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
}

.biggest-row {
  width: 100%;
  text-align: left;
  border-radius: 10px;
  transition: background 0.16s;
}

.biggest-row:hover {
  background: rgba(255, 255, 255, 0.045);
}

.biggest-desc,
.biggest-meta {
  display: block;
}

.goal-card .pill {
  font-size: 9.5px;
  white-space: nowrap;
}

.goal-card .goal-deadline {
  column-gap: 4px;
}

.goal-pct {
  white-space: nowrap;
}

.search-box input::-webkit-search-cancel-button {
  filter: invert(1);
  opacity: 0.45;
  cursor: pointer;
}

.info-box strong {
  color: var(--text-2);
  font-weight: 600;
}

@media (max-width: 920px) {
  .topbar-settings {
    display: grid;
  }
}

@media (max-width: 480px) {
  .goal-foot {
    flex-wrap: wrap;
  }
  .goal-pct {
    font-size: 10px;
  }
  .quick-amount {
    flex: 1;
  }
}

.kpi .kpi-spark {
  width: 92px;
  height: 36px;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .kpi .kpi-spark {
    width: 108px;
    height: 46px;
  }
}

@media (max-width: 480px) {
  .kpi .kpi-spark {
    width: 86px;
  }
}
