/* CSS Variables for Theme Management */
:root {
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-color: #f093fb;
    --accent-color: #764ba2;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-color: #1a202c;
    --text-primary: #1a202c;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --success-color: #48bb78;
    --error-color: #f56565;
    --warning-color: #ed8936;
    --info-color: #4299e1;
    --input-bg: #ffffff;
    --card-bg: #ffffff;
    --hover-bg: rgba(102, 126, 234, 0.1);
}

[data-theme="dark"] {
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-color: #f093fb;
    --accent-color: #764ba2;
    --background-color: #1a202c;
    --surface-color: #2d3748;
    --text-color: #f7fafc;
    --text-primary: #f7fafc;
    --text-secondary: #a0aec0;
    --border-color: #4a5568;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --success-color: #68d391;
    --error-color: #fc8181;
    --warning-color: #f6ad55;
    --info-color: #63b3ed;
    --input-bg: #374151;
    --card-bg: #374151;
    --hover-bg: rgba(102, 126, 234, 0.2);
}

/* Dark mode enhancements for current period header */
[data-theme="dark"] .current-period-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .current-period-header .period-stats span {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dark mode navigation and buttons */
[data-theme="dark"] .nav-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .nav-btn.active {
    background: var(--primary-gradient);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

[data-theme="dark"] .nav-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Dark mode summary cards */
[data-theme="dark"] .summary-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* Dark mode forms */
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select {
    background: linear-gradient(135deg, var(--input-bg), var(--surface-color));
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .form-group input:hover,
[data-theme="dark"] .form-group select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.25), 0 4px 15px rgba(99, 102, 241, 0.2);
    background: var(--surface-color);
}

[data-theme="dark"] .form-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.2);
}

[data-theme="dark"] .form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a78bfa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .form-group input::placeholder {
    color: var(--text-secondary);
}

/* Dark mode custom range */
[data-theme="dark"] .range-input {
    background: linear-gradient(135deg, var(--input-bg), var(--surface-color));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .range-input:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .range-input::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.2);
}

[data-theme="dark"] .quick-range-btn {
    background: linear-gradient(135deg, var(--input-bg), var(--surface-color));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Dark mode transaction items */
[data-theme="dark"] .transaction-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .transaction-item:hover {
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
}

/* Dark mode buttons */
[data-theme="dark"] .submit-btn:hover,
[data-theme="dark"] .save-btn:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

[data-theme="dark"] .cancel-btn {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .cancel-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Global Mobile-Optimized Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* Premium Header Styles */
.header {
    background: linear-gradient(135deg, var(--surface-color), var(--background-color));
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
    border-image: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color)) 1;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #667eea);
    background-size: 300% 100%;
    animation: headerShimmer 4s ease-in-out infinite;
}

@keyframes headerShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    background-size: 200% 200%;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: logoBreath 4s ease-in-out infinite;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes logoBreath {
    0%, 100% { 
        background-position: 0% 50%;
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% { 
        background-position: 100% 50%;
        box-shadow: 0 12px 40px rgba(102, 126, 234, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

.logo-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(115, 103, 240, 0.4);
}

.logo-icon i {
    color: white;
    font-size: 1rem;
    position: absolute;
    transition: all 0.3s ease;
}

.logo-icon .fa-coins {
    transform: translate(-4px, -2px);
    z-index: 2;
    animation: coinFloat 3s ease-in-out infinite;
}

.logo-icon .fa-chart-line {
    transform: translate(4px, 2px);
    z-index: 1;
    opacity: 0.8;
    font-size: 0.9rem;
    animation: chartPulse 2s ease-in-out infinite;
}

@keyframes coinFloat {
    0%, 100% { transform: translate(-4px, -2px); }
    50% { transform: translate(-4px, -4px); }
}

@keyframes chartPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.logo-text h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-text small {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

.logo i {
    font-size: 2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo 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-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
    backdrop-filter: blur(20px);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .theme-toggle {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.9), rgba(26, 32, 44, 0.6));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.6s ease;
}

.theme-toggle:hover::before {
    left: 100%;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.sign-in-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.sign-in-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.sign-in-btn:hover::before {
    left: 100%;
}

.sign-in-btn:hover {
    background-position: 100% 50%;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.sign-out-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sign-out-btn:hover {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.connection-status {
    display: none;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0.25rem;
}

.connection-status.connected {
    display: none;
    color: var(--success-color);
}

.connection-status.demo {
    display: none;
    color: var(--warning-color);
}

/* Premium Category Section */
.category-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    backdrop-filter: blur(25px);
    padding: 1rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--primary-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
    position: relative;
}

[data-theme="dark"] .category-section {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.85));
    border: 1px solid rgba(75, 85, 99, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.1);
}

.category-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.category-tabs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6));
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .category-tab {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.6), rgba(55, 65, 81, 0.4));
    border: 1px solid rgba(75, 85, 99, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.category-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.6s ease;
}

.category-tab:hover::before {
    left: 100%;
}

.category-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.15);
    border-color: var(--primary-color);
}

[data-theme="dark"] .category-tab:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
}

.category-tab.active {
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.category-tab.active i {
    color: rgba(255, 255, 255, 0.9);
}

.category-tab.add-category {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.8), rgba(5, 150, 105, 0.6));
    color: white;
    border-color: rgba(16, 185, 129, 0.5);
}

.category-tab.add-category:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.8));
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
}

.category-tab i {
    font-size: 1rem;
    transition: all 0.3s ease;
}

.category-actions {
    display: flex;
    align-items: center;
}

.category-manage-btn {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.8), rgba(75, 85, 99, 0.6));
    border: 1px solid rgba(107, 114, 128, 0.4);
    color: var(--text-secondary);
    padding: 0.6rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-manage-btn:hover {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.9), rgba(75, 85, 99, 0.8));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.2);
}

[data-theme="dark"] .category-manage-btn {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.6), rgba(55, 65, 81, 0.4));
    border: 1px solid rgba(75, 85, 99, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .category-manage-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Category Modal Styles */
.icon-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-option {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 1rem;
    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.3rem;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    aspect-ratio: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.icon-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.6s ease;
}

.icon-option:hover::before {
    left: 100%;
}

.icon-option:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.icon-option.active {
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.icon-option.active i {
    transform: scale(1.1);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1.1); }
    50% { transform: scale(1.2); }
}

[data-theme="dark"] .icon-option {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.8), rgba(55, 65, 81, 0.6));
    border: 2px solid rgba(75, 85, 99, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .icon-option:hover {
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
}

/* Category Modal Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: flex-end;
    align-items: center;
}

.btn-cancel {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.8), rgba(75, 85, 99, 0.6));
    border: 2px solid rgba(107, 114, 128, 0.4);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-cancel:hover {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.9), rgba(75, 85, 99, 0.8));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    border: 2px solid var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

[data-theme="dark"] .btn-cancel {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.6), rgba(55, 65, 81, 0.4));
    border: 2px solid rgba(75, 85, 99, 0.6);
}

[data-theme="dark"] .form-actions {
    border-top-color: rgba(75, 85, 99, 0.3);
}

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

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.category-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .category-item {
    background: rgba(75, 85, 99, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.8);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-info i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    color: var(--primary-color);
}

.category-info span {
    font-weight: 500;
    color: var(--text-primary);
}

.category-item-actions {
    display: flex;
    gap: 0.5rem;
}

.category-action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.category-action-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.category-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Enhanced Mobile Category Styles */
@media (max-width: 768px) {
    .category-section {
        padding: 0.75rem 1rem;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
        backdrop-filter: blur(20px);
        border-radius: 0 0 20px 20px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
    
    [data-theme="dark"] .category-section {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    }
    
    .category-container {
        flex-direction: row;
        gap: 1rem;
        align-items: center;
        justify-content: space-between;
    }
    
    .category-tabs {
        flex: 1;
        display: flex;
        justify-content: flex-start;
        gap: 0.4rem;
        overflow-x: auto;
        padding: 0.25rem 0;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .category-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .category-tab {
        flex: 0 0 auto;
        min-width: 60px;
        justify-content: center;
        padding: 0.65rem 0.7rem;
        font-size: 0.8rem;
        border-radius: 16px;
        position: relative;
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(10px);
    }
    
    .category-tab.active {
        background: linear-gradient(135deg, var(--primary-color), rgba(102, 126, 234, 0.8));
        color: white;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
        transform: translateY(-2px);
    }
    
    .category-tab span {
        display: none;
    }
    
    .category-tab i {
        font-size: 1.1rem;
    }
    
    .category-tab.add-category {
        background: linear-gradient(135deg, #10b981, #059669);
        color: white;
        box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
        margin-left: 0.5rem;
        border: 2px solid rgba(255, 255, 255, 0.2);
    }
    
    .category-tab.add-category:hover {
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
    }
    
    .category-actions {
        flex: 0 0 auto;
        display: flex;
        justify-content: center;
        margin-left: 0.5rem;
    }
    
    .category-manage-btn {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        background: linear-gradient(135deg, rgba(107, 114, 128, 0.1), rgba(75, 85, 99, 0.05));
        backdrop-filter: blur(10px);
        border: 1px solid rgba(107, 114, 128, 0.2);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .category-manage-btn:hover {
        background: linear-gradient(135deg, rgba(107, 114, 128, 0.15), rgba(75, 85, 99, 0.1));
        transform: translateY(-2px) scale(1.05);
        box-shadow: 0 4px 15px rgba(107, 114, 128, 0.2);
    }
}

/* Mobile Category Modal Styles */
@media (max-width: 768px) {
    .icon-selector {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
        padding: 0.8rem;
    }
    
    .icon-option {
        padding: 0.8rem;
        font-size: 1.1rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-cancel,
    .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 0.9rem 1rem;
    }
}

@media (max-width: 480px) {
    .category-section {
        padding: 0.6rem 0.75rem;
        border-radius: 0 0 16px 16px;
    }
    
    .category-container {
        gap: 0.75rem;
    }
    
    .category-tabs {
        gap: 0.3rem;
        padding: 0.2rem 0;
        position: relative;
        padding-right: 20px;
    }
    
    /* Add smooth scroll indicator for category tabs */
    .category-tabs::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to left, rgba(255, 255, 255, 0.8), transparent);
        pointer-events: none;
        border-radius: 0 16px 16px 0;
    }
    
    [data-theme="dark"] .category-tabs::after {
        background: linear-gradient(to left, rgba(30, 41, 59, 0.8), transparent);
    }
    
    .category-tab {
        padding: 0.55rem 0.6rem;
        font-size: 0.75rem;
        min-width: 52px;
        border-radius: 14px;
    }
    
    .category-tab i {
        font-size: 1rem;
    }
    
    .category-tab.add-category {
        margin-left: 0.4rem;
        padding: 0.55rem 0.6rem;
        min-width: 52px;
    }
    
    .category-manage-btn {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }
    
    .category-manage-btn i {
        font-size: 0.9rem;
    }
    
    .icon-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.6rem;
    }
    
    .icon-option {
        padding: 0.7rem;
        font-size: 1rem;
    }
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    width: 100%;
    overflow-x: hidden;
}

/* Premium Navigation Tabs */
.view-nav {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8));
    backdrop-filter: blur(20px);
    padding: 0.6rem;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .view-nav {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.95), rgba(26, 32, 44, 0.8));
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.view-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #667eea);
    background-size: 300% 100%;
    animation: navShimmer 4s ease-in-out infinite;
    border-radius: 20px 20px 0 0;
}

