/* Che Finanzas — tipografía y estilo alineados al dashboard (responsive) */
:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --accent-in: #059669;
    --accent-out: #dc2626;
    --accent-balance: #2563eb;
    --accent-cta: #2563eb;
    --radius: 14px;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
    --font-body: 'Source Sans 3', system-ui, sans-serif;
    --font-display: Outfit, system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text);
    background: linear-gradient(165deg, #0f172a 0%, #1e293b 38%, #f1f5f9 38%, #e2e8f0 100%);
    background-attachment: fixed;
}

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.25rem clamp(1rem, 3vw, 1.5rem) 3rem;
}

.wrap--narrow {
    max-width: 520px;
}

.wrap--medios {
    max-width: 880px;
}

/* Hero (título claro sobre gradiente oscuro) */
.hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.hero h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.45rem, 4vw, 1.75rem);
    color: #f8fafc;
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}

.hero p,
.hero .hero-sub {
    margin: 0;
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.45;
}

.hero--nav-only {
    margin-bottom: 0;
    justify-content: flex-end;
}

.perfil-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

/* Panel de contenido perfil: fondo sólido, alineado al dashboard */
.perfil-sheet {
    background: var(--card);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(1.15rem, 3vw, 1.75rem);
    margin-bottom: 2rem;
}

.perfil-sheet__grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .perfil-sheet__grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 28rem);
        gap: clamp(1.5rem, 4vw, 2.5rem);
        align-items: start;
        justify-content: space-between;
    }

    .perfil-sheet__form {
        justify-self: end;
        width: 100%;
        max-width: 28rem;
    }
}

.perfil-sheet__aside {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.perfil-sheet__aside-title {
    margin: 0 0 0.5rem;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.perfil-card {
    background: #fafbfc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: clamp(1rem, 2.5vw, 1.5rem);
}

.perfil-card__head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.perfil-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: 10px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.1rem;
}

.perfil-card__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.perfil-card__sub {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.perfil-field {
    margin-bottom: 1rem;
}

.perfil-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
}

.perfil-field select {
    width: 100%;
    max-width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--text);
    background: #fff;
}

.perfil-field select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.perfil-field .hint {
    margin: 0.4rem 0 0;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.4;
}

.perfil-field .hint--warn {
    color: #b45309;
}

.perfil-actions {
    display: flex;
    justify-content: stretch;
    margin-top: 1.25rem;
    padding-top: 1.15rem;
    border-top: 1px solid #e2e8f0;
}

@media (min-width: 768px) {
    .perfil-actions {
        justify-content: flex-end;
    }
}

.perfil-actions .btn-cyan {
    width: 100%;
}

@media (min-width: 768px) {
    .perfil-actions .btn-cyan {
        width: auto;
        min-width: 11rem;
    }
}

.perfil-toast {
    display: none;
    position: fixed;
    z-index: 50;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: 20rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.perfil-toast--visible {
    display: block;
}

@media (min-width: 768px) {
    .perfil-toast--visible {
        left: auto;
        right: 2rem;
        transform: none;
    }
}

.hero-nav__links a.is-active {
    color: #f8fafc;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem 1rem;
}

.actions a {
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    line-height: 1.1;
}

.actions a:hover {
    color: #fff;
    background: rgba(148, 163, 184, 0.24);
    border-color: rgba(148, 163, 184, 0.45);
}

/* Navegación del hero: menú compacto en pantallas anchas; hamburguesa en móvil */
.hero-nav {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
}

.hero-nav__burger {
    display: none;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    user-select: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.88rem;
    color: #f8fafc;
    background: rgba(148, 163, 184, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 10px;
    padding: 0.45rem 0.85rem;
    line-height: 1;
}

.hero-nav__burger:hover {
    background: rgba(148, 163, 184, 0.3);
}

.hero-nav__state:focus-visible + .hero-nav__burger {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

@media (max-width: 720px) {
    .hero-nav {
        width: 100%;
        justify-content: flex-start;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .hero-nav__burger {
        display: inline-flex;
    }

    .hero-nav__links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        width: 100%;
        max-width: 16rem;
        padding: 0.5rem;
        margin: 0;
        background: rgba(15, 23, 42, 0.97);
        border: 1px solid rgba(148, 163, 184, 0.35);
        border-radius: 12px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
        z-index: 40;
    }

    .hero-nav__links a {
        text-align: center;
        white-space: normal;
    }

    .hero-nav__state:checked ~ .hero-nav__links {
        display: flex;
    }
}

@media (min-width: 721px) {
    .hero-nav__burger {
        display: none !important;
    }

    .hero-nav__links {
        display: flex !important;
        flex-wrap: nowrap;
        gap: 0.4rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.2rem;
        margin: 0;
        max-width: min(100%, 38rem);
        justify-content: flex-end;
    }

    .hero-nav__links a {
        font-size: 0.78rem;
        padding: 0.32rem 0.55rem;
        flex-shrink: 0;
    }
}

/* Barra de filtros tipo dashboard */
.month-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    background: rgba(30, 41, 59, 0.85);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    border: 1px solid rgba(148, 163, 184, 0.2);
    margin-bottom: 1rem;
}

.month-nav__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem 0.65rem;
}

.month-nav__field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.28rem;
    min-width: 0;
}

