/* =====================================================================
   PERSONAL COUNT — Sistema de diseño "Libro mayor"
   ---------------------------------------------------------------------
   Dirección estética: papel impreso, no pantalla. Un libro contable
   editorial — márgenes generosos, filetes finos, cifras enormes en
   condensada con numeración tabular alineada como en una planilla.
   Sin glow, sin degradés de neón, sin sombras difusas.

   Marca jArismendi®: verde petróleo + arena, isotipo "jA" como marca
   de agua en baja opacidad, borde rasgado tipo papel roto.
   ===================================================================== */

/* ==================== TOKENS ==================== */
:root {
    /* Superficies — papel cálido, no blanco clínico */
    --paper: #F4F1EA;
    --card: #FFFFFF;
    --card-alt: #FBF8F2;

    /* Tinta */
    --ink: #2B2B2B;
    --ink-body: #4A4A4A;
    --ink-mute: #8A857C;

    /* Marca */
    --petrol: #2E7D82;
    --petrol-deep: #1D4F52;
    --petrol-ink: #143638;
    --sand: #D4B896;
    --sand-soft: #EADCC6;
    --teal-soft: #C8DCDC;

    /* Semántica del dinero — el gasto es terracota, no rojo alarma:
       convive con la arena en vez de pelearse con ella */
    --income: #2E7D82;
    --expense: #B4553A;

    /* Filetes */
    --rule: rgba(43, 43, 43, 0.14);
    --rule-strong: rgba(43, 43, 43, 0.26);

    /* Tipografía */
    --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
    --font-cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --font-body: 'Barlow', 'Segoe UI', system-ui, sans-serif;

    /* Ritmo */
    --gut: 22px;
    --radius: 4px;

    --shadow-card: 0 1px 0 rgba(43, 43, 43, .06), 0 2px 10px rgba(43, 43, 43, .05);
    --shadow-lift: 0 2px 0 rgba(43, 43, 43, .08), 0 10px 26px rgba(43, 43, 43, .12);
}

@media (prefers-color-scheme: dark) {
    :root {
        /* El oscuro no es negro: es petróleo profundo. La marca sobrevive
           al cambio de tema en vez de disolverse en gris. */
        --paper: #12292B;
        --card: #173335;
        --card-alt: #1B3B3D;

        --ink: #EFE9DD;
        --ink-body: #CFD9D6;
        --ink-mute: #8FA5A4;

        --petrol: #63B8BD;
        --petrol-deep: #0E2224;
        --petrol-ink: #0A1B1C;
        --sand: #D4B896;
        --sand-soft: #3A4442;
        --teal-soft: #2A4A4C;

        --income: #63B8BD;
        --expense: #E08163;

        --rule: rgba(239, 233, 221, 0.14);
        --rule-strong: rgba(239, 233, 221, 0.28);

        --shadow-card: 0 1px 0 rgba(0, 0, 0, .25), 0 2px 10px rgba(0, 0, 0, .22);
        --shadow-lift: 0 2px 0 rgba(0, 0, 0, .3), 0 10px 26px rgba(0, 0, 0, .38);
    }
}

/* ==================== RESET ==================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    background: var(--paper);
    color: var(--ink-body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Textura de papel: grano sutil sobre toda la app. Es lo que separa
   "fondo de color" de "superficie con materia". */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: .035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input,
select {
    font-family: inherit;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--paper);
    position: relative;
    padding-bottom: 92px;
    /* Filetes laterales: el "corte" de la página impresa */
    border-left: 1px solid var(--rule);
    border-right: 1px solid var(--rule);
}

/* ==================== PANTALLAS ==================== */
.screen {
    display: none;
    padding: 30px var(--gut) 20px;
}

.screen.active {
    display: block;
}

/* Aparición escalonada: una sola coreografía al entrar, no
   micro-animaciones desperdigadas por toda la interfaz */
.screen.active>* {
    animation: riseIn .5s cubic-bezier(.2, .7, .3, 1) backwards;
}

