/* CSS Variables - Design System */
:root {
    --primary: #1A237E;
    --primary-dark: #0D1642;
    --primary-light: #534BAE;
    --secondary: #FF8F00;
    --secondary-dark: #C56000;
    --secondary-light: #FFC046;
    --accent: #C5CAE9;
    
    --success: #4CAF50;
    --danger: #F44336;
    --warning: #FF9800;
    --info: #2196F3;
    
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-disabled: #BDBDBD;
    --text-white: #FFFFFF;
    
    --bg-primary: #FAFAFA;
    --bg-card: #FFFFFF;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    --border-color: #E0E0E0;
    --divider-color: #EEEEEE;
    
    --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.16);
    --shadow-3: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-4: 0 8px 24px rgba(0, 0, 0, 0.18);
    
    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 16px;
    --radius-full: 50%;
    
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
    
    --app-bar-height: 56px;
    --bottom-nav-height: 64px;
    --fab-size: 56px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
    width: 100%;
    height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

/* Top App Bar */
.app-bar {
    height: var(--app-bar-height);
    background: var(--primary);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    position: relative;
    box-shadow: var(--shadow-2);
    z-index: 100;
    flex-shrink: 0;
}

.app-bar-title {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.15px;
}

.app-bar-action {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-white);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.app-bar-action:active {
    background: rgba(255, 255, 255, 0.12);
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(var(--bottom-nav-height) + 16px);
}

/* Screen Management */
.screen {
    display: none;
    animation: slideIn 300ms ease-out;
    padding: 16px;
    min-height: calc(100vh - var(--app-bar-height) - var(--bottom-nav-height));
}

.screen.active {
    display: block;
}

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

/* Stats Grid (Dashboard) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-medium);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-1);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-2);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-small);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.income-card .stat-icon {
    background: rgba(76, 175, 80, 0.12);
    color: var(--success);
}

.expense-card .stat-icon {
    background: rgba(244, 67, 54, 0.12);
    color: var(--danger);
}

.balance-card .stat-icon {
    background: rgba(255, 143, 0, 0.12);
    color: var(--secondary);
}

.transactions-card .stat-icon {
    background: rgba(26, 35, 126, 0.12);
    color: var(--primary);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}

/* Section */
.section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: 0.15px;
}

/* Transaction List Item */
.transaction-item {
    background: var(--bg-card);
    border-radius: var(--radius-medium);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-1);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.transaction-item:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-2);
}

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

.transaction-item.income .transaction-icon {
    background: rgba(76, 175, 80, 0.12);
    color: var(--success);
}

.transaction-item.expense .transaction-icon {
    background: rgba(244, 67, 54, 0.12);
    color: var(--danger);
}

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

.transaction-category {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.transaction-description {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.transaction-amount {
    font-size: 16px;
    font-weight: 700;
    text-align: right;
}

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

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

/* Search Bar */
.search-bar {
    background: var(--bg-card);
    border-radius: 28px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-1);
}

.search-icon {
    color: var(--text-secondary);
    font-size: 24px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    font-size: 16px;
    color: var(--text-primary);
    font-family: inherit;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

/* Filter Chips */
.filter-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 8px 16px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    font-family: inherit;
}

.chip.active {
    background: var(--primary);
    color: var(--text-white);
    border-color: var(--primary);
}

.chip:active:not(.active) {
    background: var(--accent);
}

/* Budget Item */
.budget-item {
    background: var(--bg-card);
    border-radius: var(--radius-medium);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-1);
}

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

.budget-category {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.budget-amounts {
    font-size: 14px;
    color: var(--text-secondary);
}

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

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

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width var(--transition-normal);
    border-radius: 4px;
}

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

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

.budget-percentage {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
}

/* Report Card */
.report-card {
    background: var(--bg-card);
    border-radius: var(--radius-medium);
    padding: 16px;
    box-shadow: var(--shadow-1);
}

.report-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.report-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.report-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

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

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

.report-divider {
    height: 1px;
    background: var(--divider-color);
    margin: 4px 0;
}

/* Category Breakdown */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    background: var(--bg-card);
    border-radius: var(--radius-medium);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-1);
}