.month-nav__field label {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.month-nav__field select {
    width: 100%;
    min-width: 0;
    font-family: inherit;
    font-size: 0.88rem;
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
    border: 1px solid #475569;
    background: #0f172a;
    color: #f1f5f9;
}

.month-nav__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding-top: 0.15rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.filters-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem 0.75rem;
    flex-wrap: wrap;
    background: rgba(30, 41, 59, 0.85);
    padding: 0.65rem 1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(148, 163, 184, 0.2);
    margin-bottom: 1rem;
}

.filters-bar label {
    color: #cbd5e1;
    font-size: 0.85rem;
}

.filters-bar select {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #475569;
    background: #0f172a;
    color: #f1f5f9;
    width: auto;
    max-width: 100%;
    min-width: 8.75rem;
    flex: 0 0 auto;
}

.month-nav .btn,
.filters-bar .btn,
a.btn,
button.btn {
    display: inline-block;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    background: #334155;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.month-nav .btn:hover,
a.btn:hover,
button.btn:hover {
    background: #475569;
}

.month-nav .btn.disabled,
.btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Tarjetas / cajas de contenido */
.card,
.box {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(15, 23, 42, 0.06);
    margin-bottom: 1rem;
}

.card h2,
.box h2 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.85rem;
    color: var(--text);
}

.chart-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.1rem 1rem 1rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.chart-card h2 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: var(--text);
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

