

:root {
    --bg-0: #050913;
    --bg-1: #0b1630;
    --bg-2: #151c3b;
    --surface: rgba(12, 24, 50, 0.74);
    --surface-soft: rgba(10, 20, 42, 0.52);
    --surface-strong: rgba(8, 16, 33, 0.86);
    --border: rgba(119, 150, 220, 0.28);
    --border-strong: rgba(144, 179, 255, 0.38);
    --text: #eaf1ff;
    --muted: #9fb2d5;
    --primary: #86adff;
    --primary-strong: #6d78ff;
    --accent: #5de2ff;
    --danger: #ff5f8f;
    --success: #43e3a1;
    --warning: #ffc86b;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow-xl: 0 26px 60px rgba(1, 6, 18, 0.58);
    --shadow-lg: 0 16px 34px rgba(2, 8, 24, 0.46);
    --shadow-sm: 0 8px 18px rgba(3, 10, 29, 0.32);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
    background:
        radial-gradient(circle at 88% 2%, rgba(73, 189, 255, 0.16), transparent 30%),
        radial-gradient(circle at 5% 94%, rgba(128, 111, 255, 0.2), transparent 35%),
        linear-gradient(160deg, var(--bg-0) 0%, var(--bg-1) 56%, var(--bg-2) 100%);
    line-height: 1.45;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.45;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: url('/images/icono-haxx.png');
    background-repeat: no-repeat;
    background-size: min(56vw, 680px);
    background-position: 88% 58%;
    opacity: 0.055;
    filter: saturate(115%);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(130, 162, 236, 0.45);
    border-radius: 999px;
}

::-webkit-scrollbar-track {
    background: rgba(5, 12, 30, 0.35);
}

.app-layout,
.auth-shell,
.onboarding-shell {
    position: relative;
    z-index: 1;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1140px, calc(100% - 2.3rem));
    margin-inline: auto;
}

.glass-card {
    background: linear-gradient(155deg, rgba(16, 33, 67, 0.76), rgba(8, 19, 42, 0.7));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.glass-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 34%);
}

.glass-card > * {
    position: relative;
    z-index: 1;
}

.panel-section {
    padding: 1.08rem;
    border-radius: 20px;
}

.panel-title {
    margin: 0 0 0.72rem;
    font-size: 1.06rem;
    font-weight: 780;
    letter-spacing: 0.01em;
}

.panel-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.stack-rows {
    display: grid;
    gap: 0.52rem;
}

.stack-row {
    display: flex;
    justify-content: space-between;
    gap: 0.66rem;
    align-items: center;
}

.stack-sep {
    border-bottom: 1px solid rgba(117, 155, 255, 0.16);
    padding-bottom: 0.45rem;
}