@keyframes navShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.nav-btn {
    flex: 1;
    padding: 1.1rem 1.5rem;
    border: 2px solid transparent;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.3));
    backdrop-filter: blur(10px);
    color: var(--text-secondary);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .nav-btn {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.6), rgba(26, 32, 44, 0.3));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.6s ease;
}

.nav-btn:hover::before {
    left: 100%;
}

.nav-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(102, 126, 234, 0.05));
    color: var(--text-primary);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    color: white;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: transparent;
    transform: translateY(-1px);
    animation: activeGlow 3s ease-in-out infinite;
}

@keyframes activeGlow {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 12px 40px rgba(102, 126, 234, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

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

.nav-btn i {
    font-size: 1rem;
}

/* Custom Date Range Section */
.custom-range-section {
    background: var(--surface-color);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: slideDown 0.3s ease;
    position: relative;
    overflow: hidden;
}

.custom-range-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

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

.custom-range-container {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.range-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.range-input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.range-input-group label i {
    color: var(--primary-color);
    font-size: 1rem;
}

/* Extraordinary Date Picker Styling */
.range-input {
    padding: 0.9rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    background: linear-gradient(135deg, var(--background-color), var(--surface-color));
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 170px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.range-input:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.15);
}

.range-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), 0 6px 20px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

/* Custom calendar icon styling */
.range-input::-webkit-calendar-picker-indicator {
    background: var(--primary-gradient);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    filter: invert(1);
    transition: all 0.3s ease;
}

.range-input::-webkit-calendar-picker-indicator:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.range-separator {
    color: var(--primary-color);
    padding-bottom: 0.9rem;
    font-size: 1.2rem;
}

.apply-range-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    font-size: 0.95rem;
}

.apply-range-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.apply-range-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.quick-ranges {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
    border-top: 1px solid var(--border-color);
}

.quick-range-btn {
    background: linear-gradient(135deg, var(--background-color), var(--surface-color));
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.6rem 1.1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quick-range-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.quick-range-btn:hover::before {
    left: 100%;
}

.quick-range-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.quick-range-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
}


.quick-range-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.quick-range-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

/* Fluid Dynamic Summary Cards */
.summary-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
    padding: 1rem;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02), rgba(240, 147, 251, 0.02));
    overflow: hidden;
}

/* Summary Row for Main Cards */
.summary-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.summary-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(102, 126, 234, 0.03) 0%, 
        transparent 25%, 
        rgba(240, 147, 251, 0.03) 50%, 
        transparent 75%, 
        rgba(118, 75, 162, 0.03) 100%);
    animation: fluidWave 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes fluidWave {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    50% { transform: translateX(10%) rotate(2deg); }
}

.summary-section > * {
    position: relative;
    z-index: 1;
}

.summary-card {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95), 
        rgba(255, 255, 255, 0.8),
        rgba(248, 250, 252, 0.9));
    backdrop-filter: blur(25px);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 2rem;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
    border: 2px solid rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
    transform-origin: center center;
}

[data-theme="dark"] .summary-card {
    background: linear-gradient(135deg, 
        rgba(45, 55, 72, 0.95), 
        rgba(26, 32, 44, 0.8),
        rgba(30, 41, 59, 0.9));
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.summary-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, 
        rgba(102, 126, 234, 0.08) 0%, 
        rgba(240, 147, 251, 0.04) 30%, 
        transparent 70%);
    transform: scale(0);
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.320, 1);
    pointer-events: none;
    z-index: 0;
}

.summary-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent);
    transition: left 1s cubic-bezier(0.23, 1, 0.320, 1);
    pointer-events: none;
    z-index: 1;
}

.summary-card:hover {
    transform: translateY(-12px) scale(1.03) rotateY(2deg);
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.15),
        0 8px 32px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 0 0 1px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.4);
    backdrop-filter: blur(30px);
}

[data-theme="dark"] .summary-card:hover {
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.4),
        0 8px 32px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 1px rgba(102, 126, 234, 0.4);
}

.summary-card:hover::before {
    transform: scale(1.5);
}

.summary-card:hover::after {
    left: 100%;
}

.summary-card:active {
    transform: translateY(-8px) scale(1.01);
    transition: all 0.15s cubic-bezier(0.23, 1, 0.320, 1);
}

.summary-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
    z-index: 2;
    animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-2px) rotate(1deg); }
    75% { transform: translateY(2px) rotate(-1deg); }
}

.summary-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transform: scale(0) rotate(0deg);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
    z-index: -1;
}

.summary-card:hover .summary-icon {
    transform: scale(1.15) rotateY(15deg);
    animation: iconHover 0.6s cubic-bezier(0.23, 1, 0.320, 1) forwards;
}

.summary-card:hover .summary-icon::before {
    transform: scale(1) rotate(180deg);
}

@keyframes iconHover {
    0% { transform: scale(1.15) rotateY(15deg); }
    50% { transform: scale(1.2) rotateY(20deg) rotateX(10deg); }
    100% { transform: scale(1.15) rotateY(15deg); }
}