@media (max-width: 720px) {
    .cards {
        grid-template-columns: 1fr;
    }

    .cards.cards--kpi {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .month-nav__grid {
        grid-template-columns: 1fr;
    }
}

.card strong,
.box strong {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.card .amt,
.box .amt {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
}

.card .amt.in,
.box .amt.in {
    color: var(--accent-in);
}

.card .amt.out,
.box .amt.out {
    color: var(--accent-out);
}

.card .amt.balance,
.box .amt.balance {
    color: var(--accent-balance);
}

.cards--kpi .card {
    padding: 0.55rem 0.5rem;
    margin-bottom: 0;
}

.cards--kpi .card strong {
    font-size: 0.62rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.card .amt.amt--kpi {
    font-size: clamp(0.8rem, 2.5vw, 1.15rem);
}

/* Resumen UYU | USD en una sola tarjeta (modo Todas las monedas) */
.summary-dual {
    padding: 0.75rem 0.85rem;
}

.summary-dual__head,
.summary-dual__row {
    display: grid;
    grid-template-columns: minmax(4.2rem, 1.1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.35rem 0.45rem;
    align-items: baseline;
}

.summary-dual__head {
    margin: 0 0 0.4rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #e2e8f0;
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
}

.summary-dual__corner {
    min-width: 0;
}

.summary-dual__cur {
    text-align: right;
    font-weight: 700;
    color: var(--muted);
}

.summary-dual__row + .summary-dual__row {
    margin-top: 0.2rem;
}

.summary-dual__label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text);
}

.summary-dual .amt.amt--dual {
    display: block;
    text-align: right;
    font-family: var(--font-display);
    font-size: clamp(0.78rem, 2.6vw, 0.92rem);
    font-weight: 700;
    line-height: 1.2;
}

.summary-dual__amt {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tx-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.tx-badge--ingreso {
    background: rgba(5, 150, 105, 0.22);
    color: #34d399;
}

.tx-badge--egreso {
    background: rgba(220, 38, 38, 0.18);
    color: #f87171;
}

.tx-badge--transferencia {
    background: rgba(99, 102, 241, 0.22);
    color: #93c5fd;
}

.tx-amt {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.tx-amt--ingreso {
    color: #34d399;
}

.tx-amt--egreso {
    color: #f87171;
}

.tx-amt--transferencia {
    color: #93c5fd;
    font-weight: 600;
}

.charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.charts--dashboard {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
}

.charts--dashboard .chart-card--fill {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.charts--dashboard .chart-card--fill .chart-wrap--trend {
    flex: 1 1 auto;
    min-height: 260px;
    height: auto;
}

@media (max-width: 900px) {
    .charts,
    .charts--dashboard {
        grid-template-columns: 1fr;
    }

    .charts--dashboard .chart-card--fill .chart-wrap--trend {
        flex: none;
        height: 260px;
    }
}

.chart-wrap {
    position: relative;
    height: 260px;
}

.chart-wrap--trend {
    height: 260px;
}

.chart-wrap.chart-wrap--hbar {
    height: auto;
}

.chart-wrap canvas {
    max-width: 100% !important;
}

.chart-wrap.donut {
    height: 240px;
    max-width: 280px;
    margin: 0 auto;
}

.chart-card__sub {
    margin: -0.35rem 0 0.75rem;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.4;
}

.chart-card--saldos {
    display: flex;
    flex-direction: column;
}

.saldos-list {
    list-style: none;
    margin: 0 0 0.85rem;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
}

.saldos-list__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.35rem 0.75rem;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.saldos-list__item:last-child {
    border-bottom: 0;
}

.saldos-list__item--principal {
    background: rgba(13, 148, 136, 0.06);
}

.saldos-list__name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    min-width: 0;
}

.saldos-list__star {
    color: #0d9488;
    margin-left: 0.2rem;
}

.saldos-list__amt {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.saldos-list__amt--solo {
    grid-column: 2 / -1;
}

.saldos-list__amt small {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted);
    margin-left: 0.15rem;
}

.saldos-list__amt--pos {
    color: #059669;
}

.saldos-list__amt--neg {
    color: #dc2626;
}

.chart-wrap--hbar {
    min-height: 168px;
}

.chart-wrap--line {
    height: 260px;
}

.chart-card--saldos .chart-wrap--line {
    flex: 1 1 auto;
    min-height: 200px;
    height: auto;
}

.chart-card--saldos {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chart-wrap--saldos {
    margin-top: 0.15rem;
}

@media (max-width: 520px) {
    .saldos-list__item {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .saldos-list__amt,
    .saldos-list__amt--solo {
        text-align: left;
        grid-column: 1;
    }
}

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 900px) {
    .row-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .filters-bar select {
        min-width: 7.3rem;
    }
}

@media (max-width: 560px) {
    .month-nav__actions .btn {
        padding: 0.4rem 0.65rem;
        font-size: 0.8rem;
    }

    .chart-wrap {
        height: 230px;
    }

    .chart-wrap.donut {
        height: 210px;
    }
}

h2.section {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin: 0 0 0.75rem;
    color: var(--text);
}

/* Tablas */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--card);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    background: var(--card);
}

th,
td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    font-size: 0.9rem;
}

th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

tr:last-child td {
    border-bottom: 0;
}

.empty-charts {
    color: var(--muted);
    font-size: 0.9rem;
    padding: 1rem 0;
    text-align: center;
}

/* Formularios */
label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='date'],
input[type='tel'],
select,
textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
}

textarea {
    min-height: 5rem;
    resize: vertical;
}

.form-grid,
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

@media (max-width: 480px) {
    .form-grid,
    .grid {
        grid-template-columns: 1fr;
    }
}

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

.grid-span-3 {
    grid-column: span 3;
}

@media (max-width: 720px) {
    .grid-span-2,
    .grid-span-3 {
        grid-column: span 1;
    }
}

