/* Presupuestos */
.bd-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bd-note { margin: 0; color: var(--muted); font-size: 13.5px; }
.bd-body { display: grid; gap: 20px; min-width: 0; }
.bd-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.bd-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); }
.bd-item {
  display: grid; gap: 12px; min-width: 0; padding: 16px 14px 14px 16px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.bd-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; }
.bd-name { margin: 0; min-width: 0; font-size: 16px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-pct { font-family: var(--font-display); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; color: var(--muted); }
.bd-item.is-warn .bd-pct { color: var(--amber); }
.bd-item.is-over .bd-pct { color: var(--red); }
:root[data-theme='light'] .bd-item.is-warn .bd-pct { color: #9A6200; }
:root[data-theme='light'] .bd-item.is-over .bd-pct { color: var(--neg); }

.bd-actions { display: flex; align-items: center; opacity: 0.55; transition: opacity 0.12s; }
.bd-item:hover .bd-actions, .bd-item:focus-within .bd-actions { opacity: 1; }
.bd-actions .icon-btn { width: 36px; height: 36px; }
.bd-actions .icon-btn:hover { background: var(--surface-3); }
@media (hover: none) { .bd-actions { opacity: 1; } }

.bd-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 13.5px; color: var(--muted); }
.bd-foot b { color: var(--text); font-weight: 650; }
.bd-left { font-weight: 600; color: var(--text); }
.bd-left.neg { color: var(--neg); }

.bd-free .section-head { margin-bottom: 12px; }
.bd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bd-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 40px; padding: 5px 14px 5px 6px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--input-bg); color: var(--text);
  font-size: 13.5px; font-weight: 550; transition: border-color 0.15s, background 0.15s;
}
.bd-chip:hover { border-color: var(--c); }
.bd-chip-ico { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 24%, transparent); color: var(--c); }
.bd-chip-ico .icon { width: 15px; height: 15px; }
.bd-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-chip-amt { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Panel del Resumen */
.bd-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.bd-title h2 { margin: 0; }
.bd-pills { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.bd-pills .pill { height: 24px; font-size: 12px; }
.bd-pill-over { background: rgba(255, 77, 106, 0.18); color: var(--neg); }
.bd-pill-warn { background: rgba(255, 176, 32, 0.2); color: var(--amber); }
:root[data-theme='light'] .bd-pill-warn { color: #8A5700; }
.bd-mini-list { display: grid; gap: 16px; }
.bd-mini { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; }
.bd-mini .meter { grid-column: 1 / -1; height: 8px; }
.bd-mini-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bd-mini-ico { width: 28px; height: 28px; flex: none; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c); }
.bd-mini-ico .icon { width: 15px; height: 15px; }
.bd-mini-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bd-mini-amt { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-more { margin: 0; color: var(--muted); font-size: 13.5px; }

@media (max-width: 560px) {
  .bd-summary { gap: 8px; }
  .bd-summary .stat { padding: 12px 10px; }
  .bd-summary .stat b { font-size: clamp(13px, 4vw, 17px); }
  .bd-toolbar .month-nav { flex: 1 1 100%; justify-content: space-between; }
  .bd-toolbar .month-label { flex: 1; min-width: 0; }
  .bd-toolbar .btn { flex: 1 1 100%; }
  .bd-item { padding: 14px 8px 12px 14px; }
}

@media (max-width: 380px) {
  .bd-summary { grid-template-columns: 1fr; }
  .bd-summary .stat { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  .bd-summary .stat b { font-size: 16px; }
  .bd-top { grid-template-columns: auto minmax(0, 1fr) auto; }
  .bd-actions { grid-column: 1 / -1; justify-self: end; margin: -6px 0 -4px; }
}