.summary-icon.income {
    background: linear-gradient(135deg, 
        #22c55e 0%, 
        #16a34a 50%, 
        #15803d 100%);
    box-shadow: 
        0 8px 32px rgba(34, 197, 94, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 1px rgba(34, 197, 94, 0.2);
}

.summary-icon.expense {
    background: linear-gradient(135deg, 
        #ef4444 0%, 
        #dc2626 50%, 
        #b91c1c 100%);
    box-shadow: 
        0 8px 32px rgba(239, 68, 68, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 1px rgba(239, 68, 68, 0.2);
}

.summary-icon.balance {
    background: linear-gradient(135deg, 
        #6366f1 0%, 
        #4f46e5 50%, 
        #4338ca 100%);
    box-shadow: 
        0 8px 32px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 1px rgba(99, 102, 241, 0.2);
}

.summary-card:hover .summary-icon.income {
    box-shadow: 
        0 12px 48px rgba(34, 197, 94, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 20px rgba(34, 197, 94, 0.4);
}

.summary-card:hover .summary-icon.expense {
    box-shadow: 
        0 12px 48px rgba(239, 68, 68, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 20px rgba(239, 68, 68, 0.4);
}

.summary-card:hover .summary-icon.balance {
    box-shadow: 
        0 12px 48px rgba(99, 102, 241, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 20px rgba(99, 102, 241, 0.4);
}

.summary-content {
    flex: 1;
    position: relative;
    z-index: 2;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
}

.summary-card:hover .summary-content {
    transform: translateX(8px);
}

.summary-content h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
    position: relative;
    overflow: hidden;
}

.summary-content h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.6s cubic-bezier(0.23, 1, 0.320, 1);
    border-radius: 1px;
}

.summary-card:hover .summary-content h3 {
    color: var(--text-primary);
    transform: translateY(-2px);
    font-weight: 700;
}

.summary-card:hover .summary-content h3::after {
    width: 100%;
}

.summary-content span {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    display: block;
    letter-spacing: -0.05em;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-subtitle {
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: var(--text-secondary) !important;
    margin-top: 0.5rem !important;
    opacity: 0.8;
    text-shadow: none !important;
}

.summary-card:hover .summary-content span {
    font-size: 2.1rem;
    transform: translateY(-3px);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.summary-content span::after {
    content: attr(data-value);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.23, 1, 0.320, 1);
    font-weight: 900;
}

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

/* Comprehensive Mobile & Responsive Optimizations */

/* Base App Container Adjustments */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Enhanced Header Responsive Design */
@media (max-width: 1024px) {
    .header {
        padding: 1rem 1.5rem;
    }
    
    .logo-text h1 {
        font-size: 1.4rem;
    }
    
    .logo-text small {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
        position: sticky;
        top: 0;
        z-index: 1000;
        backdrop-filter: blur(20px);
        background: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    }
    
    [data-theme="dark"] .header {
        background: rgba(26, 32, 44, 0.98);
        border-bottom-color: rgba(255, 255, 255, 0.08);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    }
    
    .header-content {
        gap: 1rem;
        align-items: center;
        justify-content: space-between;
    }
    
    .logo {
        gap: 0.75rem;
        align-items: center;
    }
    
    .logo-icon {
        width: 44px;
        height: 44px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
    
    .logo-text h1 {
        font-size: 1.3rem;
        font-weight: 700;
        background: linear-gradient(135deg, #667eea, #764ba2);
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        margin: 0;
    }
    
    .logo-text small {
        font-size: 0.75rem;
        color: var(--text-secondary);
        font-weight: 500;
        margin: 0;
    }
    
    .header-controls {
        gap: 0.75rem;
        align-items: center;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: rgba(102, 126, 234, 0.1);
        border: 1px solid rgba(102, 126, 234, 0.2);
        color: var(--primary-color);
        font-size: 1rem;
        transition: all 0.3s ease;
    }
    
    .theme-toggle:hover {
        background: var(--primary-color);
        color: white;
        transform: scale(1.05);
    }
    
    .user-section {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
    }
    
    .sign-in-btn {
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: white;
        border: none;
        padding: 0.6rem 1rem;
        border-radius: 10px;
        font-size: 0.85rem;
        font-weight: 600;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        transition: all 0.3s ease;
    }
    
    .sign-in-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }
    
    .sign-out-btn {
        background: rgba(239, 68, 68, 0.1);
        color: #ef4444;
        border: 1px solid rgba(239, 68, 68, 0.3);
        padding: 0.5rem 0.8rem;
        border-radius: 8px;
        font-size: 0.8rem;
        font-weight: 500;
    }
    
    .connection-status {
        background: rgba(16, 185, 129, 0.1);
        color: #10b981;
        padding: 0.25rem 0.6rem;
        border-radius: 6px;
        font-size: 0.7rem;
        font-weight: 600;
        border: 1px solid rgba(16, 185, 129, 0.3);
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.75rem 1rem;
    }
    
    .header-content {
        flex-wrap: nowrap;
    }
    
    .logo-text small {
        display: none;
    }
    
    .logo-text h1 {
        font-size: 1.1rem;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
    }
    
    .sign-in-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .sign-in-btn span {
        display: none;
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

/* Enhanced Period Header Responsiveness */
@media (max-width: 768px) {
    .current-period-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .period-nav-container {
        gap: 1rem;
    }
    
    .period-center h3 {
        font-size: 1.1rem;
    }
    
    .period-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .period-footer-left {
        justify-content: center;
        gap: 0.75rem;
    }
    
    .quick-period-buttons {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .quick-period-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .current-period-header {
        padding: 0.75rem;
    }
    
    .period-nav-container {
        gap: 0.5rem;
    }
    
    .period-nav-btn {
        width: 32px;
        height: 32px;
    }
    
    .quick-period-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
    
    .quick-period-btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Enhanced Navigation Tabs Responsiveness */
@media (max-width: 768px) {
    .view-nav {
        padding: 0 1rem;
        gap: 0.25rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .view-nav::-webkit-scrollbar {
        display: none;
    }
    
    .nav-btn {
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .nav-btn i {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .nav-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.8rem;
    }
    
    .nav-btn span {
        display: none;
    }
}

/* Enhanced Summary Cards Responsiveness */
@media (max-width: 768px) {
    .summary-section {
        padding: 0 1rem;
    }
    
    .summary-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .summary-card {
        padding: 1rem;
    }
    
    .summary-content h3 {
        font-size: 0.85rem;
    }
    
    .summary-content span {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .summary-section {
        padding: 0 0.5rem;
    }
    
    .summary-card {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .summary-icon {
        width: 40px;
        height: 40px;
    }
    
    .summary-content span {
        font-size: 1.2rem;
    }
}

/* Enhanced Transaction Form Responsiveness */
@media (max-width: 768px) {
    .add-transaction-section {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .submit-btn {
        width: 100%;
        padding: 0.9rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .add-transaction-section {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .transaction-form h2 {
        font-size: 1.3rem;
        text-align: center;
    }
    
    .form-group label {
        font-size: 0.85rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

/* Enhanced Transactions List Responsiveness */
@media (max-width: 768px) {
    .transactions-section {
        margin: 1rem 0.75rem;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-radius: 16px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.3);
        overflow: hidden;
    }
    
    [data-theme="dark"] .transactions-section {
        background: rgba(45, 55, 72, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
    
    .transactions-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 1.25rem;
        margin: 0;
        border-radius: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .transactions-header h2 {
        font-size: 1.1rem;
        font-weight: 700;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .transactions-header h2:before {
        content: "💳";
        font-size: 1.2rem;
    }
    
    .sync-status {
        background: rgba(255, 255, 255, 0.15);
        padding: 0.4rem 0.8rem;
        border-radius: 20px;
        font-size: 0.75rem;
        font-weight: 600;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .sync-text {
        margin-left: 0.3rem;
    }
    
    .transactions-scroll-container {
        max-height: 500px;
        overflow-y: auto;
        padding: 0;
    }
    
    .transactions-list {
        padding: 0;
    }
    
    .transaction-card {
        background: rgba(255, 255, 255, 0.8);
        margin: 0;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        padding: 1.25rem;
        transition: all 0.3s ease;
        position: relative;
    }
    
    .transaction-card:hover {
        background: rgba(102, 126, 234, 0.05);
        transform: none;
    }
    
    .transaction-card:last-child {
        border-bottom: none;
    }
    
    [data-theme="dark"] .transaction-card {
        background: rgba(26, 32, 44, 0.8);
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }
    
    [data-theme="dark"] .transaction-card:hover {
        background: rgba(102, 126, 234, 0.1);
    }
    
    .transaction-type-indicator {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: var(--success-color);
        border-radius: 0 4px 4px 0;
    }
    
    .transaction-card.expense .transaction-type-indicator {
        background: var(--error-color);
    }
    
    .transaction-main {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 0.75rem;
    }
    
    .transaction-info {
        flex: 1;
        padding-left: 1rem;
    }
    
    .transaction-info h4 {
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-primary);
        margin: 0 0 0.25rem 0;
        line-height: 1.3;
    }
    
    .transaction-info small {
        font-size: 0.8rem;
        color: var(--text-secondary);
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }
    
    .transaction-info small:before {
        content: "📅";
        font-size: 0.75rem;
    }
    
    .transaction-amount {
        font-size: 1.1rem;
        font-weight: 700;
        text-align: right;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.25rem;
    }
    
    .transaction-actions {
        display: flex;
        gap: 0.5rem;
        justify-content: flex-end;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    [data-theme="dark"] .transaction-actions {
        border-top-color: rgba(255, 255, 255, 0.05);
    }
    
    .action-btn {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        font-size: 0.85rem;
        font-weight: 600;
        border: 1.5px solid;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .edit-btn {
        background: rgba(59, 130, 246, 0.1);
        color: #3b82f6;
        border-color: rgba(59, 130, 246, 0.3);
    }
    
    .edit-btn:hover {
        background: #3b82f6;
        color: white;
        transform: scale(1.05);
    }
    
    .delete-btn {
        background: rgba(239, 68, 68, 0.1);
        color: #ef4444;
        border-color: rgba(239, 68, 68, 0.3);
    }
    
    .delete-btn:hover {
        background: #ef4444;
        color: white;
        transform: scale(1.05);
    }
    
    .empty-state {
        text-align: center;
        padding: 3rem 1.5rem;
        color: var(--text-secondary);
    }
    
    .empty-state i {
        font-size: 3rem;
        margin-bottom: 1rem;
        opacity: 0.5;
    }
    
    .empty-state h3 {
        font-size: 1.2rem;
        font-weight: 600;
        margin: 0 0 0.5rem 0;
        color: var(--text-primary);
    }
    
    .empty-state p {
        font-size: 0.9rem;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .transactions-section {
        margin: 0.75rem 0.5rem;
        border-radius: 12px;
    }
    
    .transactions-header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .transactions-header h2 {
        font-size: 1rem;
    }
    
    .transaction-card {
        padding: 1rem;
    }
    
    .transaction-main {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .transaction-amount {
        align-items: flex-start;
        text-align: left;
    }
    
    .transaction-actions {
        justify-content: center;
        gap: 1rem;
        padding-top: 0.75rem;
    }
    
    .action-btn {
        width: 44px;
        height: 44px;
        font-size: 0.9rem;
    }
    
    .sync-status {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-state i {
        font-size: 2.5rem;
    }
}

/* Enhanced Chart Section Responsiveness */
@media (max-width: 768px) {
    .chart-section {
        margin: 1rem;
        padding: 1rem;
    }
    
    .chart-header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .chart-legend {
        justify-content: center;
        gap: 1rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .chart-section {
        margin: 0.5rem;
        padding: 0.75rem;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .legend-item {
        font-size: 0.8rem;
    }
}

/* Touch-Friendly Improvements */
@media (max-width: 768px) {
    button, .btn, .nav-btn, .category-tab {
        min-height: 44px;
        min-width: 44px;
    }
    
    input, select, textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .action-btn {
        min-height: 40px;
        min-width: 40px;
    }
}

/* Scrollbar Styling for Better UX */
.transactions-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.transactions-scroll-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.transactions-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.transactions-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Safe Area Adjustments for Mobile Devices */
@supports (padding: max(0px)) {
    .app-container {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    
    .header {
        padding-top: max(0.75rem, env(safe-area-inset-top));
    }
}

/* Professional Mobile Enhancements */
@media (max-width: 768px) {
    /* Touch feedback enhancements */
    .transaction-card {
        touch-action: manipulation;
        user-select: none;
    }
    
    .transaction-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .action-btn:active {
        transform: scale(0.92);
    }
    
    /* Professional loading states */
    .transactions-list.loading {
        opacity: 0.6;
        pointer-events: none;
    }
    
    .transactions-list.loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 24px;
        height: 24px;
        margin: -12px 0 0 -12px;
        border: 2px solid #f3f3f3;
        border-top: 2px solid var(--primary-color);
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }
    
    /* Enhanced focus states for accessibility */
    .action-btn:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    }
    
    /* Professional scroll indicators */
    .transactions-scroll-container {
        position: relative;
    }
    
    .transactions-scroll-container::before {
        content: '';
        position: sticky;
        top: 0;
        display: block;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(0,0,0,0.1), transparent);
        z-index: 1;
    }
    
    .transactions-scroll-container::after {
        content: '';
        position: sticky;
        bottom: 0;
        display: block;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(0,0,0,0.1), transparent);
        z-index: 1;
    }
    
    /* Professional transaction type styling */
    .transaction-type {
        font-size: 0.65rem;
        font-weight: 700;
        letter-spacing: 0.5px;
        opacity: 0.7;
        padding: 0.15rem 0.4rem;
        border-radius: 4px;
        background: rgba(0, 0, 0, 0.05);
        margin-top: 0.25rem;
    }
    
    .income .transaction-type {
        background: rgba(16, 185, 129, 0.1);
        color: #10b981;
    }
    
    .expense .transaction-type {
        background: rgba(239, 68, 68, 0.1);
        color: #ef4444;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Professional header animations */
@media (max-width: 768px) {
    .header {
        animation: slideInDown 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .logo-icon {
        animation: pulse 2s infinite;
    }
    
    .sign-in-btn {
        position: relative;
        overflow: hidden;
    }
    
    .sign-in-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        transition: left 0.5s;
    }
    
    .sign-in-btn:hover::before {
        left: 100%;
    }
}

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

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

/* Improved Focus States for Accessibility */
@media (max-width: 768px) {
    button:focus,
    input:focus,
    select:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Premium Transaction Form */
.add-transaction-section {
    background: linear-gradient(135deg, var(--surface-color), var(--background-color));
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.add-transaction-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #667eea);
    background-size: 300% 100%;
    animation: shimmer 3s ease-in-out infinite;
    border-radius: 24px 24px 0 0;
}

.add-transaction-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(240, 147, 251, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 40% 80%, rgba(118, 75, 162, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.add-transaction-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Chart Section - Enhanced 3D Bar Chart */
.chart-section {
    background: var(--surface-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    height: 580px;
}

.chart-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 20px 20px 0 0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.chart-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 1px;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.chart-title i {
    color: var(--primary-color);
    font-size: 1.1rem;
    padding: 0.4rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.chart-title:hover i {
    transform: scale(1.1);
    background: rgba(99, 102, 241, 0.15);
}

.chart-legend {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95), 
        rgba(255, 255, 255, 0.85),
        rgba(248, 250, 252, 0.9));
    backdrop-filter: blur(25px);
    border-radius: 20px;
    border: 2px solid rgba(102, 126, 234, 0.15);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(102, 126, 234, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
}

[data-theme="dark"] .chart-legend {
    background: linear-gradient(135deg, 
        rgba(45, 55, 72, 0.95), 
        rgba(26, 32, 44, 0.85),
        rgba(30, 41, 59, 0.9));
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(102, 126, 234, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
}

.chart-legend::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        #22c55e 0%, 
        #16a34a 25%, 
        #ef4444 50%, 
        #dc2626 75%, 
        #6366f1 100%);
    background-size: 300% 100%;
    animation: premiumShimmer 4s ease-in-out infinite;
    border-radius: 20px 20px 0 0;
    opacity: 0.8;
}

@keyframes premiumShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.chart-legend::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, 
        rgba(102, 126, 234, 0.1) 0%, 
        transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
    border-radius: 50%;
}

.chart-legend:hover::after {
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%) scale(1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
    cursor: pointer;
    padding: 0.5rem 0.9rem;
    border-radius: 12px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.3), 
        rgba(255, 255, 255, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    user-select: none;
    backdrop-filter: blur(8px);
    text-transform: capitalize;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    z-index: 1;
    min-width: auto;
}

[data-theme="dark"] .legend-item {
    background: linear-gradient(135deg, 
        rgba(45, 55, 72, 0.3), 
        rgba(26, 32, 44, 0.1));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.legend-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.15), 
        transparent);
    transition: left 0.8s cubic-bezier(0.23, 1, 0.320, 1);
    pointer-events: none;
    z-index: -1;
}

.legend-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 0.2) 0%, 
        transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.legend-item:hover::before {
    left: 100%;
}

.legend-item:hover::after {
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%) scale(1);
}

.legend-item:hover {
    color: var(--text-primary);
    transform: translateY(-1px) scale(1.02);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.6), 
        rgba(255, 255, 255, 0.4));
    border-color: rgba(102, 126, 234, 0.2);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(102, 126, 234, 0.1);
    backdrop-filter: blur(12px);
    font-weight: 700;
}

[data-theme="dark"] .legend-item:hover {
    background: linear-gradient(135deg, 
        rgba(45, 55, 72, 0.6), 
        rgba(26, 32, 44, 0.4));
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(102, 126, 234, 0.15);
}

.legend-item.active {
    color: white;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.9), 
        rgba(99, 102, 241, 0.85));
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 
        0 4px 16px rgba(102, 126, 234, 0.25),
        0 2px 8px rgba(102, 126, 234, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}


.legend-item.inactive {
    opacity: 0.4;
    filter: grayscale(0.8) blur(0.5px);
    transform: scale(0.92);
    background: linear-gradient(135deg, 
        rgba(107, 114, 128, 0.3), 
        rgba(107, 114, 128, 0.2));
    border-color: rgba(107, 114, 128, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.legend-item.inactive:hover {
    opacity: 0.7;
    filter: grayscale(0.4) blur(0px);
    transform: scale(1) translateY(-1px);
    background: linear-gradient(135deg, 
        rgba(107, 114, 128, 0.5), 
        rgba(107, 114, 128, 0.3));
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.legend-dot {
    width: 20px;
    height: 20px;
    border-radius: 8px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.320, 1);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.legend-dot::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 0.5) 0%, 
        rgba(255, 255, 255, 0.2) 30%, 
        transparent 70%);
    transform: scale(0) rotate(0deg);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
    z-index: 1;
}

.legend-dot::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: 6px;
    background: inherit;
    opacity: 0.8;
    transition: all 0.3s ease;
    z-index: 0;
}

.legend-item:hover .legend-dot::before,
.legend-item.active .legend-dot::before {
    transform: scale(1) rotate(180deg);
}

.legend-item.income .legend-dot {
    background: linear-gradient(135deg, 
        #22c55e 0%, 
        #16a34a 50%, 
        #15803d 100%);
    border-color: rgba(34, 197, 94, 0.4);
    box-shadow: 
        0 4px 12px rgba(34, 197, 94, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.legend-item.expense .legend-dot {
    background: linear-gradient(135deg, 
        #ef4444 0%, 
        #dc2626 50%, 
        #b91c1c 100%);
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 
        0 4px 12px rgba(239, 68, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.legend-item.active.income {
    background: linear-gradient(135deg, 
        rgba(34, 197, 94, 0.9), 
        rgba(22, 163, 74, 0.85));
    border-color: rgba(34, 197, 94, 0.4);
    box-shadow: 
        0 4px 16px rgba(34, 197, 94, 0.25),
        0 2px 8px rgba(34, 197, 94, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.legend-item.active.expense {
    background: linear-gradient(135deg, 
        rgba(239, 68, 68, 0.9), 
        rgba(220, 38, 38, 0.85));
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 
        0 4px 16px rgba(239, 68, 68, 0.25),
        0 2px 8px rgba(239, 68, 68, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.legend-item:hover .legend-dot {
    transform: scale(1.2) rotateZ(15deg);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

.legend-item.active .legend-dot {
    transform: scale(1.1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}



.legend-item.income:hover .legend-dot {
    box-shadow: 
        0 6px 20px rgba(34, 197, 94, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.legend-item.expense:hover .legend-dot {
    box-shadow: 
        0 6px 20px rgba(239, 68, 68, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.legend-item:active {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.15s cubic-bezier(0.23, 1, 0.320, 1);
}

.legend-item .legend-text {
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.chart-comparison-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--background-color), var(--surface-color));
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    max-height: 200px;
    overflow-y: auto;
    /* Hide scrollbar for premium look */
    -webkit-scrollbar-width: none;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.chart-comparison-summary::-webkit-scrollbar {
    display: none; /* Hide scrollbar for webkit browsers */
}

.chart-comparison-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0.875rem;
    right: 0.875rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.3;
}

.comparison-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.45rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.comparison-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.comparison-badge:hover::before {
    left: 100%;
}

.comparison-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.comparison-badge.up {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.comparison-badge.down {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.comparison-badge.neutral {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.comparison-badge.highlight {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.comparison-badge i {
    font-size: 0.75rem;
    padding: 0.15rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.comparison-badge:hover i {
    transform: rotate(360deg);
    background: rgba(255, 255, 255, 0.3);
}

/* Chart content layout - Vertical stack for better mobile visibility */
.chart-content-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
    margin-top: 0.5rem;
}

.chart-area {
    min-height: 400px;
    position: relative;
    width: 100%;
}

.chart-container-3d {
    position: relative;
    height: 400px;
    width: 100%;
    perspective: 1000px;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--background-color), var(--surface-color));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.chart-container-3d:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.chart-container-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(99, 102, 241, 0.02) 50%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.chart-container-3d canvas {
    width: 100% !important;
    height: 100% !important;
    border-radius: 12px;
}

.chart-insights-area {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--surface-color), var(--background-color));
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chart-insights-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #ef4444, #22c55e, #6366f1);
    border-radius: 16px 16px 0 0;
}

.chart-insights-area:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
}

.chart-insights-area .insights-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.chart-insights-area .insights-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    border-radius: 1px;
}

.chart-insights-area .insights-header h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    letter-spacing: -0.025em;
}

.chart-insights-area .insights-header i {
    color: #f59e0b;
    font-size: 0.8rem;
    padding: 0.3rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.chart-insights-area .insights-header:hover i {
    transform: rotate(15deg) scale(1.1);
    background: rgba(245, 158, 11, 0.15);
}

.chart-insights-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-start;
    overflow: visible;
    min-height: auto;
}

.chart-insights-container::-webkit-scrollbar {
    display: none; /* WebKit */
}

.chart-insights-container .insight-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    cursor: default;
    flex: 1;
    min-width: 280px;
    max-width: calc(50% - 0.5rem);
}

.chart-insights-container .insight-card:hover {
    transform: translateX(2px);
    box-shadow: var(--shadow);
}

.chart-insights-container .insight-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.chart-insights-container .insight-card.positive {
    border-left: 3px solid #22c55e;
}

.chart-insights-container .insight-card.negative {
    border-left: 3px solid #ef4444;
}

.chart-insights-container .insight-card.neutral {
    border-left: 3px solid #6366f1;
}

.chart-insights-container .insight-card.warning {
    border-left: 3px solid #f59e0b;
}

.chart-insights-container .insight-card.positive .insight-icon {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.chart-insights-container .insight-card.negative .insight-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.chart-insights-container .insight-card.neutral .insight-icon {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
}

.chart-insights-container .insight-card.warning .insight-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.chart-insights-container .insight-content {
    flex: 1;
    min-width: 0;
}

.chart-insights-container .insight-text {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    font-size: 0.8rem;
}

.chart-insights-container .insight-detail {
    margin: 0.2rem 0 0 0;
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.chart-insights-container .insight-value {
    display: block;
    font-weight: 700;
    margin-top: 0.3rem;
    font-size: 0.85rem;
}

.chart-insights-container .insight-card.positive .insight-value {
    color: #22c55e;
}

.chart-insights-container .insight-card.negative .insight-value {
    color: #ef4444;
}

.chart-insights-container .insight-card.neutral .insight-value {
    color: #6366f1;
}

.chart-insights-container .insight-card.warning .insight-value {
    color: #f59e0b;
}

@media (max-width: 1024px) {
    .chart-content-layout {
        gap: 1.2rem;
    }
    
    .chart-section {
        padding: 1.75rem;
    }
    
    .chart-area {
        min-height: 350px;
    }
    
    .chart-container-3d {
        height: 350px;
    }
    
    .chart-insights-area {
        padding: 1rem;
    }
    
    .chart-insights-container .insight-card {
        min-width: 240px;
        max-width: calc(50% - 0.5rem);
    }
}

@media (max-width: 768px) {
    .chart-content-layout {
        gap: 1rem;
    }
    
    .chart-area {
        min-height: 280px;
    }
    
    .chart-container-3d {
        height: 280px;
    }
    
    .chart-insights-area {
        padding: 1rem;
    }
    
    .chart-insights-container {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .chart-insights-container .insight-card {
        min-width: auto;
        max-width: none;
        width: 100%;
    }

    .chart-section {
        padding: 1.5rem;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .chart-legend {
        order: 2;
        align-self: stretch;
        justify-content: center;
    }

    .chart-comparison-summary {
        flex-direction: column;
        gap: 0.75rem;
        max-height: 150px;
        overflow-y: auto;
        /* Hide scrollbar for mobile premium look */
        -webkit-scrollbar-width: none;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* Internet Explorer 10+ */
    }
    
    .chart-comparison-summary::-webkit-scrollbar {
        display: none; /* Hide scrollbar for mobile webkit browsers */
    }
    
    .comparison-badge {
        justify-content: center;
        flex: 1;
    }
}

.chart-container-3d {
    position: relative;
    height: 300px;
    width: 100%;
    perspective: 1000px;
}

.chart-container-3d canvas {
    width: 100% !important;
    height: 100% !important;
    border-radius: 12px;
}

.transaction-form-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.transaction-form-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 1px;
    animation: expand 2s ease-in-out infinite alternate;
}

@keyframes expand {
    0% { width: 60px; }
    100% { width: 100px; }
}

.transaction-form h2 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.transaction-form h2 i {
    color: var(--primary-color);
    font-size: 1.3rem;
    padding: 0.6rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(102, 126, 234, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    animation: pulse 2s ease-in-out infinite;
}

.transaction-form h2:hover i {
    transform: rotate(15deg) scale(1.1);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(102, 126, 234, 0.1));
    border-color: rgba(102, 126, 234, 0.4);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.3); }
    50% { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
}

.transaction-form-subtitle {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.8;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 1;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
}

.form-group:hover {
    transform: translateY(-2px);
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.form-group label::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--primary-gradient);
    border-radius: 2px;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.form-group:hover label::before {
    opacity: 1;
    transform: scaleY(1.2);
}

.form-group:focus-within label {
    color: var(--primary-color);
    transform: translateY(-1px);
}

.form-group:focus-within label::before {
    opacity: 1;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    transform: scaleY(1.3);
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
}

.form-group input,
.form-group select {
    padding: 1.2rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
    backdrop-filter: blur(20px);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.9), rgba(26, 32, 44, 0.6));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.form-group input::before,
.form-group select::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
    z-index: 0;
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8));
}

[data-theme="dark"] .form-group input:hover,
[data-theme="dark"] .form-group select:hover {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.95), rgba(26, 32, 44, 0.8));
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.form-group input:hover::before,
.form-group select:hover::before {
    left: 100%;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2), 
                0 12px 40px rgba(102, 126, 234, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.5),
                0 0 20px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.9));
    transform: translateY(-3px) scale(1.01);
    animation: focusGlow 0.6s ease-out;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus {
    background: linear-gradient(135deg, rgba(45, 55, 72, 1), rgba(26, 32, 44, 0.9));
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3), 
                0 12px 40px rgba(102, 126, 234, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2),
                0 0 20px rgba(102, 126, 234, 0.4);
}

@keyframes focusGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4), 
                    0 4px 12px rgba(102, 126, 234, 0.1),
                    inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.1), 
                    0 16px 50px rgba(102, 126, 234, 0.25),
                    inset 0 1px 0 rgba(255, 255, 255, 0.6),
                    0 0 30px rgba(102, 126, 234, 0.4);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2), 
                    0 12px 40px rgba(102, 126, 234, 0.2),
                    inset 0 1px 0 rgba(255, 255, 255, 0.5),
                    0 0 20px rgba(102, 126, 234, 0.3);
    }
}

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

/* Extraordinary Date Input Styling */
.form-group input[type="date"] {
    cursor: pointer;
    position: relative;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    background: var(--primary-gradient);
    border-radius: 6px;
    padding: 5px;
    cursor: pointer;
    filter: invert(1);
    transition: all 0.3s ease;
    opacity: 1;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Premium Type Select Styling */
#type {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9));
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    backdrop-filter: blur(20px);
    box-shadow: 
        0 8px 32px rgba(102, 126, 234, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(99, 102, 241, 0.05));
    background-repeat: no-repeat;
    background-position: 0 0;
    background-size: 100% 100%;
    min-height: 3.5rem;
}

[data-theme="dark"] #type {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.95), rgba(26, 32, 44, 0.9));
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background-image: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(99, 102, 241, 0.08));
}

#type:hover {
    border-color: rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
    box-shadow: 
        0 12px 40px rgba(102, 126, 234, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 20px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
    background-image: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(99, 102, 241, 0.08));
}


[data-theme="dark"] #type:hover {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.98), rgba(26, 32, 44, 0.95));
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 
        0 12px 40px rgba(102, 126, 234, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 20px rgba(102, 126, 234, 0.2);
}

#type:focus {
    outline: none;
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(248, 250, 252, 0.98));
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.2),
        0 16px 50px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 0 25px rgba(102, 126, 234, 0.3);
    transform: translateY(-3px) scale(1.01);
    background-image: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(99, 102, 241, 0.1));
}


[data-theme="dark"] #type:focus {
    background: linear-gradient(135deg, rgba(45, 55, 72, 1), rgba(26, 32, 44, 0.98));
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.3),
        0 16px 50px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 25px rgba(102, 126, 234, 0.4);
}

/* Premium option styling */
#type option {
    background: var(--background-color);
    color: var(--text-primary);
    padding: 1rem;
    font-weight: 500;
    border: none;
}

#type option:hover {
    background: rgba(102, 126, 234, 0.1);
}

#type option:checked {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(99, 102, 241, 0.1));
    color: var(--primary-color);
    font-weight: 600;
}

/* Transaction Category Select Styling */
#txnCategory,
#editTxnCategory {
    position: relative;
    border-radius: 16px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    width: 100%;
}

/* Expense Theme */
#txnCategory.cat-expense-theme,
#editTxnCategory.cat-expense-theme {
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.08);
}

#txnCategory.cat-expense-theme:hover,
#editTxnCategory.cat-expense-theme:hover {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.12);
    transform: translateY(-1px);
}

#txnCategory.cat-expense-theme:focus,
#editTxnCategory.cat-expense-theme:focus {
    outline: none;
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

[data-theme="dark"] #txnCategory.cat-expense-theme,
[data-theme="dark"] #editTxnCategory.cat-expense-theme {
    background: var(--input-bg);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

/* Income Theme */
#txnCategory.cat-income-theme,
#editTxnCategory.cat-income-theme {
    border-color: rgba(34, 197, 94, 0.35);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.08);
}

#txnCategory.cat-income-theme:hover,
#editTxnCategory.cat-income-theme:hover {
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 6px 24px rgba(34, 197, 94, 0.12);
    transform: translateY(-1px);
}

#txnCategory.cat-income-theme:focus,
#editTxnCategory.cat-income-theme:focus {
    outline: none;
    border-color: rgba(34, 197, 94, 0.6);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

[data-theme="dark"] #txnCategory.cat-income-theme,
[data-theme="dark"] #editTxnCategory.cat-income-theme {
    background: var(--input-bg);
    border-color: rgba(34, 197, 94, 0.4);
    color: #86efac;
}

/* Option styling - matches theme */
#txnCategory option,
#editTxnCategory option {
    background: var(--background-color);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
}

#txnCategory option:checked,
#editTxnCategory option:checked {
    font-weight: 700;
}

#txnCategory option:hover,
#editTxnCategory option:hover {
    background: var(--hover-bg);
}

/* Transaction Category Emoji Icon */
.txn-cat-emoji {
    font-size: 1.3rem;
    line-height: 1;
}

/* ========== Category Breakdown Section ========== */
.category-breakdown-section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

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

.category-breakdown-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.category-breakdown-title i {
    color: var(--primary-color);
    font-size: 1.15rem;
}

.breakdown-toggle-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--background-color);
    padding: 0.3rem;
    border-radius: 14px;
    border: 1px solid var(--border-color);
}