.category-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.category-amount {
    font-size: 14px;
    font-weight: 700;
    color: var(--danger);
}

/* Spending Chart */
.spending-chart {
    padding: 16px 0;
    min-height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 12px;
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bar-fill {
    width: 100%;
    background: linear-gradient(180deg, var(--primary-light), var(--primary));
    border-radius: 4px 4px 0 0;
    transition: height var(--transition-slow);
    min-height: 20px;
}

.bar-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.bar-value {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    min-height: 300px;
}

.empty-icon {
    font-size: 72px;
    color: var(--text-disabled);
    margin-bottom: 16px;
}

.empty-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Bottom Navigation */
.bottom-nav {
    height: var(--bottom-nav-height);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    transition: color var(--transition-fast);
    font-family: inherit;
    min-height: 48px;
}

.nav-item .material-icons {
    font-size: 24px;
    transition: transform var(--transition-fast);
}

.nav-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.4px;
}

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

.nav-item.active .material-icons {
    transform: scale(1.1);
}

.nav-item:active .material-icons {
    transform: scale(0.9);
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    right: calc(50% - 240px + 16px);
    width: var(--fab-size);
    height: var(--fab-size);
    border-radius: var(--radius-full);
    background: var(--secondary);
    color: var(--text-white);
    border: none;
    box-shadow: var(--shadow-3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    z-index: 90;
}

.fab .material-icons {
    font-size: 24px;
}

.fab:active {
    transform: scale(0.9);
    box-shadow: var(--shadow-2);
}

@media (max-width: 480px) {
    .fab {
        right: 16px;
    }
}

/* Bottom Sheet */
.bottom-sheet {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
}

.bottom-sheet.active {
    display: block;
    animation: fadeIn 250ms ease-out;
}

.bottom-sheet-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    animation: fadeIn 250ms ease-out;
}

.bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: var(--bg-card);
    border-radius: var(--radius-large) var(--radius-large) 0 0;
    overflow-y: auto;
    animation: slideUp 300ms ease-out;
}

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

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
    }
    to {
        transform: translate(-50%, 0);
    }
}

.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--divider-color);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.bottom-sheet-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
}

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

.icon-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

/* Form Styles */
.form {
    padding: 20px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 16px 12px 8px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--primary);
}

.form-input:focus + .floating-label,
.form-input:not(:placeholder-shown) + .floating-label,
.form-input:valid + .floating-label {
    top: 4px;
    font-size: 12px;
    color: var(--primary);
}

.floating-label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all var(--transition-fast);
    background: var(--bg-card);
    padding: 0 4px;
}

/* Toggle Group */
.toggle-group {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.toggle-btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-small);
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}

.toggle-btn .material-icons {
    font-size: 20px;
}

.toggle-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-white);
}

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

/* Category Suggestions */
.category-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chip-small {
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.chip-small:active {
    background: var(--accent);
    border-color: var(--primary);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--divider-color);
}

.btn-primary, .btn-secondary, .btn-danger {
    flex: 1;
    padding: 14px 24px;
    border-radius: var(--radius-small);
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-white);
    box-shadow: var(--shadow-1);
}

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

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:active {
    background: var(--accent);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-white);
    box-shadow: var(--shadow-1);
}

.btn-danger:active {
    background: #D32F2F;
    transform: scale(0.98);
}

/* Detail Content */
.detail-content {
    padding: 20px;
}

.detail-amount {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.detail-type {
    font-size: 14px;
    text-align: center;
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
    margin: 0 auto 24px;
    width: 100%;
    text-align: center;
    font-weight: 500;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--divider-color);
}

.detail-row:last-of-type {
    border-bottom: none;
}

.detail-icon {
    color: var(--text-secondary);
    font-size: 24px;
    margin-top: 4px;
}

.detail-info {
    flex: 1;
}

.detail-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.detail-value {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

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

.detail-actions .btn-secondary,
.detail-actions .btn-danger {
    flex: 1;
}

/* Dialog */
.dialog {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
}

.dialog.active {
    display: flex;
    animation: fadeIn 200ms ease-out;
}

.dialog-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
}

