/* Страница фондов: тулбар, donut-диаграмма + легенда (refero light) */

/* .toolbar наследуется из app.css; переопределяем специфику */
.toolbar { justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-5); border-bottom: none; padding-bottom: 0; }

.month-nav {
  display: flex; align-items: center; gap: var(--sp-2);
  font-family: var(--ff-mono); font-size: .85rem; color: var(--text);
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--r-pill);
}
.month-nav button {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 4px 12px;
  cursor: pointer;
  font-family: var(--ff-mono);
  font-size: .85rem;
  border-radius: var(--r-pill);
  line-height: 1;
}
.month-nav button:hover { color: var(--text); background: var(--surface); }
.month-label { min-width: 100px; text-align: center; color: var(--text); padding: 0 var(--sp-2); }

.upload-btn {
  background: var(--text-strong);
  border: 1px solid var(--text-strong);
  color: var(--bg);
  padding: 8px 16px;
  cursor: pointer;
  font-family: var(--ff-sans);
  font-size: .85rem;
  font-weight: 500;
  border-radius: var(--r-btn);
  transition: background .12s;
}
.upload-btn:hover { background: var(--text); }
#file-input { display: none; }
.upload-result { font-family: var(--ff-mono); font-size: .75rem; color: var(--muted); margin-left: var(--sp-3); }

.summary-of { color: var(--muted); font-weight: 400; }

/* === Donut layout === */
.funds-layout {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: var(--sp-6);
  align-items: start;
  margin-bottom: var(--sp-5);
}
@media (max-width: 760px) {
  .funds-layout { grid-template-columns: 1fr; }
}
.funds-donut-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--sp-4);
}
#funds-donut { width: 100%; height: 360px; }

/* === Legend list === */
.funds-legend {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--sp-3) var(--sp-4);
  display: flex; flex-direction: column;
}
.legend-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: var(--sp-2) 0 var(--sp-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-2);
}
.legend-head-label {
  font-family: var(--ff-mono); font-size: .72rem; color: var(--muted);
  letter-spacing: -.01em;
}
/* t-num-lg — крупная сумма в шапке легенды */
.legend-head-value {
  font-family: var(--ff-mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
.legend-head-value .frac { font-size: var(--fs-num-frac); opacity: .5; font-weight: 400; }

.legend-row {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--ff-mono); font-size: .8rem;
}
.legend-row:last-child { border-bottom: none; }

.legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block;
}
.legend-dot-muted {
  background: transparent;
  border: 1px dashed var(--muted-2);
}
.legend-name {
  color: var(--text); letter-spacing: -.01em;
  display: flex; align-items: baseline; gap: var(--sp-2);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.legend-card {
  color: var(--muted-2); font-size: .68rem;
}
.legend-flag {
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--negative); color: #fff;
  font-family: var(--ff-mono); font-size: .68rem; font-weight: 600;
  border-radius: var(--r-pill); line-height: 1;
}
.legend-right {
  display: inline-flex; align-items: baseline; gap: var(--sp-3);
  font-variant-numeric: tabular-nums;
}
.legend-amount {
  color: var(--text-strong); font-weight: 500;
}
.legend-amount .frac { font-size: var(--fs-num-frac); opacity: .5; margin-left: 1px; font-weight: 400; }
.legend-amount-muted { color: var(--muted-2); font-weight: 400; }
.legend-pct {
  color: var(--muted); min-width: 32px; text-align: right;
}

.legend-row-muted .legend-name { color: var(--muted); }

/* Empty section (фонды без расходов) */
.funds-empty-section { margin-bottom: 40px; }
.funds-empty-toggle {
  background: transparent; border: none; cursor: pointer;
  font-family: var(--ff-mono); font-size: .78rem; color: var(--muted);
  padding: var(--sp-2) 0; margin-bottom: var(--sp-2);
  display: inline-flex; align-items: center; gap: var(--sp-2);
  letter-spacing: -.01em;
}
.funds-empty-toggle:hover { color: var(--text); }
.funds-empty-chevron { font-size: .7rem; }
.funds-legend-empty { padding: var(--sp-2) var(--sp-4); }