.breakdown-tab {
    padding: 0.55rem 1.25rem;
    border: none;
    border-radius: 11px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 700;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.breakdown-tab:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.breakdown-tab.active[data-breakdown="expense"] {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.breakdown-tab.active[data-breakdown="income"] {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

.category-breakdown-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Empty state */
.breakdown-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-secondary);
}

.breakdown-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.breakdown-empty p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

/* Breakdown items */
.breakdown-item {
    background: var(--background-color);
    border-radius: 16px;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--border-color);
    transition: all 0.25s ease;
}

.breakdown-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.breakdown-item.bd-expense {
    border-left: 4px solid var(--bar-color, #ef4444);
}

.breakdown-item.bd-income {
    border-left: 4px solid var(--bar-color, #22c55e);
}

.breakdown-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.breakdown-cat-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}

.breakdown-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hover-bg);
    border-radius: 10px;
}

.breakdown-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breakdown-count {
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: var(--hover-bg);
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
}

.breakdown-amount {
    font-weight: 800;
    font-size: 1.1rem;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.breakdown-item.bd-expense .breakdown-amount {
    color: var(--error-color);
}

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

.breakdown-bar-track {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.breakdown-bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 6px;
}

.breakdown-pct {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.breakdown-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

.breakdown-preview {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    font-style: italic;
}

/* Total row */
.breakdown-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
    border-radius: 14px;
    background: var(--hover-bg);
    border: 2px dashed var(--border-color);
}

.breakdown-total-label {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown-total-amount {
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--text-primary);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .category-breakdown-section {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .category-breakdown-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .breakdown-toggle-tabs {
        width: 100%;
    }

    .breakdown-tab {
        flex: 1;
        justify-content: center;
        padding: 0.55rem 0.75rem;
        font-size: 0.85rem;
    }

    .breakdown-item {
        padding: 0.9rem 1rem;
    }

    .breakdown-icon {
        font-size: 1.3rem;
        width: 34px;
        height: 34px;
    }

    .breakdown-name {
        font-size: 0.92rem;
        max-width: 110px;
    }

    .breakdown-amount {
        font-size: 1rem;
    }

    .breakdown-total-amount {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .category-breakdown-section {
        padding: 1rem;
    }

    .breakdown-cat-info {
        gap: 0.4rem;
    }

    .breakdown-icon {
        font-size: 1.15rem;
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .breakdown-name {
        font-size: 0.85rem;
        max-width: 85px;
    }

    .breakdown-count {
        font-size: 0.68rem;
        padding: 0.15rem 0.4rem;
    }

    .breakdown-amount {
        font-size: 0.92rem;
    }

    .breakdown-preview {
        font-size: 0.7rem;
    }
}

/* Transaction Category Label in List */
.txn-category-label {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.txn-category-label.cat-label-expense {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(249, 115, 22, 0.06));
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.txn-category-label.cat-label-income {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.06));
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

[data-theme="dark"] .txn-category-label.cat-label-expense {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(249, 115, 22, 0.1));
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

[data-theme="dark"] .txn-category-label.cat-label-income {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(16, 185, 129, 0.1));
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 58px; /* Match input field height */
    align-self: end;
    margin-top: 2rem; /* Align with label spacing */
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    min-width: 200px;
    animation: buttonBreath 3s ease-in-out infinite;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.submit-btn:hover::before {
    left: 100%;
}

@keyframes buttonBreath {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4), 
                    inset 0 1px 0 rgba(255, 255, 255, 0.2);
        background-position: 0% 50%;
    }
    50% {
        box-shadow: 0 12px 40px rgba(102, 126, 234, 0.6), 
                    inset 0 1px 0 rgba(255, 255, 255, 0.3),
                    0 0 20px rgba(240, 147, 251, 0.4);
        background-position: 100% 50%;
    }
}

.submit-btn:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.5), 
                0 0 30px rgba(240, 147, 251, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background-size: 250% 250%;
    animation: buttonHover 0.6s ease-out forwards;
}

.submit-btn:active {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6), 
                inset 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: buttonPress 0.15s ease-out;
}

