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

:root {
    /* Premium Fintech Color Palette */
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --cyan: #06B6D4;
    --cyan-dark: #0891B2;
    --cyan-light: #22D3EE;
    --success: #10B981;
    --success-dark: #059669;
    --danger: #EF4444;
    --danger-dark: #DC2626;
    --warning: #F59E0B;
    --info: #06B6D4;
    
    /* Neutral Colors */
    --dark: #0F172A;
    --dark-light: #1E293B;
    --text-primary: #0F172A;
    --text-secondary: #64748B;
    --text-muted: #94A3AF;
    
    /* Background Colors */
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-gradient: radial-gradient(circle at 20% 50%, rgba(79, 70, 229, 0.15) 0%, transparent 50%),
                   radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
                   linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: #FFFFFF;
    
    /* Border & Shadows */
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --glow-primary: 0 0 20px rgba(79, 70, 229, 0.4);
    --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.4);
    --glow-success: 0 0 20px rgba(16, 185, 129, 0.4);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.18);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Spacing */
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
}

[data-theme="dark"] {
    --bg-gradient: radial-gradient(circle at 20% 50%, rgba(79, 70, 229, 0.2) 0%, transparent 50%),
                   radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.2) 0%, transparent 50%),
                   linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    --bg-primary: #0F1117;
    --bg-secondary: #1A1D29;
    --card-bg: #1A1D29;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --border: #374151;
    --border-light: #2D3142;
    --glass-bg: rgba(26, 29, 41, 0.75);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    padding: var(--space-lg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.6;
    opacity: 0;
    animation: pageLoad 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pageLoad {
    to { opacity: 1; }
}

.app-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease;
}

.header-section {
    margin-bottom: 40px;
}

header {
    animation: fadeInDown 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 50px;
    width: 50px;
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

header p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.theme-toggle {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--cyan));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-toggle:hover::before {
    opacity: 1;
}

.theme-toggle i {
    position: relative;
    z-index: 1;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: var(--glow-primary), 0 6px 20px rgba(79, 70, 229, 0.5);
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.summary-section,
.insights-section,
.salary-input-section,
.input-section,
.expense-section,
.chart-section,
.alert-section {
    width: 100%;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 22px;
    margin-bottom: 0;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--glass-border);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.summary-cards .card {
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
    position: relative;
    overflow: visible;
}

.summary-cards .card::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-lg);
    padding: 2px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.summary-cards .card:hover::after {
    opacity: 1;
}

.summary-cards .card:nth-child(1) { animation-delay: 0.1s; }
.summary-cards .card:nth-child(2) { animation-delay: 0.15s; }
.summary-cards .card:nth-child(3) { animation-delay: 0.25s; }
.summary-cards .card:nth-child(4) { animation-delay: 0.35s; }

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    flex-shrink: 0;
    position: relative;
}

.card-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: inherit;
    filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.summary-cards .card:hover .card-icon::before {
    opacity: 0.6;
}

.summary-cards .card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-md);
}

.salary-card .card-icon {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
}

.expense-card .card-icon {
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
}

.balance-card .card-icon {
    background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
}

.card-content h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.card-content .amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.summary-cards .card:hover .amount {
    transform: scale(1.05);
    color: var(--primary);
    text-shadow: 0 4px 8px rgba(91, 79, 233, 0.2);
}

.progress-card {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 120px;
}

.progress-circle {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(91, 79, 233, 0.2));
}