.mt-1 {
    margin-top: 0.7rem;
}

.mb-select {
    margin-bottom: 0.35rem;
}

.hint,
.muted {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
    margin: 0.35rem 0 0;
}

button[type='submit'],
.btn-primary {
    margin-top: 0.65rem;
    padding: 0.65rem 1.25rem;
    border: 0;
    border-radius: 8px;
    background: var(--accent-cta);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
}

button[type='submit']:hover,
.btn-primary:hover {
    filter: brightness(1.05);
}

button.secondary,
.btn-secondary {
    background: #64748b;
    color: #fff;
}

button.danger,
.btn-danger {
    background: #b91c1c;
    color: #fff;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 0.5rem;
}

.filters label {
    display: block;
    font-size: 0.8rem;
    color: #cbd5e1;
    margin-bottom: 0.2rem;
}

.card .filters label,
.box .filters label {
    color: var(--muted);
}

.filters button.secondary {
    background: #64748b;
    margin-top: 0;
}

.row-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.row-actions form {
    display: inline;
    margin: 0;
}

.row-actions button {
    margin-top: 0;
}

.dash-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.dash-actions form {
    margin: 0;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.95rem;
    height: 1.95rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    text-decoration: none;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.icon-btn--edit:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.icon-btn--delete:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.icon-btn__glyph {
    font-size: 0.95rem;
    line-height: 1;
    font-weight: 600;
}

/* Tabla movimientos — inline edit + hover */
/* Transacciones: vista dual tabla / tarjetas (fallback si Tailwind CDN no carga) */
@media (max-width: 767.98px) {
    .table-wrap--mov.tx-desktop-only {
        display: none !important;
    }
}

@media (min-width: 768px) {
    #tx-mobile-list.tx-mobile-only,
    #dash-mobile-list.tx-mobile-only {
        display: none !important;
    }
}

#tx-mobile-list button[type='submit'],
#tx-mobile-list button[type='button'],
#dash-mobile-list button[type='submit'],
#dash-mobile-list button[type='button'] {
    margin-top: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-weight: 400;
    font-size: 0.875rem;
    line-height: 1;
    min-height: 0;
    box-shadow: none;
}

#tx-mobile-list button[type='submit']:hover,
#tx-mobile-list button[type='button']:hover,
#dash-mobile-list button[type='submit']:hover,
#dash-mobile-list button[type='button']:hover {
    filter: none;
    background: transparent;
}

#tx-edit-modal:not(.hidden) {
    display: block;
}

.table-wrap--mov {
    margin-top: 0.5rem;
}

.mov-table tbody tr.mov-row {
    transition: background-color 0.15s ease;
}

.mov-table tbody tr.mov-row:hover:not(.mov-row--editing) {
    background: #f1f5f9;
}

.mov-table tbody tr.mov-row--editing {
    background: #eff6ff;
}

.mov-table__empty {
    text-align: center;
    color: var(--muted);
    padding: 1.5rem 1rem !important;
}