@keyframes buttonHover {
    0% {
        background-position: 0% 50%;
        filter: brightness(1);
    }
    100% {
        background-position: 100% 50%;
        filter: brightness(1.1) saturate(1.2);
    }
}

@keyframes buttonPress {
    0% { transform: translateY(-4px) scale(1.03); }
    50% { transform: translateY(-1px) scale(0.99); }
    100% { transform: translateY(-2px) scale(1.01); }
}

.submit-btn i {
    font-size: 1rem;
    transition: all 0.3s ease;
}

.submit-btn:hover i {
    transform: rotate(15deg) scale(1.1);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.submit-btn:active i {
    transform: rotate(5deg) scale(0.95);
}

/* Premium Current Period Header */
.current-period-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    color: white;
    padding: 2.5rem 2rem;
    margin: 2rem auto 1.5rem auto;
    max-width: 1200px;
    width: calc(100% - 2rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: periodHeaderGlow 6s ease-in-out infinite;
}

@keyframes periodHeaderGlow {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 25px 80px rgba(102, 126, 234, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

.current-period-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(240, 147, 251, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.current-period-header > * {
    position: relative;
    z-index: 1;
}

/* Light mode specific styling */
[data-theme="light"] .current-period-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.25);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

[data-theme="light"] .current-period-header .period-stats span {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Light mode navigation and buttons */
[data-theme="light"] .nav-btn {
    background: white;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .nav-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25);
    border-color: transparent;
}

[data-theme="light"] .nav-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Light mode summary cards */
[data-theme="light"] .summary-card {
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.08);
}

[data-theme="light"] .summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Light mode forms */
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select {
    background: white;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Light mode transaction items */
[data-theme="light"] .transaction-item {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .transaction-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.current-period-header .period-info {
    text-align: left;
}

.current-period-header .period-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.current-period-header .period-info .date-details {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Clean Period Navigator Design */
.period-nav-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
}

.period-center {
    text-align: center;
    min-width: 250px;
    cursor: pointer;
}

.period-center h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.period-center .date-details {
    margin: 0.3rem 0 0 0;
    font-size: 0.95rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.transaction-count-badge {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #1e293b;
    padding: 0.4rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 800;
    border: 2px solid #e2e8f0;
    letter-spacing: 0.4px;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 
                0 2px 4px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-left: 0.75rem;
    display: inline-flex;
    align-items: center;
    animation: subtle-pulse 3s ease-in-out infinite;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.transaction-count-badge::before {
    content: "📊";
    margin-right: 0.5rem;
    font-size: 0.9em;
    filter: contrast(1.2) brightness(1.1);
}

@keyframes subtle-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 
                    0 2px 4px rgba(0, 0, 0, 0.1);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 
                    0 3px 6px rgba(0, 0, 0, 0.15);
    }
}

[data-theme="dark"] .transaction-count-badge {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    border-color: #64748b;
    color: #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 
                0 2px 4px rgba(0, 0, 0, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .transaction-count-badge::before {
    filter: brightness(1.3) contrast(1.2);
}

.period-inputs {
    display: none;
}

.period-input-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.period-nav-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.period-nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.3s ease;
    border-radius: 50%;
}

.period-nav-btn:hover::before {
    transform: scale(1);
}

.period-nav-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.2));
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.period-nav-btn:active {
    transform: scale(0.95);
}

.period-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    flex-wrap: wrap;
}

.period-footer-left {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the buttons */
    gap: 1rem;
    flex: 1;
}

.quick-period-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-period-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.45rem 0.75rem;
    border-radius: 18px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 52px;
    text-align: center;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.quick-period-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.quick-period-btn:hover::before {
    left: 100%;
}

.quick-period-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.15));
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.quick-period-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.quick-period-btn.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: activeShine 2s ease-in-out infinite;
}

