/* Paneles del Resumen: metas, deudas, contratos y recurrentes */

.ov-group { min-width: 0; }
.ov-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: stretch; }

.ov-panel { container-type: inline-size; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.ov-head { margin: 0; align-items: center; }
.ov-title { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 17px; }
.ov-title > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.ov-title-ico { width: 32px; height: 32px; flex: none; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--violet) 20%, transparent); color: var(--violet); }
.ov-title-ico .icon { width: 17px; height: 17px; }
:root[data-theme='light'] .ov-title-ico { color: #5B3FD9; }
.ov-head > a { flex: none; }

/* Cifras de cabecera */
.ov-stats { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ov-stat { min-width: 0; padding: 12px; border-radius: 16px; background: var(--input-bg); border: 1px solid var(--line); }
.ov-stat small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.ov-stat b { display: block; margin-top: 2px; font-family: var(--font-display); font-size: clamp(14px, 2.2vw, 16px); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-stat b.pos { color: var(--pos); }
.ov-stat b.neg { color: var(--neg); }
@container (max-width: 400px) {
  .ov-stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-stats-3 > :last-child { grid-column: 1 / -1; }
}
@container (max-width: 310px) {
  .ov-stats-3 { grid-template-columns: minmax(0, 1fr); }
  .ov-stats-3 > :last-child { grid-column: auto; }
  .ov-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  .ov-stat b { margin-top: 0; }
}

/* Listas */
.ov-sub-title { margin: 0 0 -6px; font-family: var(--font-body); font-size: 12.5px; font-weight: 650; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
.ov-list { display: grid; gap: 18px; }
.ov-more { margin: 0; color: var(--muted); font-size: 13.5px; }
.ov-fail { margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--input-bg); border: 1px dashed var(--line); color: var(--muted); font-size: 14px; }

.ov-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; min-width: 0; }
.ov-row .meter { grid-column: 2 / -1; height: 8px; }
.ov-note { grid-column: 2 / -1; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ov-ico { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--violet)) 22%, transparent); color: var(--c, var(--violet)); }
.ov-ico .icon { width: 19px; height: 19px; }
.ov-text { min-width: 0; display: grid; gap: 1px; }
.ov-text > b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ov-side > .ov-sub { white-space: nowrap; }
.ov-side { min-width: 0; display: grid; justify-items: end; gap: 1px; text-align: right; }
.ov-side > b { font-family: var(--font-display); font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-side > b.pos { color: var(--pos); }
.ov-side > b.neg { color: var(--neg); }
.ov-pct { font-size: 17px; }

/* Metas: mismo color de tema que en su pantalla */
.ov-goal .ov-ico { background: var(--g); color: #fff; }
.ov-goal.theme-noir .ov-ico { border: 1px solid var(--line); }
.ov-goal .meter > i { background: var(--g); }
.ov-goal.theme-noir .meter > i { background: var(--muted); }
.ov-goal.is-done .ov-ico { background: var(--mint); color: #04332E; }
.ov-goal.is-done .meter > i { background: var(--mint); }

/* Deudas */
.ov-debt .ov-ico { background: rgba(255, 77, 106, 0.16); color: var(--neg); }
.ov-debt.is-owed .ov-ico { background: rgba(24, 227, 160, 0.16); color: var(--pos); }
.ov-debt.is-owed .meter > i { background: var(--mint); }
.ov-debt .ov-side > .ov-sub, .ov-contract .ov-side > .ov-sub { font-size: 12.5px; }

/* Contratos */
.ov-contract .ov-ico { background: color-mix(in srgb, var(--cyan) 18%, transparent); color: var(--cyan); }
:root[data-theme='light'] .ov-contract .ov-ico { color: #2F55E0; }
.ov-contract.is-urgent .ov-text .ov-sub, .ov-contract.is-urgent .ov-side > .ov-sub { color: var(--amber); }
:root[data-theme='light'] .ov-contract.is-urgent .ov-text .ov-sub,
:root[data-theme='light'] .ov-contract.is-urgent .ov-side > .ov-sub { color: #9A6200; }

/* Recurrentes: se apoyan en el color de la categoría */

/* Estado vacío */
.ov-empty { flex: 1; display: grid; justify-items: center; align-content: center; gap: 6px; text-align: center; padding: 14px 8px 6px; color: var(--muted); }
.ov-empty-ico { width: 52px; height: 52px; margin-bottom: 6px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-3); color: var(--text); }
.ov-empty-ico .icon { width: 24px; height: 24px; }
.ov-empty b { color: var(--text); font-family: var(--font-display); font-size: 16px; }
.ov-empty p { max-width: 300px; font-size: 14px; }
.ov-empty .btn { margin-top: 10px; }

@media (max-width: 560px) {
  .ov-grid { gap: 18px; }
  .ov-panel { gap: 16px; }
  .ov-stat { padding: 10px 12px; }
}