.auth-shell {
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.auth-card {
    width: min(540px, 100%);
    padding: 1.2rem;
    display: grid;
    gap: 1rem;
    background: linear-gradient(160deg, rgba(18, 35, 72, 0.78), rgba(8, 18, 40, 0.72));
}

.brand-line {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.brand-line img {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    box-shadow: 0 10px 18px rgba(4, 10, 28, 0.42);
}

.brand-text {
    margin: 0;
    letter-spacing: 0.14em;
    font-weight: 800;
    font-size: 0.82rem;
    color: var(--muted);
}

.hero-title {
    margin: 0;
    font-size: clamp(1.95rem, 6vw, 2.85rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.97rem;
}

.form-grid {
    display: grid;
    gap: 0.8rem;
}

.field {
    display: grid;
    gap: 0.38rem;
}

.field label {
    font-size: 0.8rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.input,
.select,
textarea {
    width: 100%;
    border: 1px solid rgba(121, 157, 236, 0.34);
    background: rgba(4, 12, 29, 0.78);
    border-radius: 12px;
    color: var(--text);
    padding: 0.78rem 0.88rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.input:focus,
.select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(93, 226, 255, 0.15);
}

textarea {
    min-height: 96px;
    resize: vertical;
}

.btn {
    border: 0;
    border-radius: 12px;
    color: #fff;
    font-weight: 750;
    padding: 0.74rem 1rem;
    cursor: pointer;
    transition: transform 0.16s ease, opacity 0.16s ease, filter 0.16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(92deg, var(--primary-strong), var(--primary));
    box-shadow: 0 12px 26px rgba(86, 97, 255, 0.34);
}

.btn-outline {
    border: 1px solid var(--border);
    background: rgba(6, 15, 35, 0.72);
    color: var(--text);
}

.btn-danger {
    background: rgba(255, 95, 143, 0.18);
    border: 1px solid rgba(255, 95, 143, 0.48);
}

.btn-danger-solid {
    background: linear-gradient(90deg, #f05e8a, #ec3a70);
    box-shadow: 0 8px 22px rgba(236, 58, 112, 0.34);
}

.auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-link {
    font-size: 0.9rem;
    color: #82adff;
    font-weight: 700;
}

.auth-link:hover {
    color: #a4c3ff;
}

.oauth-btn {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.55rem;
}

.oauth-icon {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 0.82rem;
    display: inline-grid;
    place-items: center;
    font-weight: 900;
}

.flash {
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    font-size: 0.9rem;
}

.flash.success { background: rgba(67, 227, 161, 0.18); border: 1px solid rgba(67, 227, 161, 0.45); }
.flash.error { background: rgba(255, 95, 143, 0.18); border: 1px solid rgba(255, 95, 143, 0.45); }
.flash.warning { background: rgba(255, 200, 107, 0.16); border: 1px solid rgba(255, 200, 107, 0.45); }

.app-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100svh;
}

.sidebar {
    border-right: 1px solid rgba(124, 157, 236, 0.22);
    padding: 1rem 0.95rem;
    background: linear-gradient(180deg, rgba(6, 13, 31, 0.86), rgba(7, 16, 37, 0.8));
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    height: 100svh;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    overflow: visible;
}

.sidebar .menu {
    margin-top: 0.55rem;
    display: grid;
    gap: 0.48rem;
    position: relative;
}

.menu a {
    display: block;
    padding: 0.76rem 0.88rem;
    border-radius: 12px;
    color: var(--muted);
    border: 1px solid rgba(118, 151, 225, 0.08);
    font-size: 1.04rem;
    font-weight: 600;
}

.menu a.active,
.menu a:hover {
    color: #f2f6ff;
    border-color: rgba(124, 157, 236, 0.48);
    background: linear-gradient(96deg, rgba(23, 45, 84, 0.9), rgba(13, 30, 63, 0.75));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.main {
    padding: 1.15rem 1rem calc(5.9rem + env(safe-area-inset-bottom));
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.95rem;
}

.page-title {
    margin: 0;
    font-size: clamp(1.45rem, 4.5vw, 2.1rem);
    font-weight: 860;
    letter-spacing: -0.02em;
}

.page-subtitle {
    margin: 0.18rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.grid-2,
.grid-3,
.grid-4 {
    display: grid;
    gap: 0.82rem;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.section-block {
    padding: 1rem;
    border-radius: 18px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.section-title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 830;
}

.section-note {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.form-inline {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.form-grow {
    flex: 1 1 220px;
}

.soft-list {
    display: grid;
    gap: 0.6rem;
}

.soft-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    padding: 0.78rem 0.82rem;
    border-radius: 14px;
    border: 1px solid rgba(124, 157, 236, 0.2);
    background: linear-gradient(160deg, rgba(13, 29, 59, 0.62), rgba(8, 19, 40, 0.54));
}

.soft-item-body {
    display: grid;
    gap: 0.16rem;
}

.soft-item-title {
    margin: 0;
    font-weight: 780;
}

.soft-item-sub {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.amount-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.3rem 0.62rem;
    font-weight: 760;
    font-size: 0.82rem;
    border: 1px solid transparent;
}

.amount-pill.income {
    color: var(--success);
    border-color: rgba(67, 227, 161, 0.35);
    background: rgba(67, 227, 161, 0.12);
}

.amount-pill.expense {
    color: var(--danger);
    border-color: rgba(255, 95, 143, 0.35);
    background: rgba(255, 95, 143, 0.12);
}

.stat-value {
    margin: 0;
    font-size: clamp(1.5rem, 4.4vw, 2.15rem);
    font-weight: 900;
    line-height: 1.02;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.stat-card {
    padding: 1.02rem;
    display: grid;
    gap: 0.3rem;
    align-content: start;
    min-height: 128px;
}

.stat-money {
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    letter-spacing: -0.02em;
}

.muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.notif-status {
    font-size: 0.84rem;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(120, 151, 222, 0.2);
    border-radius: 14px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.table th,
.table td {
    text-align: left;
    padding: 0.78rem 0.62rem;
    border-bottom: 1px solid rgba(117, 155, 255, 0.18);
    font-size: 0.9rem;
}

.table tbody tr:hover {
    background: rgba(117, 155, 255, 0.08);
}

.table th {
    color: var(--muted);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(6, 14, 33, 0.56);
}

.mobile-nav {
    display: none;
    position: fixed;
    z-index: 40;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(0.58rem + env(safe-area-inset-bottom));
    border: 1px solid rgba(124, 157, 236, 0.34);
    border-radius: 16px;
    background: rgba(7, 16, 36, 0.92);
    backdrop-filter: blur(14px);
    padding: 0.34rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.28rem;
    box-shadow: var(--shadow-sm);
}

.mobile-nav a {
    text-align: center;
    font-size: 0.68rem;
    color: var(--muted);
    padding: 0.5rem 0.1rem;
    border-radius: 10px;
    border: 1px solid transparent;
}

.mobile-nav a.active {
    color: #fff;
    background: linear-gradient(92deg, rgba(109, 120, 255, 0.44), rgba(134, 173, 255, 0.3));
    border-color: rgba(134, 173, 255, 0.5);
}

.nav-plus-btn {
    position: absolute;
    width: 2.95rem;
    height: 2.95rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1.72rem;
    font-weight: 900;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.3), transparent 42%),
        linear-gradient(160deg, rgba(255, 116, 116, 0.95), rgba(162, 30, 30, 0.95));
    box-shadow:
        0 16px 34px rgba(162, 30, 30, 0.45),
        inset 0 1px 10px rgba(255, 255, 255, 0.22);
    transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
    z-index: 12;
}

.nav-plus-desktop {
    left: calc(100% - 1.48rem);
    top: calc(50% - 1.34rem);
}

.nav-plus-btn span {
    transform: translateY(-2px);
}

.nav-plus-btn:hover {
    transform: translateY(-1px) scale(1.04);
    filter: brightness(1.08);
}

.nav-plus-btn:active {
    transform: scale(.97);
}

.mobile-plus-btn {
    display: none;
}

.quick-modal {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: grid;
    place-items: center;
    padding: 1rem;
    background:
        radial-gradient(circle at 50% 0%, rgba(130, 167, 255, 0.24), rgba(2, 8, 22, 0.9) 45%),
        rgba(2, 8, 22, 0.78);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
}

.quick-modal[hidden] {
    display: none;
}

.quick-modal-card {
    width: min(520px, 100%);
    max-height: min(88vh, 760px);
    overflow: auto;
    padding: 1.12rem;
    border-radius: 20px;
    border: 1px solid rgba(143, 179, 255, 0.35);
    box-shadow: var(--shadow-xl);
    background:
        radial-gradient(circle at 8% 0%, rgba(118, 155, 255, 0.16), transparent 36%),
        linear-gradient(160deg, rgba(17, 36, 72, 0.9), rgba(8, 19, 41, 0.88));
}

.quick-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.quick-modal-title {
    margin: 0;
    font-size: 1.24rem;
    font-weight: 840;
    letter-spacing: 0.01em;
}

.quick-close {
    width: 2.18rem;
    height: 2.18rem;
    border-radius: 11px;
    border: 1px solid rgba(151, 184, 255, 0.35);
    background: rgba(10, 23, 53, 0.76);
    color: #fff;
    font-size: 1.28rem;
    font-weight: 700;
    cursor: pointer;
    display: grid;
    place-items: center;
    line-height: 1;
}

.quick-close:hover {
    background: rgba(18, 36, 72, 0.86);
}

.quick-form {
    display: grid;
    gap: 0.68rem;
}

.quick-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.79rem;
    font-weight: 760;
    letter-spacing: 0.03em;
}

.quick-type-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.62rem;
}

.quick-type-option {
    position: relative;
}

.quick-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.quick-type-option span {
    display: block;
    text-align: center;
    padding: 0.6rem 0.4rem;
    border-radius: 12px;
    border: 1px solid rgba(118, 151, 225, 0.3);
    background: rgba(4, 11, 28, 0.8);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.quick-type-option input:checked + span {
    color: #fff;
    border-color: rgba(134, 173, 255, 0.6);
    background: rgba(134, 173, 255, 0.18);
}

.quick-input {
    width: 100%;
    border: 1px solid rgba(121, 157, 236, 0.34);
    background: rgba(4, 12, 29, 0.8);
    border-radius: 12px;
    color: var(--text);
    padding: 0.7rem 0.85rem;
    outline: none;
    font-size: 0.92rem;
}

.quick-form select.quick-input,
.quick-form textarea.quick-input {
    appearance: none;
}

.quick-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(93, 226, 255, 0.15);
}

.quick-amount-wrap {
    position: relative;
}

.quick-currency {
    position: absolute;
    left: 0.78rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-weight: 800;
    pointer-events: none;
}

.quick-amount-wrap .quick-input {
    padding-left: 2.02rem;
}

.quick-submit {
    margin-top: 0.18rem;
    width: 100%;
}

.modal-open {
    overflow: hidden;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 999px;
    padding: 0.3rem 0.68rem;
    border: 1px solid var(--border);
    background: rgba(10, 22, 50, 0.72);
    font-size: 0.76rem;
    font-weight: 700;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    padding: 1rem;
    display: grid;
    place-items: center;
    background: rgba(2, 8, 23, 0.6);
    backdrop-filter: blur(6px);
}

.confirm-modal[hidden] {
    display: none;
}

.confirm-dialog {
    width: min(430px, 100%);
    padding: 1rem;
}

.confirm-title {
    margin: 0;
    font-size: 1.15rem;
}

.confirm-message {
    margin: 0.55rem 0 0;
    color: var(--muted);
}

.confirm-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.onboarding-shell {
    min-height: 100svh;
    padding: 1rem;
    display: grid;
    place-items: center;
}

.onboarding-card {
    width: min(780px, 100%);
    padding: 1rem;
    display: grid;
    gap: 0.8rem;
}

.slider {
    overflow: hidden;
    border-radius: 14px;
}

.slides {
    display: flex;
    transition: transform 0.3s ease;
}

.slide {
    min-width: 100%;
    padding: 1rem;
    border: 1px solid rgba(117, 155, 255, 0.2);
    border-radius: 14px;
    background: rgba(2, 10, 27, 0.72);
}

.slide h3 {
    margin: 0 0 0.4rem;
    font-size: 1.2rem;
}

.slide p {
    margin: 0;
    color: var(--muted);
}

.slide-nav {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
}

.progress-dots {
    display: inline-flex;
    gap: 0.3rem;
}

.progress-dots span {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: rgba(160, 188, 234, 0.4);
}

.progress-dots span.active {
    background: var(--accent);
}

@media (max-width: 1100px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .mobile-nav {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: center;
    }

    .nav-plus-desktop {
        display: none;
    }

    .mobile-plus-btn {
        display: grid;
        place-items: center;
        width: 2.92rem;
        height: 2.92rem;
        margin-top: -0.95rem;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        color: #fff;
        font-size: 1.72rem;
        font-weight: 900;
        line-height: 1;
        background:
            radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.3), transparent 42%),
            linear-gradient(160deg, rgba(255, 116, 116, 0.95), rgba(162, 30, 30, 0.95));
        box-shadow:
            0 12px 30px rgba(162, 30, 30, 0.4),
            inset 0 1px 8px rgba(255, 255, 255, 0.22);
        justify-self: center;
        z-index: 3;
    }

    .mobile-plus-btn span {
        transform: translateY(-2px);
    }
}

@media (max-width: 760px) {
    .container {
        width: calc(100% - 1rem);
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .main {
        padding-inline: 0.72rem;
    }

    .auth-card {
        padding: 0.92rem;
    }

    .table {
        min-width: 590px;
    }

    body::after {
        background-position: center 34%;
        background-size: min(88vw, 520px);
    }

    .stat-money {
        font-size: clamp(1.66rem, 7.2vw, 2.08rem);
    }

    .mobile-plus-btn {
        width: 2.78rem;
        height: 2.78rem;
        margin-top: -0.9rem;
    }

    .mobile-plus-btn span {
        transform: translateY(-2px) scale(0.96);
    }
}