@keyframes activeShine {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

/* Separate ALL Button Styles */
.all-transactions-section {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.all-transactions-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border: 2px solid rgba(16, 185, 129, 0.6);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.all-transactions-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.all-transactions-btn:hover::before {
    left: 100%;
}

.all-transactions-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
    background: linear-gradient(135deg, #059669, #047857);
}

.all-transactions-btn.active {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.all-transactions-btn i {
    font-size: 0.9rem;
}

[data-theme="dark"] .all-transactions-btn {
    background: linear-gradient(135deg, #065f46, #064e3b);
    border: 2px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .all-transactions-btn:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .all-transactions-btn.active {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
}

.transaction-badge {
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.today-btn-small {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.today-btn-small::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.today-btn-small:hover::before {
    left: 100%;
}

.today-btn-small:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.2));
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
    .current-period-header {
        padding: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .period-nav-container {
        gap: 1rem;
    }
    
    .period-center {
        min-width: 180px;
    }
    
    .period-center h3 {
        font-size: 1.1rem;
    }
    
    .period-center .date-details {
        font-size: 0.85rem;
    }
    
    .period-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }
    
    .period-footer {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .period-footer-left {
        justify-content: center;
        flex-wrap: nowrap; /* Ensure items stay in one row */
        gap: 0.75rem;
        align-items: center; /* Better vertical alignment */
    }
    
    .quick-period-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    
    .quick-period-btn {
        font-size: 0.65rem;
        padding: 0.4rem 0.6rem;
        border-radius: 16px;
        min-width: 46px;
        letter-spacing: 0.2px;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12), 
                    inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
    
    .quick-period-btn:hover {
        transform: translateY(-1px) scale(1.01);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2), 
                    inset 0 1px 0 rgba(255, 255, 255, 0.25);
    }
    
    .custom-range-section {
        padding: 1rem;
    }
    
    .custom-range-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .range-input-group {
        width: 100%;
    }
    
    .range-input {
        width: 100%;
        min-width: auto;
    }
    
    .range-separator {
        display: none;
    }
    
    .apply-range-btn {
        width: 100%;
        justify-content: center;
    }
    
    .quick-ranges {
        gap: 0.4rem;
    }
    
    .quick-range-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Premium Transactions List */
.transactions-section {
    background: linear-gradient(135deg, var(--surface-color), var(--background-color));
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.transactions-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #22c55e, #ef4444, #6366f1, #f59e0b, #22c55e);
    background-size: 300% 100%;
    animation: transactionShimmer 4s ease-in-out infinite;
    border-radius: 24px 24px 0 0;
}

.transactions-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 15% 40%, rgba(34, 197, 94, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 85% 30%, rgba(239, 68, 68, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(99, 102, 241, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.transactions-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
}

@keyframes transactionShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.transactions-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, #22c55e, #ef4444, #6366f1);
    border-radius: 1px;
    animation: headerExpand 2.5s ease-in-out infinite alternate;
}

@keyframes headerExpand {
    0% { width: 80px; opacity: 0.7; }
    100% { width: 120px; opacity: 1; }
}

.transactions-header h2 {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
}

.transactions-header h2::before {
    content: '💳';
    font-size: 1.3rem;
    padding: 0.6rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(239, 68, 68, 0.15));
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
    animation: iconFloat 3s ease-in-out infinite;
}

.transactions-header:hover h2::before {
    transform: rotate(10deg) scale(1.1);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(239, 68, 68, 0.25));
    border-color: rgba(99, 102, 241, 0.4);
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.sync-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sync-indicator.syncing {
    color: var(--warning-color);
}

.sync-indicator.synced {
    color: var(--success-color);
}

.sync-indicator.error {
    color: var(--error-color);
}

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

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.3;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: emptyFloat 3s ease-in-out infinite;
    display: block;
}

@keyframes emptyFloat {
    0%, 100% { transform: translateY(0); opacity: 0.3; }
    50% { transform: translateY(-10px); opacity: 0.5; }
}

.empty-state h3 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.empty-state p {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Scrollable Transactions Container */
.transactions-scroll-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-right: -0.5rem;
    /* Hide scrollbar for webkit browsers */
    -webkit-scrollbar-width: none;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.transactions-scroll-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar for webkit browsers */
}

.transaction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    margin: 0 0 1rem 0;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .transaction-item {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.9), rgba(26, 32, 44, 0.6));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.transaction-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.05), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
    z-index: 0;
}

.transaction-item:hover::before {
    left: 100%;
}

.transaction-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8));
    transform: translateX(8px) translateY(-2px);
    box-shadow: 0 16px 48px rgba(99, 102, 241, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: var(--primary-color);
}