.progress-circle svg {
    transform: rotate(-90deg);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

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

.progress-bar {
    fill: none;
    stroke: var(--success);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.progress-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.insights-card {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.5s backwards;
}

.salary-input-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid var(--primary);
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.6s backwards;
    position: relative;
    box-shadow: 0 8px 24px rgba(91, 79, 233, 0.15);
}

.salary-input-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

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

.salary-input-card:hover {
    border-color: var(--primary-dark);
    box-shadow: 0 12px 32px rgba(91, 79, 233, 0.25);
    transform: translateY(-4px);
}

.salary-input-card h2 {
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    font-size: 1.3rem;
}

.salary-input-card .section-description {
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
}

.salary-input-card .form-group {
    margin-bottom: var(--space-md);
}

.salary-input-card .btn-primary {
    margin-top: var(--space-md);
}

.section-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: -12px;
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

.salary-input-card .error-message {
    margin-top: var(--space-sm);
    margin-bottom: var(--space-sm);
    min-height: 24px;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.insight-card {
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.insight-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.insight-card:hover::before {
    transform: scaleY(1);
}

.insight-card:hover {
    background: var(--bg-primary);
    border-color: var(--primary-light);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.insight-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
    transition: all 0.3s ease;
}

.insight-card:hover .insight-icon {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: var(--glow-cyan), 0 6px 16px rgba(6, 182, 212, 0.4);
}

.insight-content {
    flex: 1;
}

.insight-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

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

.input-section h2,
.salary-input-card h2,
.card-header h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.input-wrapper {
    display: flex;
    gap: 10px;
}

.input-wrapper select {
    width: 180px;
    flex-shrink: 0;
    font-size: 1rem;
}

.input-wrapper input {
    flex: 1;
}

input, select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-secondary);
    font-weight: 500;
    color: var(--text-primary);
    font-family: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(91, 79, 233, 0.1);
    transform: translateY(-1px);
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
}

.error-message {
    color: var(--danger);
    font-size: 0.9rem;
    margin-bottom: 15px;
    min-height: 20px;
    font-weight: 500;
}

.btn {
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    position: relative;
    overflow: hidden;
    font-family: inherit;
    box-shadow: var(--shadow);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

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

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    width: 100%;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #3730A3);
    box-shadow: var(--glow-primary), 0 6px 20px rgba(79, 70, 229, 0.45);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--primary);
    border: 1.5px solid var(--border);
    font-weight: 600;
    padding: 10px 18px;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(91, 79, 233, 0.25);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
    color: white;
    padding: 10px 20px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-dark), #b91c1c);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

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

.header-actions-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.expense-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input,
.filter-select {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    background: var(--light);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-input:focus,
.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.expense-list {
    max-height: 400px;
    overflow-y: auto;
}

.expense-list::-webkit-scrollbar {
    width: 8px;
}

.expense-list::-webkit-scrollbar-track {
    background: var(--light);
    border-radius: 4px;
}

.expense-list::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 4px;
}

.empty-state-container {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 4rem;
    color: var(--gray-light);
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-style: italic;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: var(--space-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-light);
    position: relative;
}

.expense-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--success));
    border-radius: var(--radius) 0 0 var(--radius);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.expense-item:hover::before {
    opacity: 1;
}