.screen.active>*:nth-child(1) { animation-delay: .02s; }
.screen.active>*:nth-child(2) { animation-delay: .08s; }
.screen.active>*:nth-child(3) { animation-delay: .14s; }
.screen.active>*:nth-child(4) { animation-delay: .20s; }
.screen.active>*:nth-child(5) { animation-delay: .26s; }
.screen.active>*:nth-child(6) { animation-delay: .32s; }

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ==================== ENCABEZADO DE PERFIL ==================== */
.profile-section {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.profile-photo {
    width: 54px;
    height: 54px;
    flex: none;
    border-radius: 50%;
    overflow: hidden;
    background: var(--sand-soft);
    border: 1px solid var(--rule-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .25s ease;
}

.profile-photo:hover {
    border-color: var(--petrol);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-info {
    min-width: 0;
}

.greeting {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-weight: 600;
    font-size: 25px;
    line-height: 1.15;
    letter-spacing: -.01em;
    color: var(--ink);
    cursor: pointer;
    position: relative;
    display: inline-block;
}

.greeting::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 1px;
    background: var(--petrol);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s cubic-bezier(.2, .7, .3, 1);
}

.greeting:hover::after {
    transform: scaleX(1);
}

.subtitle {
    font-family: var(--font-cond);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-top: 2px;
}

/* ==================== TARJETA DE SALDO ====================
   El momento único de la interfaz: petróleo profundo, isotipo "jA"
   como marca de agua, y el borde inferior rasgado — el recurso de
   "papel roto" del estudio. Se usa UNA sola vez para que signifique. */
.balance-card {
    position: relative;
    background: var(--petrol-deep);
    color: #fff;
    padding: 26px 24px 40px;
    margin: 0 calc(var(--gut) * -1) 26px;
    overflow: hidden;
    isolation: isolate;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px),
            94% calc(100% - 7px), 88% calc(100% - 14px), 82% calc(100% - 5px),
            75% calc(100% - 12px), 68% calc(100% - 4px), 61% calc(100% - 11px),
            54% calc(100% - 3px), 47% calc(100% - 10px), 40% calc(100% - 2px),
            33% calc(100% - 9px), 26% calc(100% - 14px), 19% calc(100% - 6px),
            12% calc(100% - 13px), 6% calc(100% - 5px), 0 calc(100% - 12px));
}

/* Marca de agua: el ISOTIPO en outline, nunca las letras "jA" compuestas
   con una tipografía. El logo es un dibujo, no un texto — se usa el
   archivo de marca o no se usa. */
.balance-card::before {
    content: "";
    position: absolute;
    right: -58px;
    top: 50%;
    transform: translateY(-50%);
    width: 340px;
    height: 275px;
    background-image: url("../logos/IsoLogojAComunicacion.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    /* El isotipo es de trazo fino: a escala chica y opacidad baja las
       líneas caen por debajo del píxel y desaparecen. Un outline necesita
       tamaño y opacidad alta para leerse como marca de agua. */
    opacity: .5;
    pointer-events: none;
    z-index: 0;
}

/* El contenido va por encima de la marca de agua */
.balance-card>* {
    position: relative;
    z-index: 1;
}

.balance-label {
    font-family: var(--font-cond);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--sand);
    margin-bottom: 4px;
}

.balance-amount {
    font-family: var(--font-cond);
    font-weight: 800;
    font-size: clamp(52px, 17vw, 74px);
    line-height: .92;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.balance-change {
    font-family: var(--font-cond);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--teal-soft);
    margin-top: 8px;
}

/* Barrido de luz al actualizar el saldo — se dispara desde JS
   (triggerShine), no corre en loop */
.balance-card.shine-active::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 38%, rgba(212, 184, 150, .22) 50%, transparent 62%);
    animation: sweep .85s ease-out;
    pointer-events: none;
    z-index: 2;
}

@keyframes sweep {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

/* ==================== BOTONES DE ACCIÓN ==================== */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 30px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 14px 4px 12px;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    border-color: var(--petrol);
    box-shadow: var(--shadow-card);
}

.action-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 22px;
    line-height: 1;
    color: var(--petrol);
}

.btn-text {
    font-family: var(--font-cond);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ink-body);
}

/* ==================== ETIQUETAS DE SECCIÓN ==================== */
.health-section,
.goals-section {
    margin-bottom: 28px;
}

.health-label {
    font-family: var(--font-cond);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

/* Filete que completa la línea hasta el margen: recurso editorial */
.health-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--rule-strong);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-header .health-label {
    margin-bottom: 0;
    flex: 1;
}

/* ==================== BARRAS / MEDIDORES ====================
   Trama de marcas como un medidor impreso, no una barra con brillo */
.health-bar {
    position: relative;
    height: 12px;
    background: var(--sand-soft);
    border: 1px solid var(--rule);
    border-radius: 2px;
    overflow: hidden;
}

.health-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg,
            transparent 0 9px,
            var(--rule) 9px 10px);
    pointer-events: none;
}

.health-fill {
    height: 100%;
    width: 0;
    background: var(--petrol);
    transition: width .7s cubic-bezier(.2, .7, .3, 1);
}

