/**
 * Estudante Financeiro
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 * 
 * Design: Clean & Minimal + Health & Wellness + Education & Gamified
 * Palette: Nordic Frost
 */

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

/* ===== CSS VARIABLES ===== */
:root {
    /* Nordic Frost Palette */
    --primary-color: #2E3440;
    --secondary-color: #3B4252;
    --accent-color: #434C5E;
    --surface-color: #D8DEE9;
    --text-color: #88C0D0;
    
    /* Automatic Variations */
    --primary-hover: #252b36;
    --primary-light: #4C566A;
    --bg-color: #ECEFF4;
    --bg-secondary: #E5E9F0;
    --text-primary: #2E3440;
    --text-secondary: #4C566A;
    --text-muted: #7B88A1;
    
    /* Semantic Colors */
    --success-color: #A3BE8C;
    --success-light: rgba(163, 190, 140, 0.15);
    --warning-color: #EBCB8B;
    --warning-light: rgba(235, 203, 139, 0.15);
    --danger-color: #BF616A;
    --danger-light: rgba(191, 97, 106, 0.15);
    --info-color: #81A1C1;
    --info-light: rgba(129, 161, 193, 0.15);
    
    /* Income/Expense */
    --income-color: #A3BE8C;
    --expense-color: #BF616A;
    
    /* Layout */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --spacing-unit: 8px;
    --header-height: 60px;
    --bottom-nav-height: 65px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(46, 52, 64, 0.05);
    --shadow-md: 0 4px 12px rgba(46, 52, 64, 0.08);
    --shadow-lg: 0 8px 24px rgba(46, 52, 64, 0.12);
    --shadow-xl: 0 12px 32px rgba(46, 52, 64, 0.16);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
}


/* ===== BASE STYLES ===== */
html {
    font-size: clamp(14px, 2.5vw, 16px);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    background-color: var(--bg-color);
}

body {
    font-family: var(--font-family);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
    padding-top: var(--header-height);
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: max(var(--header-height), env(safe-area-inset-top));
    padding-bottom: max(calc(var(--bottom-nav-height) + 20px), env(safe-area-inset-bottom));
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }

p {
    color: var(--text-secondary);
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-color);
}

/* ===== SCREEN READER ONLY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===== HEADER ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

.logo-icon {
    flex-shrink: 0;
}

.header-logo h1 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

/* Desktop Navigation */
.desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
        gap: 4px;
    }
    
    .desktop-nav .nav-link {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 16px;
        border-radius: var(--border-radius-sm);
        color: var(--text-secondary);
        font-size: var(--font-size-sm);
        font-weight: 500;
        transition: var(--transition);
    }
    
    .desktop-nav .nav-link:hover {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }
    
    .desktop-nav .nav-link.active {
        background: transparent;
        color: var(--primary-color);
        position: relative;
    }

    .desktop-nav .nav-link.active::after {
        content: '';
        position: absolute;
        bottom: 2px;
        left: 50%;
        transform: translateX(-50%);
        width: 20px;
        height: 3px;
        background-color: var(--primary-color);
        border-radius: 3px;
    }
    
    .desktop-nav .nav-link i {
        font-size: 14px;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(46, 52, 64, 0.1);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    transition: var(--transition);
    min-width: 64px;
    min-height: 48px;
}

.nav-item i {
    font-size: 20px;
    transition: transform var(--transition);
}

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

.nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 0 0 3px 3px;
}

.nav-item.active i {
    transform: scale(1.15);
}

/* FAB Button in Nav */
.nav-item-fab {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--text-color), var(--info-color));
    border-radius: 50%;
    margin-top: -28px;
    color: white !important;
    box-shadow: 0 4px 16px rgba(136, 192, 208, 0.4);
    transition: var(--transition);
}

.nav-item-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(136, 192, 208, 0.5);
}

.nav-item-fab i {
    font-size: 24px;
}

.nav-item-fab span {
    display: none;
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none !important;
    }
    
    body {
        padding-bottom: 20px;
    }
}

/* Mobile Keyboard States */
body.keyboard-open .bottom-nav {
    display: none !important;
}

body.keyboard-open {
    padding-bottom: 20px !important;
}

