:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: rgba(226, 232, 240, 0.8);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --sidebar-width: 400px;
    --header-height: 70px;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: rgba(51, 65, 85, 0.8);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(71, 85, 105, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0.05;
    z-index: -1;
}

/* Top Header */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.budget-summary {
    display: flex;
    gap: 3rem;
}

.budget-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.budget-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.budget-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.budget-value.spent {
    background: var(--warning-color);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.budget-value.remaining {
    background: var(--success-color);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-right {
    display: flex;
    gap: 0.75rem;
}

.icon-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 1.2rem;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

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

/* App Layout */
.app-layout {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    width: 100%;
    overflow-x: hidden;
}

/* Sidebar - Fixed */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    background: transparent;
    padding: 1.5rem;
    z-index: 100;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Glass Card Effect */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.month-filter {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
}

.month-filter:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.month-filter:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.edit-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s;
    padding: 0.25rem;
}

.edit-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Budget Overview Card */
.budget-overview-card .budget-amount {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 10px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.5s ease, background 0.3s ease;
    border-radius: 10px;
}

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

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

.budget-stats {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.salary-countdown {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Quick Add Card */
.amount-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 2px solid var(--border-color);
    transition: border-color 0.3s;
}

.amount-input-group:focus-within {
    border-color: #667eea;
}

.currency {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

#expenseAmount {
    flex: 1;
    border: none;
    background: none;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
}

.voice-btn {
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s;
}

.voice-btn:hover {
    transform: scale(1.1);
}

.voice-btn.listening {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Categories Grid - 2 rows of 4 */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.category-btn {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 0.65rem 0.4rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    color: var(--text-primary);
    min-height: 70px;
    justify-content: center;
}

.category-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.category-btn.selected {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.category-btn.selected span {
    color: white;
}

.category-btn span {
    font-size: 0.7rem;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
}

/* Optional Fields */
.optional-fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.optional-fields input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.optional-fields input:focus {
    outline: none;
    border-color: #667eea;
}

.optional-fields input[type="date"] {
    color-scheme: light;
}

[data-theme="dark"] .optional-fields input[type="date"] {
    color-scheme: dark;
}

/* Buttons */
.primary-btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

.secondary-btn {
    padding: 0.625rem 1.25rem;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

/* Suggestions */
.suggestions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggestion-chip {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.4rem 0.875rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}

.suggestion-chip:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

/* Streak Card */
.streak-card {
    text-align: center;
    padding: 1.25rem;
}

.streak-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.streak-number {
    font-size: 3rem;
    font-weight: 700;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.streak-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 1.5rem 2rem;
    min-height: calc(100vh - var(--header-height));
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.nav-tab {
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    bottom: -2px;
}

.nav-tab:hover {
    color: var(--text-primary);
}

.nav-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Tab Panes */
.tab-pane {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-pane.active {
    display: block;
}

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

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.chart-card {
    min-height: 350px;
    overflow: hidden;
}

.chart-card.large-chart {
    min-height: 500px;
    overflow: hidden;
}

.chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    min-height: 400px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Pie chart legend hover effect */
.chart-container [style*="border-left"]:hover {
    transform: translateX(4px) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
}

.chart-card canvas {
    max-height: 400px;
    max-width: 100%;
}

.chart-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.expense-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 8px;
}

.summary-icon {
    font-size: 2rem;
}

.summary-details {
    flex: 1;
}

.summary-category {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.summary-amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-percentage {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.full-width {
    grid-column: 1 / -1;
}

/* Smart Insights Grid */
.smart-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.insight-item {
    background: var(--bg-color);
    border-left: 4px solid #667eea;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.95rem;
}

.insight-item.warning {
    border-left-color: var(--warning-color);
}

.insight-item.success {
    border-left-color: var(--success-color);
}

.insight-item.info {
    border-left-color: #3b82f6;
}

/* Expenses Table */
.expenses-container {
    min-height: 600px;
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-controls select {
    padding: 0.625rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

.filter-controls select:focus {
    outline: none;
    border-color: #667eea;
}

.custom-date-range {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.custom-date-range input[type="date"] {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    color-scheme: light;
}

[data-theme="dark"] .custom-date-range input[type="date"] {
    color-scheme: dark;
}

.custom-date-range input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
}

.custom-date-range span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.apply-btn {
    padding: 0.5rem 1rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

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

.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.expenses-table {
    width: 100%;
    border-collapse: collapse;
}

.expenses-table thead {
    background: var(--bg-color);
}

.expenses-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.expenses-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.expenses-table tbody tr {
    transition: all 0.2s ease;
}

.expenses-table tbody tr:hover {
    background: var(--bg-color);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-emoji {
    font-size: 1.5rem;
}

.amount-cell {
    font-weight: 600;
    font-size: 1.05rem;
}

.delete-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

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

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.view-all-btn {
    background: none;
    border: none;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: transform 0.3s;
}

.view-all-btn:hover {
    transform: translateX(4px);
}

/* Insights Grid */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.chart-card.large {
    grid-column: 1 / -1;
    min-height: 400px;
}

.detailed-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

/* Daily Savings Goal Calculator */
.what-if-calculator {
    max-width: 700px;
    margin: 0 auto;
}

.calculator-content {
    margin-top: 1.5rem;
}

.calculator-content p {
    text-align: center;
    font-size: 1rem;
    line-height: 1.6;
}

.calculator-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.calc-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calc-input-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.input-with-currency {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: border-color 0.3s;
}

.input-with-currency:focus-within {
    border-color: #667eea;
}

.currency-symbol {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.input-with-currency input {
    flex: 1;
    border: none;
    background: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
}

.calc-input-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.calc-input-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
}

.calc-input-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    border: none;
}

.range-value {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 0.5rem;
}

.savings-results {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--border-color);
}

.result-card.highlight {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.result-label {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.result-card.highlight .result-label {
    opacity: 0.9;
}

.result-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.savings-breakdown {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

.breakdown-label {
    font-weight: 600;
    color: var(--text-primary);
}

.breakdown-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Budget Grid */
.budget-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.category-budgets-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-budget-item {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1rem;
}

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

.category-budget-header span {
    font-size: 1rem;
    font-weight: 600;
}

.category-budget-input {
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    width: 140px;
    text-align: right;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.category-budget-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Daily Savings Goal Calculator */
.what-if-card input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.what-if-card input:focus {
    outline: none;
    border-color: #667eea;
}

.what-if-result {
    margin-top: 1.5rem;
}

/* Reminders */
.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.reminder-item {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.reminder-item:hover {
    transform: translateX(4px);
}

.reminder-item.urgent {
    border-left: 4px solid var(--danger-color);
}

.reminder-item button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.reminder-item button:hover {
    opacity: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    animation: slideUp 0.3s;
    margin: auto;
}

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

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.menu-item {
    width: 100%;
    padding: 1rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.menu-item:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateX(4px);
}

.menu-item.danger:hover {
    background: var(--danger-color);
}

.menu-item.primary {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.menu-item.primary:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

/* Menu Sections */
.menu-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.menu-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.menu-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Profile Form */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Greeting Section */
.greeting-section {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.greeting {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #667eea;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Footer */
.app-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    text-align: center;
    margin-top: 2rem;
    position: relative;
    z-index: 10;
}

.app-footer p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.app-footer strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-grid,
    .insights-grid {
        grid-template-columns: 1fr;
    }
    
    .budget-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 968px) {
    :root {
        --sidebar-width: 0;
    }
    
    .app-layout {
        flex-direction: column;
        margin-top: var(--header-height);
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        max-width: 100%;
        height: auto;
        padding: 0;
        top: 0;
        left: 0;
        z-index: 1;
    }
    
    .sidebar-content {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        height: auto;
        overflow-y: visible;
    }
    
    .greeting-section {
        padding: 0.75rem 0;
        margin-bottom: 0.5rem;
    }
    
    .greeting {
        font-size: 1.2rem;
    }
    
    .budget-overview-card,
    .quick-add-card {
        margin-bottom: 0;
    }
    
    .main-content {
        margin-left: 0;
        margin-top: 1rem;
        padding: 1rem;
        width: 100%;
        position: relative;
        z-index: 5;
    }
    
    .top-header {
        padding: 0 1rem;
    }
    
    .header-center {
        display: none;
    }
    
    .budget-summary {
        display: none;
    }
    
    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.5rem;
        padding: 1rem;
        margin-bottom: 1.5rem;
        margin-top: 1rem;
        background: var(--bg-color);
        border-radius: 12px;
        position: relative;
        z-index: 10;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    
    .nav-tab {
        white-space: nowrap;
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
        min-width: fit-content;
        border-radius: 8px;
    }
    
    .nav-tab.active {
        background: var(--primary-gradient);
        color: white;
        border-bottom-color: transparent;
    }
    
    .tab-pane {
        padding: 0;
    }
    
    .chart-container {
        padding: 0.5rem;
        min-height: 300px;
        overflow-x: hidden;
    }
    
    .glass-card {
        padding: 1rem;
        margin-bottom: 1rem;
        max-width: 100%;
        overflow: hidden;
    }
    
    .card-header {
        margin-bottom: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 640px) {
    .top-header {
        height: 60px;
    }
    
    :root {
        --header-height: 60px;
    }
    
    .header-left h1 {
        font-size: 1rem;
    }
    
    .icon-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .sidebar-content {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .greeting-section {
        padding: 0.5rem 0;
        margin-bottom: 0.25rem;
    }
    
    .greeting {
        font-size: 1.1rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .category-btn {
        padding: 0.5rem 0.25rem;
        font-size: 0.7rem;
    }
    
    .category-btn span {
        font-size: 0.6rem;
    }
    
    .amount-input-group input {
        font-size: 1.2rem;
    }
    
    .glass-card {
        padding: 0.75rem;
        max-width: 100%;
        overflow: hidden;
    }
    
    .budget-amount {
        font-size: 1.8rem;
    }
    
    .expenses-table {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .expenses-table thead,
    .expenses-table tbody,
    .expenses-table tr {
        display: block;
        width: 100%;
    }
    
    .expenses-table thead {
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--card-bg);
    }
    
    .expenses-table th {
        padding: 0.5rem 0.4rem;
        font-size: 0.65rem;
        text-align: center;
        white-space: nowrap;
        display: inline-block;
        vertical-align: middle;
    }
    
    .expenses-table th:nth-child(1) { width: 15%; } /* Date */
    .expenses-table th:nth-child(2) { width: 22%; } /* Category */
    .expenses-table th:nth-child(3) { width: 25%; } /* Description */
    .expenses-table th:nth-child(4) { width: 18%; } /* Amount */
    .expenses-table th:nth-child(5) { width: 20%; } /* Actions */
    
    .expenses-table td {
        padding: 0.6rem 0.4rem;
        font-size: 0.7rem;
        text-align: center;
        display: inline-block;
        vertical-align: middle;
        word-wrap: break-word;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .expenses-table td:nth-child(1) { width: 15%; } /* Date */
    .expenses-table td:nth-child(2) { width: 22%; } /* Category */
    .expenses-table td:nth-child(3) { width: 25%; } /* Description */
    .expenses-table td:nth-child(4) { width: 18%; } /* Amount */
    .expenses-table td:nth-child(5) { width: 20%; } /* Actions */
    
    .category-cell {
        flex-direction: column;
        gap: 0.2rem;
        font-size: 0.65rem;
    }
    
    .category-emoji {
        font-size: 1.2rem;
    }
    
    .amount-cell {
        font-size: 0.75rem;
        font-weight: 700;
    }
    
    .delete-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.65rem;
        white-space: nowrap;
    }
    
    .card-header h3 {
        font-size: 0.95rem;
    }
    
    .card-subtitle {
        font-size: 0.75rem;
    }
    
    .month-filter {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
    
    .modal {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        max-height: none;
        padding: 1.5rem;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        margin-top: 0;
        margin-bottom: 0;
    }
    
    .nav-tabs {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .nav-tab {
        font-size: 0.8rem;
        padding: 0.65rem 0.85rem;
    }
    
    .main-content {
        padding: 0.75rem;
        margin-top: 0.75rem;
    }
    
    .dashboard-grid,
    .insights-grid {
        gap: 0.75rem;
    }
    
    .chart-container {
        padding: 0.5rem;
        overflow-x: hidden;
    }
    
    .app-footer {
        padding: 1rem 0.75rem;
        margin-top: 1rem;
    }
    
    .form-group input {
        font-size: 0.9rem;
        padding: 0.6rem;
    }
    
    .nav-tabs {
        padding: 0.5rem;
        gap: 0.25rem;
    }
    
    .nav-tab {
        font-size: 0.75rem;
        padding: 0.6rem 0.75rem;
    }
    
    .greeting {
        font-size: 1.1rem;
    }
    
    .budget-amount {
        font-size: 1.8rem;
    }
    
    .app-footer {
        padding: 1rem;
        font-size: 0.8rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
    }
    
    [data-theme="dark"] {
        --border-color: #fff;
    }
    
    .glass-card {
        border-width: 2px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .top-header,
    .nav-tabs,
    .icon-btn,
    .primary-btn,
    .secondary-btn,
    .delete-btn {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .glass-card {
        break-inside: avoid;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Focus Styles for Accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--border-color);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