.expense-item:hover {
    background: var(--bg-primary);
    transform: translateX(6px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.expense-info {
    flex: 1;
}

.expense-info h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.category-Food { background: #fef3c7; color: #92400e; }
.category-Travel { background: #dbeafe; color: #1e40af; }
.category-Bills { background: #fce7f3; color: #9f1239; }
.category-Shopping { background: #dcfce7; color: #166534; }
.category-Other { background: #e0e7ff; color: #3730a3; }

.expense-info p {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--danger);
}

.expense-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.delete-btn {
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    flex-shrink: 0;
}

.delete-btn:hover {
    background: linear-gradient(135deg, var(--danger-dark), #b91c1c);
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}

.chart-card {
    overflow: hidden;
}

.chart-card h2 {
    text-align: center;
}

.chart-card canvas {
    max-height: 400px;
    max-width: 100%;
    width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
}

.alert {
    padding: 18px 24px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 600;
    animation: shake 0.6s cubic-bezier(0.4, 0, 0.2, 1), fadeIn 0.5s ease;
    box-shadow: var(--shadow-lg);
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-left: 5px solid var(--warning);
}

.alert i {
    font-size: 1.3rem;
    animation: pulse 2s infinite;
}

.balance-warning {
    color: var(--danger) !important;
    animation: pulse 2s infinite;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    transform: translateX(400px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast i {
    font-size: 1.3rem;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-icon {
    font-size: 4rem;
    color: var(--warning);
    margin-bottom: 20px;
}

.modal-content h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

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

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

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

@media (max-width: 768px) {
    /* Force box-sizing for all elements */
    * {
        box-sizing: border-box;
    }

    /* Main wrapper padding */
    body {
        padding: 15px;
    }

    .app-wrapper {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    /* Main content flex direction */
    .main-content {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
        max-width: 100%;
    }

    /* Force all major sections to full width */
    .summary-section,
    .insights-section,
    .salary-input-section,
    .input-section,
    .expense-section,
    .chart-section,
    .alert-section {
        width: 100%;
        max-width: 100%;
    }

    /* Header adjustments */
    .header-section {
        margin-bottom: 30px;
        position: relative;
        padding-top: 60px;
        width: 100%;
        max-width: 100%;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        width: 100%;
    }

    .theme-toggle {
        position: absolute;
        top: 10px;
        right: 10px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    header p {
        font-size: 1rem;
    }

    /* Cards full width */
    .card {
        width: 100%;
        max-width: 100%;
        padding: 20px;
    }

    /* Summary cards stack vertically */
    .summary-cards {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        gap: 15px;
        width: 100%;
    }

    .summary-cards .card {
        width: 100%;
        max-width: 100%;
    }

    /* Progress card centered layout */
    .progress-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 30px 20px;
        min-height: 180px;
        justify-content: center;
        align-items: center;
        overflow: visible;
    }

    .progress-card .card-content {
        width: 100%;
    }

    /* Center progress circle */
    .progress-circle {
        margin: 0 auto;
        width: 80px;
        height: 80px;
    }

    .progress-circle svg {
        width: 80px;
        height: 80px;
    }

    /* Form adjustments */
    .form-row {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        gap: 15px;
    }

    .form-group {
        width: 100%;
        max-width: 100%;
    }

    /* Input wrapper stack vertically */
    .input-wrapper {
        flex-direction: column;
        width: 100%;
    }

    .input-wrapper input,
    .input-wrapper select {
        width: 100%;
        max-width: 100%;
    }

    /* All buttons full width */
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-danger {
        width: 100%;
        max-width: 100%;
        justify-content: center;
    }

    /* Card header stack vertically */
    .card-header {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    /* Action buttons full width */
    .header-actions-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .header-actions-group .btn {
        width: 100%;
        justify-content: center;
    }

    /* Expense filters stack vertically */
    .expense-filters {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .search-input,
    .filter-select {
        width: 100%;
        max-width: 100%;
    }

    /* Insights grid single column */
    .insights-grid {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        gap: 15px;
        width: 100%;
    }

    .insight-card {
        width: 100%;
        max-width: 100%;
    }

    /* Center chart */
    .chart-card {
        width: 100%;
        max-width: 100%;
        text-align: center;
    }

    .chart-card canvas {
        max-height: 280px !important;
        width: 100% !important;
        margin: 0 auto;
    }

    /* Toast notifications */
    .toast {
        right: 10px;
        left: 10px;
        top: 10px;
        width: calc(100% - 20px);
        max-width: calc(100% - 20px);
    }

    /* Modal adjustments */
    .modal-content {
        padding: 30px 20px;
        width: 90%;
        max-width: 90%;
    }

    .modal-actions {
        flex-direction: column;
        width: 100%;
    }

    .modal-actions .btn {
        width: 100%;
    }

    /* Expense list */
    .expense-list {
        width: 100%;
        max-width: 100%;
    }

    .expense-item {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .header-logo {
        height: 30px;
        width: 30px;
    }

    .card {
        padding: 20px;
    }

    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }

    .card-content .amount {
        font-size: 1.5rem;
    }

    .progress-card {
        padding: 25px 20px;
        min-height: 180px;
        justify-content: center;
        overflow: visible;
    }

    .progress-circle {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }

    .progress-circle svg {
        width: 80px;
        height: 80px;
    }

    .progress-text {
        font-size: 1rem;
    }

    .card-content h3 {
        font-size: 0.95rem;
    }

    .chart-card canvas {
        max-height: 240px !important;
    }
}