.dialog-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-large);
    padding: 24px;
    margin: 20px;
    max-width: 320px;
    width: 100%;
    box-shadow: var(--shadow-4);
    animation: scaleIn 250ms ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.dialog-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.dialog-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.dialog-actions .btn-secondary,
.dialog-actions .btn-danger {
    flex: 0;
    padding: 10px 24px;
}

/* Snackbar */
.snackbar {
    display: none !important;
}

/* Scrollbar Styling */
.content-area::-webkit-scrollbar {
    width: 4px;
}

.content-area::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
    background: var(--text-disabled);
    border-radius: 2px;
}

.bottom-sheet-content::-webkit-scrollbar {
    width: 4px;
}

.bottom-sheet-content::-webkit-scrollbar-track {
    background: transparent;
}

.bottom-sheet-content::-webkit-scrollbar-thumb {
    background: var(--text-disabled);
    border-radius: 2px;
}

/* Transactions List */
.transactions-list {
    display: flex;
    flex-direction: column;
}

.transactions-list:empty + .empty-state {
    display: flex !important;
}

/* Budget List */
.budget-list {
    display: flex;
    flex-direction: column;
}

.budget-list:empty + .empty-state {
    display: flex !important;
}

/* Chat Screen */
.screen-chat {
    padding: 0;
    flex-direction: column;
    min-height: auto;
}

.screen.screen-chat.active {
    display: flex;
    min-height: 100%;
    height: 100%;
}

.chat-messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

.chat-welcome {
    text-align: center;
    padding: 32px 24px;
}

.chat-welcome-icon {
    font-size: 56px;
    color: var(--accent);
    margin-bottom: 16px;
}

.chat-welcome-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.chat-welcome-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.5;
}

.chat-bubble.user {
    align-self: flex-end;
    background: var(--primary);
    color: var(--text-white);
    border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
    align-self: flex-start;
    background: var(--bg-card);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-1);
}

.chat-bubble .chat-typing {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.chat-bubble .chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: chatBounce 1.4s ease-in-out infinite both;
}

.chat-bubble .chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-bubble .chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.chat-input-area {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-card);
    border-top: 1px solid var(--divider-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
    font-family: inherit;
}

.chat-input:focus {
    border-color: var(--primary);
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: var(--text-white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.chat-send-btn:active {
    transform: scale(0.92);
}

.chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.goal-card {
    background: var(--bg-card);
    border-radius: var(--radius-medium);
    padding: 16px;
    box-shadow: var(--shadow-1);
}

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

.goal-name {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-primary);
}

.goal-amounts {
    font-size: 14px;
    color: var(--text-secondary);
}

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

.progress-bar.goal-progress {
    height: 10px;
}

.goal-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.goal-card-actions button {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: var(--radius-small);
    border: none;
    background: var(--bg-primary);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    font-weight: 500;
}

.goal-card-actions button:active {
    background: var(--accent);
}

.goal-card-actions .btn-delete-goal {
    color: var(--danger);
}

/* AI Insight buttons */
.insight-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.insight-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: var(--radius-small);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    box-shadow: var(--shadow-1);
}

.insight-btn .material-icons {
    font-size: 18px;
}

.insight-btn:active {
    background: var(--accent);
    transform: scale(0.98);
}

.insight-btn:hover {
    border-color: var(--primary);
}

/* AI Insight sheet */
.insight-sheet-content {
    padding: 0 20px 24px;
    min-height: 120px;
}

.insight-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
    color: var(--text-secondary);
}

.insight-loading-icon {
    font-size: 40px;
    color: var(--accent);
    animation: pulse 1.5s ease-in-out infinite;
}

.insight-result {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-primary);
    white-space: pre-wrap;
}

/* Bottom nav with 6 items - slightly smaller labels */
.bottom-nav .nav-label {
    font-size: 10px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-8 {
    margin-top: 8px;
}

.mt-16 {
    margin-top: 16px;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-16 {
    margin-bottom: 16px;
}

/* Responsive adjustments */
@media (max-width: 360px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 18px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}