/* ===== CONTAINER ===== */
.container {
    padding: 16px;
    max-width: 100%;
}

@media (min-width: 768px) {
    .container {
        padding: 24px;
        max-width: 720px;
        margin: 0 auto;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 960px;
    }
}

/* ===== SECTIONS ===== */
.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    min-height: 48px;
    min-width: 48px;
}

.btn:focus {
    outline: 2px solid var(--text-color);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--surface-color);
}

.btn-outline:hover {
    background: var(--surface-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #a9545c;
}

.btn-small {
    padding: 8px 16px;
    font-size: var(--font-size-xs);
    min-height: 36px;
}

.btn-full {
    width: 100%;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--border-radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--surface-color);
    color: var(--text-primary);
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Welcome Card */
.welcome-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    color: white;
}

.welcome-content h2 {
    color: white;
    font-size: var(--font-size-xl);
    margin-bottom: 4px;
}

.welcome-date {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--font-size-sm);
}

.welcome-avatar {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-avatar i {
    font-size: 28px;
    color: white;
}

/* Balance Card */
.balance-card {
    background: var(--bg-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.balance-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-weight: 500;
}

.balance-amount {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 20px;
}

.balance-amount .currency {
    font-size: var(--font-size-lg);
    color: var(--text-muted);
    font-weight: 500;
}

.balance-amount .value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
}

.balance-amount.hidden .value {
    filter: blur(8px);
}

.balance-progress {
    margin-top: 16px;
}

.progress-bar {
    height: 8px;
    background: var(--surface-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--text-color));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-fill.warning {
    background: linear-gradient(90deg, var(--warning-color), var(--danger-color));
}

.progress-fill.danger {
    background: var(--danger-color);
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

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

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.action-income .action-icon {
    background: var(--success-light);
    color: var(--success-color);
}

.action-expense .action-icon {
    background: var(--danger-light);
    color: var(--danger-color);
}

.action-transfer .action-icon {
    background: var(--info-light);
    color: var(--info-color);
}

.action-btn span {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: var(--font-size-base);
    font-weight: 600;
}

.link-more {
    font-size: var(--font-size-sm);
    color: var(--text-color);
    font-weight: 500;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title h2 {
    font-size: var(--font-size-xl);
}

/* ===== ALERTS ===== */
.alerts-section {
    margin-bottom: 24px;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-warning {
    background: var(--warning-light);
    border-left: 4px solid var(--warning-color);
}

.alert-danger {
    background: var(--danger-light);
    border-left: 4px solid var(--danger-color);
}

.alert-success {
    background: var(--success-light);
    border-left: 4px solid var(--success-color);
}

.alert-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-warning .alert-icon {
    background: var(--warning-color);
    color: white;
}

.alert-danger .alert-icon {
    background: var(--danger-color);
    color: white;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    margin-bottom: 2px;
}

.alert-message {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.alert-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

/* ===== CATEGORY SUMMARY ===== */
.category-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .category-summary {
        grid-template-columns: repeat(4, 1fr);
    }
}

.category-card {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 18px;
}

.category-name {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.category-amount {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.category-progress {
    margin-top: 8px;
}

.category-progress .progress-bar {
    height: 4px;
}

/* ===== TRANSACTIONS LIST ===== */
.transactions-list,
.transactions-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

.transaction-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.transaction-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.transaction-info {
    flex: 1;
    min-width: 0;
}

.transaction-description {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-meta {
    display: flex;
    gap: 8px;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.transaction-amount {
    font-weight: 600;
    font-size: var(--font-size-base);
    white-space: nowrap;
}

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

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

.transaction-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: var(--transition);
}

.transaction-item:hover .transaction-actions {
    opacity: 1;
}

.transaction-actions .btn-icon {
    width: 32px;
    height: 32px;
}

/* ===== FILTERS ===== */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-group {
    flex: 1;
    min-width: 120px;
}

.filter-select,
.filter-input {
    width: 100%;
    padding: 12px 16px;
    font-size: var(--font-size-sm);
    border: 2px solid var(--surface-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-color);
    color: var(--text-primary);
    transition: var(--transition);
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--text-color);
}

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: 20px;
}

.search-bar i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    font-size: var(--font-size-base);
    border: 2px solid var(--surface-color);
    border-radius: var(--border-radius);
    background: var(--bg-color);
    color: var(--text-primary);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--text-color);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state > i {
    font-size: 64px;
    color: var(--surface-color);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: var(--font-size-lg);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ===== BUDGET SECTION ===== */
.budget-main-card {
    background: var(--bg-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.budget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.budget-header h3 {
    font-size: var(--font-size-lg);
}

.budget-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.budget-stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value.income {
    color: var(--success-color);
}

.stat-value.expense {
    color: var(--danger-color);
}

.budget-progress-large {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-bar-large {
    flex: 1;
    height: 12px;
    background: var(--surface-color);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill-large {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--text-color));
    border-radius: 6px;
    transition: width 0.5s ease;
}

.progress-percentage {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    min-width: 50px;
    text-align: right;
}

/* Category Budgets */
.category-budgets {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.category-budget-item {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

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

.category-budget-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-budget-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-budget-name {
    font-weight: 500;
}

.category-budget-values {
    text-align: right;
}

.category-budget-spent {
    font-weight: 600;
    color: var(--text-primary);
}

.category-budget-limit {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.category-budget-progress {
    height: 6px;
    background: var(--surface-color);
    border-radius: 3px;
    overflow: hidden;
}

.category-budget-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Goals */
.goals-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.goal-card {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.goal-info h4 {
    font-size: var(--font-size-base);
    margin-bottom: 4px;
}

.goal-deadline {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.goal-actions {
    display: flex;
    gap: 4px;
}

.goal-progress-ring {
    display: flex;
    align-items: center;
    gap: 20px;
}

.progress-ring {
    width: 80px;
    height: 80px;
    position: relative;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--surface-color);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--text-color);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--text-primary);
}

.goal-values {
    flex: 1;
}

.goal-current {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.goal-target {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.goal-remaining {
    font-size: var(--font-size-xs);
    color: var(--text-color);
    margin-top: 4px;
}

.goal-add-btn {
    width: 100%;
    margin-top: 8px;
}

/* ===== REPORTS SECTION ===== */
.period-selector {
    display: flex;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 4px;
    margin-bottom: 20px;
}

.period-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.period-btn.active {
    background: var(--bg-color);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.summary-card.income {
    border-left: 4px solid var(--success-color);
}

.summary-card.expense {
    border-left: 4px solid var(--danger-color);
}

.summary-card.balance {
    border-left: 4px solid var(--text-color);
}

.summary-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.summary-card.income .summary-icon {
    background: var(--success-light);
    color: var(--success-color);
}

.summary-card.expense .summary-icon {
    background: var(--danger-light);
    color: var(--danger-color);
}

.summary-card.balance .summary-icon {
    background: var(--info-light);
    color: var(--info-color);
}

.summary-label {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-bottom: 4px;
}

.summary-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .report-summary {
        grid-template-columns: 1fr;
    }
    
    .summary-card {
        display: flex;
        align-items: center;
        gap: 16px;
    }
    
    .summary-icon {
        margin-bottom: 0;
    }
}

/* Chart Card */
.chart-card,
.breakdown-card,
.comparison-card {
    background: var(--bg-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.chart-card h3,
.breakdown-card h3,
.comparison-card h3 {
    font-size: var(--font-size-base);
    margin-bottom: 20px;
}

.chart-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 20px;
}

.chart-container canvas {
    width: 100% !important;
    height: auto !important;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-sm);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Breakdown List */
.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.breakdown-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.breakdown-info {
    flex: 1;
}

.breakdown-name {
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.breakdown-bar {
    height: 4px;
    background: var(--surface-color);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.breakdown-fill {
    height: 100%;
    border-radius: 2px;
}

.breakdown-values {
    text-align: right;
}

.breakdown-amount {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.breakdown-percent {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* Monthly Comparison */
.comparison-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.comparison-label {
    width: 40px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.comparison-bar-container {
    flex: 1;
    display: flex;
    gap: 4px;
}

.comparison-bar {
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: white;
    min-width: 40px;
}

.comparison-bar.income {
    background: var(--success-color);
}

.comparison-bar.expense {
    background: var(--danger-color);
}

/* ===== SETTINGS SECTION ===== */
.settings-group {
    margin-bottom: 24px;
}

.settings-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.settings-group-title i {
    color: var(--text-color);
}

.settings-card {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.setting-input {
    width: 100%;
    padding: 12px 16px;
    font-size: var(--font-size-base);
    border: 2px solid var(--surface-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition);
}

.setting-input:focus {
    outline: none;
    border-color: var(--text-color);
}

/* Toggle Switch */
.setting-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--surface-color);
}

.setting-toggle:last-child {
    border-bottom: none;
}

.toggle-info {
    flex: 1;
}

.toggle-label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toggle-description {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface-color);
    border-radius: 14px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--text-color);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* Categories List in Settings */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.category-setting-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
}

.category-setting-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.category-setting-name {
    flex: 1;
    font-weight: 500;
}

.category-setting-actions {
    display: flex;
    gap: 4px;
}

/* About Card */
.about-card {
    text-align: center;
}

.app-version {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: 8px;
}

.app-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== FAQ ===== */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: none;
    border: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--bg-secondary);
}

.faq-icon {
    transition: transform var(--transition);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 16px 16px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-answer[hidden] {
    display: none;
}

/* ===== MODALS ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(46, 52, 64, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: var(--bg-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.modal-small {
    max-width: 360px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--surface-color);
}

.modal-header h3 {
    font-size: var(--font-size-lg);
}

.modal-body {
    padding: 20px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions .btn {
    flex: 1;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
    font-family: inherit;
    border: 2px solid var(--surface-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--text-color);
    background: var(--bg-color);
}

.form-input.error,
.form-select.error {
    border-color: var(--danger-color);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Type Selector */
.type-selector {
    display: flex;
    gap: 12px;
}

.type-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: 2px solid var(--surface-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.type-btn.expense.active {
    border-color: var(--danger-color);
    background: var(--danger-light);
    color: var(--danger-color);
}

.type-btn.income.active {
    border-color: var(--success-color);
    background: var(--success-light);
    color: var(--success-color);
}

/* Icon Selector */
.icon-selector {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.icon-option {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.icon-option:hover {
    border-color: var(--text-color);
}

.icon-option.active {
    border-color: var(--text-color);
    background: var(--info-light);
    color: var(--text-color);
}

/* Color Selector */
.color-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-option {
    width: 36px;
    height: 36px;
    border: 3px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-color);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 20px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

@media (min-width: 768px) {
    .toast-container {
        bottom: 20px;
    }
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    pointer-events: auto;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast.warning {
    background: var(--warning-color);
    color: var(--text-primary);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* ===== FOOTER ===== */
.app-footer {
    text-align: center;
    padding: 24px 16px;
    margin-top: 40px;
    border-top: 1px solid var(--surface-color);
}

.app-footer p {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: 4px;
}

.app-footer .b20-link {
    color: var(--text-color);
    font-weight: 600;
    transition: var(--transition);
}

.app-footer .b20-link:hover {
    text-decoration: underline;
    transform: scale(1.02);
}

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg, var(--surface-color) 25%, var(--bg-secondary) 50%, var(--surface-color) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

/* ===== UTILITIES ===== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

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

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

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

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 480px) {
    .header-logo h1 {
        font-size: var(--font-size-base);
    }
    
    .welcome-card {
        padding: 20px;
    }
    
    .welcome-content h2 {
        font-size: var(--font-size-lg);
    }
    
    .balance-amount .value {
        font-size: var(--font-size-2xl);
    }
    
    .quick-actions {
        gap: 8px;
    }
    
    .action-btn {
        padding: 12px 8px;
    }
    
    .action-icon {
        width: 40px;
        height: 40px;
    }
    
    .budget-overview {
        gap: 8px;
    }
    
    .stat-value {
        font-size: var(--font-size-base);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .app-header,
    .bottom-nav,
    .modal,
    .toast-container {
        display: none !important;
    }
    
    body {
        padding: 0;
    }
    
    .section {
        display: block !important;
        page-break-inside: avoid;
    }
}
