:root {
    --bg-color: #09090b;
    --surface-color: rgba(24, 24, 27, 0.7);
    --border-color: rgba(63, 63, 70, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Category Colors */
    --cat-sup: #10b981;
    --cat-sup-bg: rgba(16, 185, 129, 0.15);
    
    --cat-chu: #ec4899;
    --cat-chu-bg: rgba(236, 72, 153, 0.15);
    
    --cat-otr: #6366f1;
    --cat-otr-bg: rgba(99, 102, 241, 0.15);
    
    --nav-height: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + 20px);
}

.app-header {
    padding: 24px 20px 16px;
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo svg {
    color: var(--cat-sup);
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.main-content {
    padding: 20px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--nav-height);
    background: rgba(24, 24, 27, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 8px 16px;
    border-radius: 12px;
}

.nav-item svg {
    transition: all 0.2s ease;
}

.nav-item.active {
    color: var(--text-primary);
}

.nav-item.active svg {
    color: var(--cat-sup);
}

/* Glass Cards */
.glass-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin-bottom: 16px;
    box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.2);
    /* Optimización para scroll */
    transform: translateZ(0);
}

.glass-card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Progress Bars */
.progress-group {
    margin-bottom: 20px;
}
.progress-group:last-child {
    margin-bottom: 0;
}

.breakdown-list {
    display: flex;
    gap: 6px 12px;
    font-size: 0.75rem;
    margin-top: 8px;
    flex-wrap: wrap;
    color: var(--text-secondary);
}

@media (max-width: 480px) {
    .breakdown-list {
        flex-direction: column;
        gap: 4px;
    }
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.progress-label {
    font-weight: 500;
}

.progress-values {
    color: var(--text-secondary);
}

.progress-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Colors by category */
.cat-sup .progress-bar-fill { background: var(--cat-sup); }
.cat-chu .progress-bar-fill { background: var(--cat-chu); }
.cat-otr .progress-bar-fill { background: var(--cat-otr); }

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--cat-sup);
    background: rgba(0, 0, 0, 0.4);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--cat-sup);
    color: #000;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Expense List */
.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.expense-item:last-child {
    border-bottom: none;
}

.expense-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.expense-title {
    font-weight: 500;
}

.expense-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.expense-amount {
    font-weight: 600;
    text-align: right;
}

.expense-cat-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}

.badge-sup { background: var(--cat-sup-bg); color: var(--cat-sup); }
.badge-chu { background: var(--cat-chu-bg); color: var(--cat-chu); }
.badge-otr { background: var(--cat-otr-bg); color: var(--cat-otr); }

/* Total Summary */
.total-summary {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.total-block {
    display: flex;
    flex-direction: column;
}

.total-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.total-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Desktop View */
@media (min-width: 768px) {
    body {
        display: flex;
        justify-content: center;
    }
    
    .app-container {
        display: grid;
        grid-template-columns: 240px 1fr;
        max-width: 1200px;
        width: 100%;
        padding: 40px;
        gap: 40px;
        padding-bottom: 40px;
    }
    
    .desktop-sidebar {
        position: sticky;
        top: 40px;
        height: max-content;
    }
    
    .app-header {
        position: static;
        padding: 0 0 24px 0;
        background: transparent;
        backdrop-filter: none;
        border: none;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .bottom-nav {
        position: static;
        transform: none;
        width: 100%;
        height: auto;
        flex-direction: column;
        justify-content: flex-start;
        background: transparent;
        backdrop-filter: none;
        border: none;
        padding: 0;
        gap: 16px;
        align-items: stretch;
    }
    
    .nav-item {
        flex-direction: row;
        justify-content: flex-start;
        padding: 16px 20px;
        background: var(--surface-color);
        border: 1px solid var(--border-color);
        border-radius: 16px;
        font-size: 1rem;
        gap: 16px;
    }
    
    .nav-item span {
        display: inline;
    }
    
    .nav-item.active {
        background: var(--cat-sup-bg);
        border-color: var(--cat-sup);
    }
    
    .main-content {
        padding: 0;
    }
    
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        align-items: start;
    }
}