.mov-row__fecha,
.mov-row__mon {
    color: var(--muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.mov-inline-input,
.mov-inline-select {
    width: 100%;
    min-width: 4.5rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text);
    background: #fff;
}

.mov-inline-input:focus,
.mov-inline-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.mov-inline-input--monto {
    max-width: 7rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.mov-table .dash-actions {
    gap: 0.25rem;
}

.mov-table .icon-btn {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #475569;
}

.mov-table .icon-btn--edit:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
}

.mov-table .icon-btn--delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.mov-table .guardar-inline {
    background: rgba(5, 150, 105, 0.12);
    border-color: rgba(5, 150, 105, 0.35);
    color: #059669;
    font-size: 0.9rem;
}

.mov-table .guardar-inline:hover:not(:disabled) {
    background: rgba(5, 150, 105, 0.22);
}

.mov-table .guardar-inline:disabled {
    opacity: 0.55;
    cursor: wait;
}

.mov-table .icon-btn--cancel {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #64748b;
    font-size: 0.85rem;
}

.mov-table .icon-btn--cancel:hover {
    background: #e2e8f0;
    color: #334155;
}

/* Toast flotante */
.toast-root {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-width: min(320px, calc(100vw - 2rem));
}

.toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.toast--ok {
    background: #14532d;
    color: #bbf7d0;
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.toast--error {
    background: #7f1d1d;
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.35);
}

/* Transacciones — toolbar, colapso, filtros, origen WA */
.tx-toolbar {
    margin: 0 0 1rem;
}

.btn--cta {
    background: linear-gradient(135deg, #2563eb 0%, #0d9488 100%);
    color: #f8fafc;
    border: none;
    font-weight: 700;
    padding: 0.65rem 1.15rem;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn--cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(13, 148, 136, 0.4);
}

.btn--secondary {
    background: #64748b;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
}

.tx-collapsible {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin: 0 !important;
    padding: 0 !important;
    border-width: 0;
    transition: max-height 0.35s ease, opacity 0.28s ease, margin 0.3s ease;
}

.tx-collapsible.is-open,
.tx-manual-wrap.is-open {
    max-height: 420px;
    opacity: 1;
    margin: 0 0 1rem !important;
}

.box--manual {
    margin-bottom: 0;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.box--manual h2 {
    margin-bottom: 0.75rem;
}

/* Formulario cargar manual — tarjeta clara, dos filas */
.tx-quick-form {
    margin: 0;
}

.tx-quick-form__row--top {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.tx-quick-form__row--bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
}

.tx-qf-field {
    min-width: 0;
}

.tx-qf-field--grow {
    flex: 1 1 14rem;
    min-width: 0;
}

.tx-qf-field--action {
    flex: 0 0 auto;
    display: flex;
    align-items: stretch;
}

.tx-qf-monto-group {
    display: flex;
    gap: 0.4rem;
    min-width: 0;
}

.tx-qf-monto-group .tx-qf-control:first-child {
    flex: 1 1 0;
    min-width: 4rem;
}

.tx-qf-control {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.tx-qf-control::placeholder {
    color: #94a3b8;
}

.tx-qf-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
    background: #fff;
}

select.tx-qf-control {
    cursor: pointer;
    appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-color: #f8fafc;
    text-overflow: ellipsis;
}

.tx-qf-control--mon {
    flex: 0 0 5.25rem;
    width: 5.25rem;
    min-width: 5.25rem;
    padding-right: 0.75rem;
    background-image: none;
}

.tx-qf-submit {
    margin: 0;
    height: 100%;
    min-height: 42px;
    padding: 0.5rem 1.35rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: #fff;
    background: #2563eb;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.tx-qf-submit:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

@media (min-width: 768px) {
    .tx-quick-form__row--top {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .tx-collapsible.is-open,
    .tx-manual-wrap.is-open {
        max-height: 560px;
    }

    .tx-qf-field--action {
        flex: 1 1 100%;
    }

    .tx-qf-submit {
        width: 100%;
    }
}

.filters--tx {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.65rem 0.85rem;
    align-items: end;
}

.filters--tx .filters__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.filters--tx .filters__actions {
    align-self: end;
}

.box--filters h2 {
    margin-bottom: 0.65rem;
}

/* Alertas */
.flash-ok,
.ok {
    color: #166534;
    background: #dcfce7;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(5, 150, 105, 0.25);
}

.flash-err,
.error,
.err {
    color: #991b1b;
    background: #fee2e2;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.budget-alerts {
    margin: 1rem 0 1.25rem;
    padding: 0;
    list-style: none;
}

.budget-alerts li {
    padding: 0.65rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.budget-alerts li.warn {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.budget-alerts li.danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.saldos-list__badge-tc {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.35rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 4px;
    background: rgba(124, 58, 237, 0.15);
    color: #6d28d9;
    vertical-align: middle;
}

.saldos-list__item--tc {
    border-left: 3px solid #7c3aed;
}

/* Auth (login / registro) */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.auth-panel {
    width: 100%;
    max-width: 480px;
    background: var(--card);
    border-radius: var(--radius);
    padding: clamp(1.25rem, 4vw, 1.75rem);
    box-shadow: var(--shadow);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.auth-panel h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--text);
}

.auth-panel p {
    color: var(--muted);
    margin: 0 0 1rem;
    line-height: 1.5;
}

.auth-panel .steps {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.auth-panel a {
    color: var(--accent-balance);
    font-weight: 600;
}

.auth-panel input {
    margin-bottom: 0.75rem;
}

.auth-panel button[type='submit'] {
    width: 100%;
    margin-top: 0.5rem;
}

.auth-panel--wide {
    max-width: 640px;
}

.auth-panel--register button[type='submit'] {
    background: var(--accent-in);
}

.auth-panel--register button[type='submit']:hover {
    filter: brightness(1.05);
}

/* Presupuestos: filas */
.budget-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

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

.budget-row span {
    font-weight: 600;
    color: var(--text);
}

.budget-row input[type='number'] {
    max-width: 12rem;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.nav-links a {
    color: #e2e8f0;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-links a:hover {
    text-decoration: underline;
    color: #fff;
}

/* Mis medios — panel presets (encaja con el tema) */
details.preset-drop {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

details.preset-drop summary {
    list-style: none;
    cursor: pointer;
    padding: 0.9rem 1.1rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    user-select: none;
    font-family: var(--font-display);
}

details.preset-drop summary::-webkit-details-marker {
    display: none;
}

details.preset-drop summary::after {
    content: '▾';
    color: #0891b2;
    font-size: 1.1rem;
    transition: transform 0.2s;
}

details.preset-drop[open] summary::after {
    transform: rotate(-180deg);
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 0.5rem 0.85rem;
    padding: 0 1rem 1.1rem;
    max-height: min(50vh, 320px);
    overflow-y: auto;
}

.chk {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.chk:hover {
    background: #fff;
}

.chk input {
    margin-top: 0.2rem;
    accent-color: #0891b2;
    width: auto;
}

.chk span {
    font-size: 0.88rem;
    line-height: 1.35;
    color: #334155;
}

.chk.ya span {
    color: #94a3b8;
}

.chk.ya {
    cursor: default;
}

.badge-ya {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #e2e8f0;
    color: #64748b;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.35rem;
}

.btn-cyan {
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.65rem 1.25rem;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #fff;
    box-shadow: 0 4px 14px rgba(8, 145, 178, 0.35);
}

.btn-cyan:hover {
    filter: brightness(1.06);
}

.actions-row {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.lista {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.chip-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.medios-chip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(105deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.medios-cierre-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
    margin: 0.5rem 0 0.65rem;
    font-size: 0.85rem;
}

.medios-cierre-form label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: var(--muted);
}

.medios-cierre-form input[type="number"] {
    width: 4.5rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font: inherit;
}

.medios-chip .tit {
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.star {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0891b2;
    background: rgba(34, 211, 238, 0.15);
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
}

.tag-legacy {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #fef3c7;
    color: #92400e;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
}

.btn-ghost {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}

.btn-ghost:hover {
    background: #f8fafc;
}

.btn-ghost.btn-danger {
    border-color: #fecaca;
    color: #b91c1c;
}

.btn-ghost.btn-danger:hover {
    background: #fef2f2;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}

/* Utilidad texto sobre gradiente */
.text-on-dark {
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0.5rem 0 0;
    line-height: 1.45;
}

.text-on-dark strong {
    color: #cbd5e1;
}

/* lista_modelos / debug mínimo */
.pre-raw {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.8rem;
    max-width: 100%;
}

/* Páginas legales (URLs para Meta / política y términos) */
.card.legal-page {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    padding: 1.5rem 1.35rem 2rem;
}

.card.legal-page h1 {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--text);
}

.card.legal-page h2 {
    font-size: 1.05rem;
    margin-top: 1.35rem;
    margin-bottom: 0.5rem;
}

.card.legal-page p {
    line-height: 1.6;
    margin: 0 0 0.85rem;
}

.card.legal-page ul {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    line-height: 1.55;
}

.card.legal-page li {
    margin-bottom: 0.35rem;
}

.legal-back {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
}

.legal-updated {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
}

.legal-disclaimer {
    font-size: 0.82rem;
    color: var(--muted);
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
    margin-top: 1.5rem;
}

.auth-legal {
    margin-top: 1.25rem;
    margin-bottom: 0;
    font-size: 0.82rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}

.auth-legal a {
    font-weight: 600;
}