.health-percentage {
    font-family: var(--font-cond);
    font-size: 32px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--petrol);
    margin-top: 10px;
}

/* ==================== METAS ==================== */
.budget-card {
    background: var(--card);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--petrol);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-card);
}

.budget-info {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.budget-label {
    font-family: var(--font-cond);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

.budget-value {
    font-family: var(--font-cond);
    font-size: 26px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.budget-fill {
    background: var(--sand);
}

.budget-status {
    font-size: 14px;
    color: var(--ink-mute);
    margin-top: 10px;
    font-variant-numeric: tabular-nums;
}

/* ==================== COLOFÓN DE MARCA ====================
   Firma al pie del dashboard, separada por un filete: el gesto de una
   pieza impresa. Discreta, pero presente. */
.brand-mark {
    display: flex;
    justify-content: center;
    padding-top: 24px;
    margin-top: 8px;
    border-top: 1px solid var(--rule);
}

.brand-mark img {
    width: 132px;
    max-width: 46%;
    height: auto;
    display: block;
    opacity: .5;
    transition: opacity .25s ease;
}

.brand-mark img:hover {
    opacity: .85;
}

/* El logotipo viene en gris oscuro: sobre fondo oscuro hay que invertirlo
   para que siga leyéndose */
@media (prefers-color-scheme: dark) {
    .brand-mark img {
        filter: invert(1) brightness(1.6);
        opacity: .42;
    }
}

/* ==================== CABECERA DE PANTALLA ==================== */
.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 3px double var(--rule-strong);
}

.screen-title {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-weight: 600;
    font-size: 27px;
    line-height: 1.1;
    letter-spacing: -.015em;
    color: var(--ink);
}

.add-btn {
    width: 38px;
    height: 38px;
    flex: none;
    font-size: 24px;
    line-height: 1;
    color: #fff;
    background: var(--petrol);
    border-radius: var(--radius);
    transition: background .2s ease, transform .2s ease;
}

.add-btn:hover {
    background: var(--petrol-deep);
    transform: rotate(90deg);
}

/* ==================== FILTROS ==================== */
.filter-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

#category-filter,
#chart-range-filter {
    font-family: var(--font-cond);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink);
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--petrol);
    border-radius: 0;
    padding: 5px 22px 5px 2px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%232E7D82' stroke-width='1.8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 2px center;
}

#category-filter:focus,
#chart-range-filter:focus {
    outline: 2px solid var(--petrol);
    outline-offset: 3px;
}

#category-filter option,
#chart-range-filter option {
    background: var(--card);
    color: var(--ink-body);
}

.export-actions {
    display: flex;
    gap: 8px;
}

.export-btn {
    font-family: var(--font-cond);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--ink-body);
    background: transparent;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    padding: 6px 11px;
    transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.export-btn:hover {
    color: #fff;
    background: var(--petrol);
    border-color: var(--petrol);
}

.edit-btn {
    width: 32px;
    height: 32px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: var(--ink-mute);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    transition: color .25s ease, border-color .25s ease, transform .4s ease;
}

.edit-btn:hover {
    color: var(--petrol);
    border-color: var(--petrol);
    transform: rotate(60deg);
}

/* ==================== TRANSACCIONES ==================== */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transaction-card {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    grid-template-areas:
        "icon info amount"
        "icon actions actions";
    align-items: center;
    gap: 4px 13px;
    background: var(--card);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--petrol);
    border-radius: var(--radius);
    padding: 13px 15px;
    box-shadow: var(--shadow-card);
    transition: transform .2s ease, box-shadow .2s ease;
}

.transaction-card:hover {
    transform: translateX(3px);
    box-shadow: var(--shadow-lift);
}

.transaction-icon {
    grid-area: icon;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: var(--petrol);
    background: var(--sand-soft);
    border-radius: 50%;
}

.transaction-info {
    grid-area: info;
    min-width: 0;
}

.transaction-name {
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-details,
.transaction-date {
    font-family: var(--font-cond);
    font-size: 14px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

.transaction-amount {
    grid-area: amount;
    font-family: var(--font-cond);
    font-size: 22px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    align-self: center;
}

.transaction-amount.income {
    color: var(--income);
}

.transaction-amount.expense {
    color: var(--expense);
}

.transaction-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity .2s ease;
}

.transaction-card:hover .transaction-actions,
.transaction-card:focus-within .transaction-actions {
    opacity: 1;
}

.edit-btn-inline,
.delete-btn {
    font-family: var(--font-cond);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-mute);
    border: 1px solid var(--rule);
    border-radius: 2px;
    padding: 3px 9px;
    transition: color .2s ease, border-color .2s ease;
}