[data-theme="dark"] .transaction-item:hover {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.95), rgba(26, 32, 44, 0.8));
    box-shadow: 0 16px 48px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.transaction-details {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.category-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: var(--border-color);
    flex-shrink: 0;
    color: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.category-icon::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 18px;
    background: inherit;
    z-index: -1;
    opacity: 0;
    transition: all 0.3s ease;
}

.transaction-item:hover .category-icon::after {
    opacity: 0.3;
    transform: scale(1.1);
}

.category-icon.income {
    background: linear-gradient(135deg, #22c55e, #16a34a, #15803d);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3);
}

.category-icon.expense {
    background: linear-gradient(135deg, #ef4444, #dc2626, #b91c1c);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.transaction-item:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.transaction-item:hover .category-icon.income {
    box-shadow: 0 12px 32px rgba(34, 197, 94, 0.4);
}

.transaction-item:hover .category-icon.expense {
    box-shadow: 0 12px 32px rgba(239, 68, 68, 0.4);
}

.transaction-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: all 0.3s ease;
}

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

.transaction-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.025em;
    transition: all 0.3s ease;
}

.transaction-item:hover .transaction-info h4 {
    color: var(--primary-color);
    font-weight: 700;
}

.transaction-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.transaction-info p::before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.transaction-item:hover .transaction-info p::before {
    opacity: 1;
    color: var(--secondary-color);
    transform: scale(1.2);
}

