/* Recorta: estilos propios. La base (tokens, botones, campos, diálogos, header, pie) está en appita.css. */

/* Resumen (componente ListRow: ap-stat) */
.summary { background: var(--app-soft); border: 0; border-radius: var(--radius-lg); padding: 20px 16px; margin-bottom: var(--space-4); }
.summary .big { font: 600 28px/32px var(--font-sans); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.summary .label { margin-top: 4px; font-size: 13px; line-height: 18px; color: var(--muted); }
.summary .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: var(--space-4); background: color-mix(in srgb, var(--app-strong) 18%, transparent); border-radius: var(--radius-md); overflow: hidden; }
.summary .grid div { background: var(--app-soft); padding: 10px 12px; min-width: 0; }
.summary .grid b { display: block; font: 500 15px/22px var(--font-sans); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.summary .grid span { font-size: 12px; line-height: 16px; color: var(--muted); }
.summary .note { margin-top: var(--space-4); font: 500 14px/20px var(--font-sans); color: var(--app-strong); }
.summary .sub-note { margin-top: 4px; font-size: 13px; line-height: 18px; color: var(--muted); }

.insights { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: var(--space-4); }
@media (min-width: 560px) { .insights.two { grid-template-columns: 1fr 1fr; } }
.insight { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4); font-size: 14px; line-height: 20px; }
.insight b { display: block; font: 600 15px/22px var(--font-sans); margin-bottom: 2px; }
.insight.save { background: var(--app-soft); border-color: transparent; }
.insight.saved b { color: var(--success); }
.insight.tip { color: var(--muted); }

/* Listas (componente ListRow) */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: var(--radius-pill); display: grid; place-items: center; background: var(--app-soft); color: var(--app-strong); font: 500 12px/1 var(--font-sans); text-transform: uppercase; }
.row .main { flex: 1; min-width: 0; }
.row .title { font: 500 15px/22px var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { color: var(--muted); font-size: 13px; line-height: 18px; }
.row .amount { text-align: right; font: 500 15px/22px var(--font-sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .amount small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; line-height: 16px; }
.sub-item { cursor: pointer; }
.sub-item:hover { background: var(--surface); box-shadow: inset 2px 0 0 var(--app-strong); margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
.sub-item.cancelled { opacity: .55; }
.sub-item.cancelled .title { text-decoration: line-through; }

.trial-alert { border-color: var(--danger); }
.trial-alert h2 { color: var(--danger); }

.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.toolbar select { border: 1px solid var(--line); background: none; color: var(--ink); border-radius: var(--radius-sm); padding: 0 10px; min-height: 36px; font: 500 13px/18px var(--font-sans); }

.bars .bar { margin: 12px 0; }
.bars .bar-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; line-height: 20px; }
.bars .track { height: 4px; background: var(--line); border-radius: var(--radius-pill); overflow: hidden; margin-top: 6px; }
.bars .fill { height: 100%; background: var(--app-strong); border-radius: inherit; }

details.cancelled-list summary { cursor: pointer; color: var(--muted); font: 500 14px/20px var(--font-sans); padding: 8px 0; }

/* Acción principal anclada abajo, al alcance del pulgar */
.fab { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); width: min(calc(100% - 32px), calc(var(--col) - 32px)); bottom: calc(16px + env(safe-area-inset-bottom)); }
.fab:active { transform: translateX(-50%) translateY(1px); }

/* Inicio (componente EmptyState): alineado a la izquierda */
.hero { display: grid; justify-items: start; gap: 16px; padding: 40px 0 32px; }
.hero h1 { font: 600 28px/34px var(--font-sans); letter-spacing: -0.025em; max-width: 18ch; }
.hero p { margin: 0; font-size: 16px; line-height: 26px; color: var(--muted); max-width: 420px; }
.guess { display: flex; gap: 8px; width: 100%; max-width: 420px; }
.guess input { flex: 1; min-width: 0; }

.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.cat-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); border: 1px solid var(--line); background: none; color: var(--ink); cursor: pointer; text-align: left; min-height: 52px; }
.cat-item:hover { border-color: var(--app-strong); background: var(--surface); }
.cat-item span { font: 500 14px/20px var(--font-sans); }

.rates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.link-list { display: grid; gap: 8px; margin: 8px 0 16px; }

/* Modo claro (colorido 2005): resumen a todo color, filas con divisor punteado */
[data-theme="light"] .summary { background: var(--app-strong); color: var(--on-app); border-radius: 18px; box-shadow: var(--shadow-card); }
[data-theme="light"] .summary .big { font-weight: 800; }
[data-theme="light"] .summary .label, [data-theme="light"] .summary .grid span, [data-theme="light"] .summary .sub-note { color: var(--on-app); opacity: .9; }
[data-theme="light"] .summary .grid { background: rgba(255,255,255,.3); }
[data-theme="light"] .summary .grid div { background: var(--app-strong); }
[data-theme="light"] .summary .note { color: var(--pop); font-weight: 700; }
[data-theme="light"] .insight { background: var(--surface); border: 2px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow-card); }
[data-theme="light"] .insight.save { background: var(--pop); color: var(--on-yellow); border-color: transparent; }
[data-theme="light"] .row { border-top: 2px dashed var(--line); }
[data-theme="light"] .row:first-child { border-top: 0; }
[data-theme="light"] .row .title, [data-theme="light"] .row .amount { font-weight: 700; }
[data-theme="light"] .sub-item:hover { background: var(--app-soft); }
[data-theme="light"] .avatar { font-weight: 700; }
[data-theme="light"] .trial-alert { border-color: var(--danger); }
[data-theme="light"] .toolbar select { border: 2px solid var(--line-strong); background: var(--surface); font-weight: 600; border-radius: var(--radius-pill); }
[data-theme="light"] .bars .track { height: 8px; background: var(--surface-2); }
[data-theme="light"] .hero h1 { font-weight: 800; letter-spacing: -0.03em; }
[data-theme="light"] .cat-item { background: var(--surface); border: 2px solid var(--line-strong); border-radius: 14px; }
[data-theme="light"] .cat-item:hover { background: var(--app-soft); border-color: var(--app-strong); }
[data-theme="light"] .cat-item span { font-weight: 600; }