.edit-btn-inline:hover {
    color: var(--petrol);
    border-color: var(--petrol);
}

.delete-btn {
    font-size: 15px;
    line-height: 1;
    padding: 3px 8px;
}

.delete-btn:hover {
    color: var(--expense);
    border-color: var(--expense);
}

/* En pantallas táctiles no hay hover: las acciones quedan visibles */
@media (hover: none) {
    .transaction-actions {
        opacity: 1;
    }
}

/* ==================== GRÁFICO ==================== */
.chart-container {
    position: relative;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-card);
}

.chart-empty-message {
    font-family: var(--font-cond);
    font-size: 17px;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-align: center;
    color: var(--ink-mute);
    padding: 40px 0;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.legend-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-family: var(--font-cond);
    font-size: 17px;
    letter-spacing: .04em;
    color: var(--ink-body);
    font-variant-numeric: tabular-nums;
    transition: transform .2s ease;
}

.legend-item:hover {
    transform: translateX(3px);
}

.legend-label {
    letter-spacing: .07em;
    text-transform: uppercase;
}

.legend-value {
    font-weight: 800;
    font-size: 19px;
    color: var(--ink);
}

/* ==================== NAVEGACIÓN INFERIOR ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--card);
    border-top: 1px solid var(--rule-strong);
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 100;
}

.nav-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 4px 11px;
    color: var(--ink-mute);
    transition: color .2s ease;
}

/* Marca de sección activa: un bloque impreso arriba del ícono */
.nav-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 42px;
    height: 3px;
    background: var(--petrol);
    transition: transform .3s cubic-bezier(.2, .7, .3, 1);
}

.nav-btn.active::before {
    transform: translateX(-50%) scaleX(1);
}

.nav-btn.active,
.nav-btn:hover {
    color: var(--petrol);
}

.nav-icon {
    font-size: 21px;
    line-height: 1;
}

.nav-label {
    font-family: var(--font-cond);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
}

/* ==================== MODALES ==================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(20, 54, 56, .55);
    backdrop-filter: blur(3px);
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn .25s ease;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-content {
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    background: var(--paper);
    border-top: 4px solid var(--petrol);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 22px var(--gut) calc(26px + env(safe-area-inset-bottom, 0));
    animation: slideUp .35s cubic-bezier(.2, .7, .3, 1);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: none; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 20px;
    border-bottom: 3px double var(--rule-strong);
}

.modal-header h3 {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-weight: 600;
    font-size: 23px;
    letter-spacing: -.01em;
    color: var(--ink);
}

.close-btn {
    width: 32px;
    height: 32px;
    flex: none;
    font-size: 24px;
    line-height: 1;
    color: var(--ink-mute);
    border-radius: var(--radius);
    transition: color .2s ease, transform .25s ease;
}

.close-btn:hover {
    color: var(--expense);
    transform: rotate(90deg);
}

/* ==================== FORMULARIOS ==================== */
.form-group {
    margin-bottom: 17px;
}

.form-group label {
    display: block;
    font-family: var(--font-cond);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 5px;
}

/* Campos con filete inferior, como un formulario impreso para completar
   a mano — no cajas con relleno gris */
.form-group input,
.form-group select {
    width: 100%;
    font-size: 17px;
    color: var(--ink);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--rule-strong);
    border-radius: 0;
    padding: 8px 2px;
    transition: border-color .2s ease;
}

.form-group input::placeholder {
    color: var(--ink-mute);
    opacity: .65;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-bottom: 2px solid var(--petrol);
    padding-bottom: 7px;
}

.form-group select option {
    background: var(--card);
    color: var(--ink-body);
}

.submit-btn {
    width: 100%;
    font-family: var(--font-cond);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #fff;
    background: var(--petrol);
    border-radius: var(--radius);
    padding: 14px;
    margin-top: 8px;
    transition: background .2s ease, transform .15s ease;
}

.submit-btn:hover {
    background: var(--petrol-deep);
}

.submit-btn:active {
    transform: scale(.99);
}

/* ==================== ACCESIBILIDAD ==================== */
:focus-visible {
    outline: 2px solid var(--petrol);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 400px) {
    :root {
        --gut: 17px;
    }

    .action-buttons {
        gap: 6px;
    }

    .btn-text {
        font-size: 13px;
    }

    .balance-card::before {
        width: 280px;
        height: 225px;
        right: -64px;
    }
}