.transaction-amount {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    position: relative;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.transaction-amount.income {
    color: #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.transaction-amount.expense {
    color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.transaction-item:hover .transaction-amount {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.transaction-item:hover .transaction-amount.income {
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.1));
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.transaction-item:hover .transaction-amount.expense {
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.1));
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.transaction-actions {
    display: flex;
    gap: 0.75rem;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.transaction-item:hover .transaction-actions {
    opacity: 1;
    transform: translateX(-4px);
}

.action-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
    backdrop-filter: blur(20px);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.6rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .action-btn {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.9), rgba(26, 32, 44, 0.6));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.action-btn.delete:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: var(--error-color);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

.action-btn:active {
    transform: translateY(0) scale(0.95);
}

.action-btn i {
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-btn:hover i {
    transform: scale(1.1);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Toast Notifications with theme support */
.toast {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .toast {
    background: var(--surface-color);
    border-color: var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .toast {
    background: white;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

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

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.info {
    border-left: 4px solid var(--info-color);
}

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

/* Loading Overlay with theme support */
.loading-overlay {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .loading-overlay {
    background: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .loading-overlay {
    background: rgba(0, 0, 0, 0.6);
}

.loading-spinner {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .loading-spinner {
    background: var(--surface-color);
    border-color: var(--border-color);
}

[data-theme="light"] .loading-spinner {
    background: white;
    border-color: rgba(0, 0, 0, 0.1);
}
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.loading-spinner i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

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

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface-color);
    border-radius: 1rem;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    color: var(--text-primary);
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.cancel-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.save-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* Enhanced Mobile Compatibility */
@media (max-width: 768px) {
    .app-container {
        min-height: 100vh;
        width: 100%;
        overflow-x: hidden;
    }
    
    .header {
        position: sticky;
        top: 0;
        z-index: 100;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    
    .header-content {
        padding: 0.75rem 1rem;
        flex-wrap: nowrap;
        min-height: 60px;
    }

    .logo {
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
    
    .logo-icon i {
        font-size: 0.75rem;
    }
    
    .logo-text h1 {
        font-size: 1.1rem;
        white-space: nowrap;
    }
    
    .logo-text small {
        font-size: 0.7rem;
        display: none;
    }

    .header-controls {
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        touch-action: manipulation;
    }

    .sign-in-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        white-space: nowrap;
        touch-action: manipulation;
    }

    .main-content {
        padding: 1rem 0.75rem;
        width: 100%;
        box-sizing: border-box;
    }

    .current-period-header {
        margin: 0.75rem 0.5rem;
        width: calc(100% - 1rem);
        padding: 1rem;
        border-radius: 16px;
        box-sizing: border-box;
    }

    .view-nav {
        flex-direction: row;
        padding: 0.4rem;
        border-radius: 12px;
        gap: 0.3rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .view-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-btn {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
        gap: 0.4rem;
        border-radius: 10px;
        flex-shrink: 0;
        touch-action: manipulation;
        min-width: fit-content;
    }

    .nav-btn i {
        font-size: 0.9rem;
    }

    .summary-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .summary-card {
        padding: 1.25rem;
        border-radius: 16px;
        touch-action: manipulation;
    }

    .summary-icon {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
        border-radius: 12px;
    }

    .summary-content h3 {
        font-size: 0.8rem;
    }

    .summary-content span {
        font-size: 1.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .form-group {
        touch-action: manipulation;
    }
    
    .form-group input,
    .form-group select {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        min-height: 48px;
        touch-action: manipulation;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    #type {
        min-height: 56px;
        font-size: 1rem;
    }

    .submit-btn {
        padding: 1rem 2rem;
        font-size: 1rem;
        min-height: 56px;
        touch-action: manipulation;
        border-radius: 16px;
    }

    .add-transaction-section {
        padding: 1.25rem;
        border-radius: 16px;
        margin-bottom: 1rem;
    }

    .chart-section {
        padding: 1.25rem;
        border-radius: 16px;
        margin-bottom: 1rem;
    }
    
    .chart-container {
        height: 300px;
        touch-action: pan-x pan-y;
    }
    
    .chart-legend {
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: center;
    }
    
    .legend-item {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        touch-action: manipulation;
        min-height: 44px;
    }
    
    .comparison-badge {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        touch-action: manipulation;
    }
    
    /* Smart Insights Mobile Styles */
    .chart-insights-area {
        padding: 1rem;
        border-radius: 16px;
        margin-bottom: 1rem;
        display: flex !important;
        flex-direction: column;
        visibility: visible;
        opacity: 1;
        height: auto;
        min-height: 200px;
        max-height: 300px;
    }
    
    .chart-insights-area .insights-header {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        margin-bottom: 0.75rem;
    }
    
    .chart-insights-area .insights-header h4 {
        font-size: 1rem;
        display: block;
        visibility: visible;
        opacity: 1;
    }
    
    .chart-insights-container {
        max-height: 200px;
        gap: 0.75rem;
        display: flex;
        flex-direction: column;
        visibility: visible;
        opacity: 1;
        overflow-y: auto;
    }
    
    .chart-insights-container .insight-card {
        padding: 0.875rem;
        border-radius: 12px;
        font-size: 0.85rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        visibility: visible;
        opacity: 1;
        min-height: 60px;
    }
    
    .chart-insights-container .insight-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        border-radius: 8px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile transactions header fix */
    .transactions-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .transactions-header h2 {
        margin: 0;
        font-size: 1.1rem;
    }
    
    .sync-status {
        align-self: stretch;
        text-align: center;
    }
    
    /* Export button mobile fix */
    #downloadButton {
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
        margin: 0 !important;
        border-radius: 12px !important;
        touch-action: manipulation;
    }
    
    .transactions-section {
        padding: 1.25rem;
        border-radius: 16px;
        margin-bottom: 1rem;
    }
    
    .transaction-item {
        padding: 1.25rem;
        border-radius: 12px;
        touch-action: manipulation;
    }

    .transaction-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        width: 100%;
    }

    .transaction-actions {
        opacity: 1;
        position: static;
        margin-top: 0.5rem;
        gap: 0.5rem;
    }
    
    .transaction-actions button {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        touch-action: manipulation;
        min-height: 40px;
    }

    .modal-content {
        width: 95%;
        max-width: none;
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 16px;
        box-sizing: border-box;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-actions button {
        min-height: 48px;
        touch-action: manipulation;
    }
    
    .period-nav-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
        touch-action: manipulation;
    }
    
    .period-center h3 {
        font-size: 1.1rem;
    }
    
    .period-center .date-details {
        font-size: 0.85rem;
        gap: 0.3rem;
    }
    
    .transaction-count-badge {
        font-size: 0.8rem;
        padding: 0.35rem 0.8rem;
        margin-left: 0.5rem;
    }
    
    .transaction-count-badge::before {
        margin-right: 0.4rem;
        font-size: 0.85em;
    }
    
    .today-btn-small,
    .transaction-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
        touch-action: manipulation;
    }
}

/* Enhanced Mobile Styles for Small Screens */
@media (max-width: 480px) {
    .app-container {
        overflow-x: hidden;
    }
    
    .header-content {
        padding: 0.5rem 0.75rem;
        min-height: 56px;
    }

    .header-controls {
        gap: 0.35rem;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
        padding: 0.4rem;
        touch-action: manipulation;
    }

    .user-info span {
        display: none;
    }

    .sign-in-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        touch-action: manipulation;
    }

    .sign-in-btn i {
        font-size: 0.9rem;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }
    
    .logo-text h1 {
        font-size: 1rem;
    }

    .logo-text small {
        display: none;
    }
    
    .main-content {
        padding: 0.75rem 0.5rem;
    }
    
    .current-period-header {
        margin: 0.5rem 0.25rem;
        width: calc(100% - 0.5rem);
        padding: 0.875rem;
    }
    
    .view-nav {
        padding: 0.3rem;
        gap: 0.25rem;
    }
    
    .nav-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
        min-width: auto;
    }
    
    .summary-section {
        gap: 0.75rem;
    }
    
    .summary-card {
        padding: 1rem;
    }
    
    .summary-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .summary-content span {
        font-size: 1.3rem;
    }
    
    .form-grid {
        gap: 1rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    #type {
        min-height: 52px;
        font-size: 0.95rem;
    }
    
    .submit-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        min-height: 52px;
    }
    
    .add-transaction-section,
    .chart-section,
    .transactions-section {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .legend-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    .comparison-badge {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    /* Smart Insights Small Mobile Styles */
    .chart-insights-area {
        padding: 0.875rem;
        border-radius: 12px;
        margin-bottom: 0.75rem;
        display: flex !important;
        flex-direction: column;
        visibility: visible;
        opacity: 1;
        height: auto;
        min-height: 150px;
        max-height: 250px;
    }
    
    .chart-insights-area .insights-header {
        margin-bottom: 0.5rem;
    }
    
    .chart-insights-area .insights-header h4 {
        font-size: 0.9rem;
        display: block;
        visibility: visible;
        opacity: 1;
    }
    
    .chart-insights-container {
        max-height: 150px;
        gap: 0.5rem;
        display: flex;
        flex-direction: column;
        visibility: visible;
        opacity: 1;
        overflow-y: auto;
    }
    
    .chart-insights-container .insight-card {
        padding: 0.75rem;
        border-radius: 10px;
        font-size: 0.8rem;
        gap: 0.5rem;
        display: flex;
        align-items: center;
        visibility: visible;
        opacity: 1;
        min-height: 50px;
    }
    
    .chart-insights-container .insight-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        border-radius: 6px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .transaction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }

    .transaction-details {
        width: 100%;
    }

    .transaction-amount {
        align-self: flex-end;
        font-size: 1.1rem;
    }
    
    .period-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    .period-center h3 {
        font-size: 1rem;
    }

    .period-center .date-details {
        font-size: 0.8rem;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .transaction-count-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
        margin-top: 0.25rem;
        margin-left: 0.4rem;
    }
    
    .transaction-count-badge::before {
        margin-right: 0.3rem;
        font-size: 0.8em;
    }

    .period-footer {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .period-footer-left {
        flex-wrap: nowrap; /* Force ALL button and transaction count to stay in one row */
        gap: 0.5rem;
        justify-content: center; /* Center the buttons */
        align-items: center;
        flex-shrink: 0; /* Prevent shrinking */
    }

    .all-transactions-btn {
        padding: 0.4rem 0.8rem; /* Smaller padding for mobile */
        font-size: 0.7rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .today-mobile {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
        white-space: nowrap;
        flex-shrink: 0;
        background: linear-gradient(135deg, #f59e0b, #d97706);
        color: white;
        border: none;
        border-radius: 12px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .today-mobile:hover {
        background: linear-gradient(135deg, #d97706, #b45309);
        transform: translateY(-1px);
    }

    .transaction-badge,
    .today-btn-small {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
        flex-shrink: 0; /* Prevent text wrapping */
        white-space: nowrap; /* Keep text in one line */
    }
    
    .modal-content {
        width: 100%;
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

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

/* Success/Error Messages */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    z-index: 1001;
    animation: slideInRight 0.3s ease-out;
}

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

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

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

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Compact Single-Line Footer */
.footer {
    background: linear-gradient(135deg, var(--surface-color), rgba(99, 102, 241, 0.05));
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
    padding: 1rem 0;
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-info h3 {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.footer-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
    font-weight: 500;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.footer-links a:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.footer-copyright::before {
    content: '©';
    font-weight: bold;
}

.footer-copyright::after {
    content: '❤️';
    font-size: 0.7rem;
}

/* Compact Footer Mobile Styles */
@media (max-width: 768px) {
    .footer {
        padding: 0.75rem 0;
    }
    
    .footer-content {
        padding: 0 1rem;
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .footer-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .footer-links a {
        font-size: 0.8rem;
    }
    
    .footer-copyright {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .footer-content {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }
    
    .footer-info h3 {
        font-size: 1.1rem;
    }
    
    .footer-info p {
        font-size: 0.8rem;
    }
    
    .footer-links {
        gap: 0.5rem;
        flex-direction: column;
    }
    
    .footer-links a {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
        text-align: center;
        word-break: break-all; /* Ensure long email/phone breaks properly */
    }
    
    .footer-copyright {
        font-size: 0.7rem;
    }
}

/* Mobile responsive adjustments - simplified with single line insights */
@media (max-width: 768px) {
    .chart-insights-single-line {
        padding: 0.75rem 1rem;
        margin: 0.75rem 0;
        font-size: 0.85rem;
        gap: 0.5rem;
    }
    
    .chart-insights-single-line .insight-icon {
        font-size: 0.9rem;
    }
    
    .transactions-scroll-container {
        max-height: 400px; /* Increased height for mobile to show 3+ transactions */
        /* Hide scrollbar for mobile webkit browsers */
        -webkit-scrollbar-width: none;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* Internet Explorer 10+ */
    }
    
    .transactions-scroll-container::-webkit-scrollbar {
        display: none; /* Hide scrollbar for mobile webkit browsers */
    }
    
    /* Mobile transaction item styling */
    .transaction-item {
        padding: 1rem; /* Reduced from 1.5rem */
        margin: 0 0 0.75rem 0; /* Reduced margin */
        border-radius: 16px;
    }
    
    .transaction-info h4 {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
    }
    
    .transaction-info p {
        font-size: 0.85rem;
    }
    
    .transaction-amount {
        font-size: 1.1rem;
    }
    
    .category-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* Chart mobile improvements */
    .chart-container-3d {
        height: 280px;
    }
}

@media (max-width: 480px) {
    .chart-insights-single-line {
        padding: 0.625rem 0.875rem;
        margin: 0.5rem 0;
        font-size: 0.8rem;
    }
    
    .chart-insights-single-line .insight-icon {
        font-size: 0.85rem;
    }
    
    .transactions-scroll-container {
        max-height: 350px; /* Increased for small mobile to show 3+ transactions */
        /* Hide scrollbar for small mobile webkit browsers */
        -webkit-scrollbar-width: none;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* Internet Explorer 10+ */
    }
    
    .transactions-scroll-container::-webkit-scrollbar {
        display: none; /* Hide scrollbar for small mobile webkit browsers */
    }
    
    /* Small mobile transaction item styling */
    .transaction-item {
        padding: 0.75rem; /* Further reduced padding */
        margin: 0 0 0.5rem 0; /* Reduced margin */
        border-radius: 14px;
    }
    
    .transaction-info h4 {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }
    
    .transaction-info p {
        font-size: 0.8rem;
    }
    
    .transaction-amount {
        font-size: 1rem;
    }
    
    .category-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    /* Chart small mobile improvements */
    .chart-container-3d {
        height: 220px;
    }
    
    .chart-header h3 {
        font-size: 1rem;
    }
    
    .chart-legend {
        gap: 0.5rem;
    }
    /* Mobile transactions header and export button */
    .transactions-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.875rem;
    }
    
    .transactions-header h2 {
        font-size: 1rem;
        margin: 0;
    }
    
    /* Export button mobile styling */
    #downloadButton {
        width: 100%;
        max-width: none;
        padding: 0.675rem 0.875rem;
        font-size: 0.85rem;
        margin: 0;
        border-radius: 10px;
        box-sizing: border-box;
        touch-action: manipulation;
    }
}