/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

:root {
    /* Color Palette - Professional blues and greens */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    
    /* Neutrals */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Background */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Spacing */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-10: 2.5rem;
    --spacing-12: 3rem;
    --spacing-16: 4rem;
    --spacing-20: 5rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border radius */
    --radius-sm: 0.25rem;
    --radius: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: #f9fafb !important;
    background-color: #111827 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    z-index: 0;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-4);
    overflow: visible;
}

/* Dashboard containers should be wider to accommodate tables */
.dashboard .container {
    max-width: 1300px;
}

@media (min-width: 640px) {
    .container {
        padding: 0 var(--spacing-6);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--spacing-8);
    }
}

/* Landing Page */
.landing-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, 
        #1e3a8a 0%, 
        #3b82f6 25%, 
        #1d4ed8 50%, 
        #1e40af 75%, 
        #1e3a8a 100%);
    position: relative;
}

.landing-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.4) 0%, transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(29, 78, 216, 0.3) 0%, transparent 60%),
        radial-gradient(circle at 40% 40%, rgba(30, 64, 175, 0.2) 0%, transparent 60%);
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-15px) scale(1.02); }
}

.hero-section {
    text-align: center;
    color: white;
    z-index: 1;
    position: relative;
}

.hero-title {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    margin-bottom: var(--spacing-4);
    margin-top: var(--spacing-4);
    animation: fadeInUp 1s ease-out;
    background: linear-gradient(135deg, #ffffff 0%, #e5e7eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-16);
    opacity: 0.95;
    animation: fadeInUp 1s ease-out 0.3s both;
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

/* Main Content Section - Side by Side Layout */
.main-content-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-8);
    align-items: stretch;
    animation: fadeInUp 1s ease-out 0.6s both;
    max-width: 1300px; /* Match dashboard container width */
    margin: 0 auto;
    padding: 0 var(--spacing-2); /* Much smaller padding - reduce space to screen edges */
    min-height: 0;
}

.help-card,
.upload-area {
    height: 100%;
}

.upload-area {
    /* min-height: 320px; */
}

/* Much smaller responsive padding */
@media (min-width: 640px) {
    .main-content-section {
        padding: 0 var(--spacing-3); /* Much smaller than dashboard */
    }
}

@media (min-width: 1024px) {
    .main-content-section {
        padding: 0 var(--spacing-4); /* Much smaller than dashboard */
    }
}

/* Help Section */
.help-section {
    margin-bottom: 0;
    animation: none;
    display: flex;
    flex-direction: column;
}

.help-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    border: none;
    border-radius: 24px;
    padding: var(--spacing-6);
    max-width: none;
    margin: 0;
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.06),
        0 4px 12px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all var(--transition-normal);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.help-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.1) 0%, 
        rgba(16, 185, 129, 0.05) 50%,
        rgba(59, 130, 246, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.help-card:hover {
    transform: translateY(-6px);
    box-shadow: 
        0 24px 60px rgba(0, 0, 0, 0.12),
        0 12px 32px rgba(0, 0, 0, 0.08),
        0 6px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

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

.help-card .help-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(16, 185, 129, 0.2));
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    margin: 0 auto var(--spacing-3);
    color: white;
    font-size: 22px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.help-card:hover .help-icon {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(16, 185, 129, 0.3));
    border-color: rgba(255, 255, 255, 0.5);
}

.help-title {
    color: white;
    font-size: var(--font-size-lg);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-3);
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.help-text {
    color: rgba(255, 255, 255, 0.95);
    font-size: var(--font-size-sm);
    line-height: 1.6;
    text-align: center;
    margin-bottom: var(--spacing-4);
    position: relative;
    z-index: 2;
    font-weight: 500;
}

.help-steps {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    position: relative;
    z-index: 2;
    flex-grow: 1;
}

.step {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    padding: var(--spacing-3);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.1) 0%, 
        rgba(16, 185, 129, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.step:hover {
    transform: translateX(8px);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

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

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.6));
    color: white;
    font-weight: 700;
    font-size: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    transition: all 0.3s ease;
}

.step:hover .step-number {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.step-text {
    color: rgba(255, 255, 255, 0.95);
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.5;
    position: relative;
    z-index: 2;
}

/* Upload Section */
.upload-section {
    margin-bottom: 0;
    animation: none;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .upload-section {
        margin-bottom: var(--spacing-8);
    }
}

.upload-area {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    border: none;
    border-radius: 24px;
    max-width: none;
    margin: 0;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    /* height: 100%; */
    /* min-height: 320px; */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.06),
        0 4px 12px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.08) 0%, 
        rgba(16, 185, 129, 0.05) 50%,
        rgba(59, 130, 246, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.upload-area:hover {
    transform: translateY(-6px);
    box-shadow: 
        0 24px 60px rgba(0, 0, 0, 0.12),
        0 12px 32px rgba(0, 0, 0, 0.08),
        0 6px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.upload-area:hover::before {
    opacity: 1;
}

.upload-area.drag-over {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.02);
    box-shadow: 
        0 24px 60px rgba(59, 130, 246, 0.2),
        0 12px 32px rgba(59, 130, 246, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.upload-content {
    text-align: center;
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-icon {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--spacing-3);
    display: block;
    position: relative;
    transition: all 0.3s ease;
}

.upload-area:hover .upload-icon {
    transform: scale(1.1);
    color: white;
}

.upload-area h3 {
    color: white;
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: var(--spacing-2);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.upload-area p {
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-4);
    font-weight: 500;
    line-height: 1.6;
}

.upload-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: var(--spacing-3) var(--spacing-5);
    border-radius: 10px;
    font-size: var(--font-size-sm);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 var(--spacing-2) var(--spacing-3);
    position: relative;
    z-index: 2;
    box-shadow: 
        0 6px 16px rgba(59, 130, 246, 0.25),
        0 4px 12px rgba(59, 130, 246, 0.18),
        0 2px 6px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    overflow: hidden;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
}

/* Button container for side-by-side layout on desktop */
.upload-buttons-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-3);
    margin-bottom: var(--spacing-3);
}

@media (min-width: 769px) {
    .upload-buttons-container {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: var(--spacing-4);
    }
    
    .upload-btn,
    .secondary-btn {
        margin: 0;
        height: 44px; /* Ensure both buttons have the same height */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        line-height: 1;
        vertical-align: top;
        padding: var(--spacing-3) var(--spacing-5);
        border-radius: 10px;
        font-size: var(--font-size-sm);
        font-weight: 700;
    }
}

.upload-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.upload-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 10px 24px rgba(59, 130, 246, 0.3),
        0 6px 16px rgba(59, 130, 246, 0.2),
        0 3px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.upload-btn:hover::before {
    opacity: 1;
}

.upload-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 6px rgba(59, 130, 246, 0.2),
        0 1px 4px rgba(59, 130, 246, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.05);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    border: none;
    padding: var(--spacing-3) var(--spacing-5);
    border-radius: 10px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(15px);
    overflow: hidden;
    box-shadow: 
        0 6px 18px rgba(0, 0, 0, 0.12),
        0 3px 8px rgba(0, 0, 0, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
}

.secondary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 
        0 10px 24px rgba(0, 0, 0, 0.15),
        0 6px 12px rgba(0, 0, 0, 0.1),
        0 3px 6px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.secondary-btn:hover::before {
    opacity: 1;
}

.secondary-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 2px 6px rgba(0, 0, 0, 0.1),
        0 1px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.upload-info {
    font-size: var(--font-size-sm);
    color: var(--gray-400);
    margin-top: var(--spacing-4);
}

/* Upload States */
.upload-loading, .upload-success, .upload-error, .file-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.file-selected {
    animation: slideInUp 0.5s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.file-icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: var(--spacing-4);
}

.file-name {
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: var(--spacing-6);
    word-break: break-all;
}

.file-actions {
    display: flex;
    gap: var(--spacing-3);
    justify-content: center;
    flex-wrap: wrap;
}

.success-details {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-2);
    font-weight: 500;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-4);
}

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

.success-icon {
    font-size: 3rem;
    color: var(--success-color);
    margin-bottom: var(--spacing-4);
    animation: bounceIn 0.6s ease-out;
}

.error-icon {
    font-size: 3rem;
    color: var(--danger-color);
    margin-bottom: var(--spacing-4);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Dashboard */
.dashboard {
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
}

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



/* Section Title */
.section-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: white;
    margin-bottom: var(--spacing-6);
    margin-top: 0;
    text-align: center;
}

/* Autoinvest Section */
.autoinvest-section {
    padding: var(--spacing-8) 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-12) var(--spacing-6);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--gray-600);
}

.empty-icon {
    font-size: 4rem;
    color: var(--gray-500);
    margin-bottom: var(--spacing-4);
}

.empty-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-300);
    margin-bottom: var(--spacing-2);
}

.empty-message {
    color: var(--gray-400);
    font-size: var(--font-size-base);
}

/* Autoinvest Stats */
.autoinvest-stats {
    margin-top: var(--spacing-6);
}

/* Stat Subvalue for date/amount pairs */
.stat-subvalue {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--gray-400);
    margin-top: var(--spacing-1);
    margin-bottom: 0;
}

/* Dashboard Header */
.dashboard-header {
    background: #1f2937 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06) !important;
    padding: var(--spacing-6) 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: transform 0.3s ease-in-out;
}

.dashboard-header.header-hidden {
    transform: translateY(-100%);
}

/* Add padding to body to account for fixed header */
.dashboard {
    padding-top: 100px; /* Account for header height: padding (48px) + content (~52px) */
    position: relative !important;
    min-height: calc(100vh - 100px) !important;
    overflow-y: visible !important;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-4);
}

/* Header content responsive padding to match container */
@media (min-width: 640px) {
    .header-content {
        padding: 0 var(--spacing-6);
    }
}

@media (min-width: 1024px) {
    .header-content {
        padding: 0 var(--spacing-8);
    }
}

/* Global scrolling fixes for all viewport sizes */
* {
    -webkit-overflow-scrolling: touch;
}

.dashboard-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: #f9fafb !important;
    margin-bottom: var(--spacing-1);
}

.dashboard-subtitle {
    color: #d1d5db !important;
    font-size: var(--font-size-sm);
}

/* Landing Page Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-3) var(--spacing-5);
    border-radius: 10px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-weight: 700;
    box-shadow: 
        0 12px 32px rgba(59, 130, 246, 0.5),
        0 8px 24px rgba(59, 130, 246, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary::before {
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    z-index: -1;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 20px 48px rgba(59, 130, 246, 0.6),
        0 12px 32px rgba(59, 130, 246, 0.4),
        0 6px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 
        0 8px 24px rgba(59, 130, 246, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    border: none;
    font-weight: 500;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.06),
        0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-secondary::before {
    background: rgba(255, 255, 255, 0.1);
    z-index: -1;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.06);
}

.btn-secondary:hover::before {
    opacity: 1;
}

.btn-secondary:disabled,
.btn-secondary.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

.btn-secondary:disabled:hover,
.btn-secondary.disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    border: none;
    font-weight: 500;
    box-shadow: 
        0 6px 18px rgba(0, 0, 0, 0.12),
        0 3px 8px rgba(0, 0, 0, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-outline::before {
    background: rgba(255, 255, 255, 0.05);
    z-index: -1;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 
        0 10px 24px rgba(0, 0, 0, 0.15),
        0 6px 12px rgba(0, 0, 0, 0.1),
        0 3px 6px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-outline:hover::before {
    opacity: 1;
}

.btn-outline:disabled,
.btn-outline.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-outline:disabled:hover,
.btn-outline.disabled:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: none;
}

/* Statistics Section */
.stats-section {
    padding: var(--spacing-2) 0 var(--spacing-8) 0;
    overflow: visible;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-6);
    overflow: visible;
}

.stat-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    padding: var(--spacing-6);
    border-radius: 20px;
    border: none;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
    animation: slideInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    overflow: visible;
    z-index: 1;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
.stat-card:nth-child(5) { animation-delay: 0.5s; }
.stat-card:nth-child(6) { animation-delay: 0.6s; }
.stat-card:nth-child(7) { animation-delay: 0.7s; }
.stat-card:nth-child(8) { animation-delay: 0.8s; }

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card:hover {
    transform: translateY(-2px) !important;
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.7));
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: white;
    margin-bottom: var(--spacing-1);
    line-height: 1.2;
}

.stat-value.zero {
    color: var(--gray-400);
    font-weight: 400;
}

.stat-label {
    color: #9ca3af;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* Filters Section */
.filters-section {
    padding: var(--spacing-8) 0;
}

.filters-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-6);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-6);
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: var(--spacing-4);
}

.filters-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: white;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-6);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.filter-label {
    font-weight: 500;
    color: var(--gray-700);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-2);
}

.date-range-container {
    display: flex;
    gap: var(--spacing-2);
}

.date-input, .search-input {
    flex: 1;
    padding: var(--spacing-2) var(--spacing-3);
    border: none;
    border-radius: 12px;
    font-size: var(--font-size-sm);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    transition: all var(--transition-normal);
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.date-input:focus, .search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.date-presets {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-2);
    margin-top: var(--spacing-2);
}

.preset-btn {
    padding: var(--spacing-1) var(--spacing-3);
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.03);
}

.preset-btn:hover, .preset-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.7));
    color: white;
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.1);
}

.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: var(--spacing-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: var(--font-size-sm);
}

.search-container .search-input {
    padding-left: var(--spacing-8);
}

.project-filter {
    position: relative;
}

.project-options {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    margin-top: var(--spacing-2);
    display: none;
}

.project-options.show {
    display: block;
}

.project-option {
    padding: var(--spacing-2) var(--spacing-3);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-size: var(--font-size-sm);
}

.project-option:hover {
    background: var(--gray-50);
}

.project-option input[type="checkbox"] {
    margin: 0;
}

.transaction-types {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-2);
}

.transaction-type-btn {
    padding: var(--spacing-2) var(--spacing-3);
    border: 1px solid var(--gray-300);
    background: var(--bg-primary);
    color: var(--gray-600);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

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

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

.transaction-type-count {
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: var(--font-size-xs);
    padding: 2px 6px;
    border-radius: var(--radius);
    margin-left: var(--spacing-2);
    font-weight: 500;
}

.transaction-type-btn.active .transaction-type-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Charts Section */
.charts-section {
    padding: var(--spacing-4) 0 var(--spacing-8);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-8);
}

.chart-main {
    grid-column: 1 / -1;
}

.chart-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: none;
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    padding: var(--spacing-6);
    transition: all var(--transition-normal);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 24px 60px rgba(0, 0, 0, 0.2),
        0 12px 32px rgba(0, 0, 0, 0.15),
        0 6px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}



.chart-container {
    position: relative;
    height: 400px;
    z-index: 1;
}

.chart-main .chart-container {
    height: 450px;
}

/* Modern Chart Empty State Styling */
.chart-empty-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 40px 20px;
    text-align: center;
    background: transparent;
    position: relative;
}

.empty-icon-modern {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    position: relative;
    transition: all 0.3s ease;
}

.empty-icon-modern::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(16, 185, 129, 0.3));
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chart-empty-modern:hover .empty-icon-modern::before {
    opacity: 1;
}

.empty-icon-modern i {
    font-size: 32px;
    color: #3B82F6;
    transition: all 0.3s ease;
}

.chart-empty-modern:hover .empty-icon-modern i {
    color: #2563EB;
    transform: scale(1.1);
}

.empty-title-modern {
    font-size: 18px;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0 0 12px 0;
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.4;
}

.empty-message-modern {
    font-size: 14px;
    font-weight: 400;
    color: #9CA3AF;
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.5;
    max-width: 300px;
}

/* Info tooltips */
.info-tooltip {
    position: relative;
    display: inline-block;
    margin-left: var(--spacing-2);
    cursor: help;
    z-index: 50; /* Lower than header (100) but higher than content */
}

.info-icon {
    color: var(--gray-400);
    font-size: var(--font-size-sm);
    transition: color var(--transition-normal);
    position: relative;
    z-index: 50; /* Lower than header (100) but higher than content */
}

.info-icon:hover {
    color: var(--primary-color);
}

.tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background-color: var(--gray-900);
    color: white;
    text-align: left;
    padding: var(--spacing-3);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: normal;
    line-height: 1.4;
    white-space: nowrap;
    z-index: 60; /* Lower than header (100) but higher than content */
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
    max-width: 600px;
    min-width: 300px;
    white-space: normal;
    pointer-events: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--gray-900) transparent transparent transparent;
    z-index: 60; /* Lower than header (100) but higher than content */
}

.info-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* Ensure all chart elements have lower z-index than tooltips */
.chart-container canvas,
canvas {
    position: relative;
    z-index: 1;
}

.chart-container {
    position: relative;
    z-index: 1;
}

.chart-card {
    position: relative;
    z-index: 1;
}

/* Checkbox container styles */
.checkbox-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-2);
    padding-bottom: var(--spacing-1);
    padding-left: var(--spacing-1);
    background-color: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-400) var(--gray-100);
}

.checkbox-container::-webkit-scrollbar {
    width: 6px;
}

.checkbox-container::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

.checkbox-container::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

.checkbox-container::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    padding-left: var(--spacing-1);
    padding-bottom: var(--spacing-1);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-normal);
    cursor: pointer;
}

.checkbox-item:hover {
    background-color: var(--gray-100);
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-item input[type="checkbox"]:focus {
    outline: none;
}

.checkbox-item label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    margin: 0;
    flex: 1;
}

.checkbox-item input[type="checkbox"]:checked + label {
    color: var(--primary-color);
    font-weight: 600;
}

.checkbox-count {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    font-weight: normal;
}

/* Advanced Statistics */
.advanced-stats-section {
    padding: var(--spacing-8) 0;
}

.advanced-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-6);
}

.advanced-stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-6);
}

.advanced-stat-card h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: white;
    margin-bottom: var(--spacing-4);
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: var(--spacing-3);
}

.metric-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-3);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.metric-item:hover {
    background: var(--gray-100);
}

.metric-label {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.metric-value {
    color: var(--gray-900);
    font-weight: 600;
    font-size: var(--font-size-base);
}

/* Table Section */
.table-section {
    padding: var(--spacing-8) 0 var(--spacing-4);
}

.table-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: none;
    overflow: visible;
    transition: all var(--transition-normal);
}

.table-card:hover {
    transform: translateY(-2px);
}



.table-actions {
    display: flex;
    gap: var(--spacing-2);
    align-items: center;
}

.period-toggle {
    display: flex;
    gap: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.period-toggle-btn {
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: var(--spacing-2) var(--spacing-4) !important;
    font-size: var(--font-size-sm) !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.7) !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    box-shadow: none !important;
}

.period-toggle-btn:focus {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.period-toggle-btn:active {
    outline: none !important;
    box-shadow: none !important;
}

.period-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.period-toggle-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.7)) !important;
    color: white !important;
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.1);
}

.period-toggle-btn:first-child {
    border-top-left-radius: var(--radius-md) !important;
    border-bottom-left-radius: var(--radius-md) !important;
}

.period-toggle-btn:last-child {
    border-top-right-radius: var(--radius-md) !important;
    border-bottom-right-radius: var(--radius-md) !important;
}

/* Table Filters */
.table-filters {
    padding: var(--spacing-4) var(--spacing-6);
    border-bottom: 1px solid var(--gray-200);
    background: var(--bg-secondary);
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-4);
    align-items: start;
}

.filter-select {
    width: 100%;
    padding: var(--spacing-2) var(--spacing-3);
    padding-right: 35px;
    border: none;
    border-radius: 12px;
    font-size: var(--font-size-sm);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    transition: all var(--transition-normal);
    min-height: 38px;
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}

.filter-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.9)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    color: white;
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.dropdown-container {
    position: relative;
}

/* Unified Table Styling - Both tables use identical styling */
.table-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: none;
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    overflow: hidden;
    transition: all var(--transition-normal);
    padding: 0; /* Remove any default padding */
}

.table-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 24px 60px rgba(0, 0, 0, 0.2),
        0 12px 32px rgba(0, 0, 0, 0.15),
        0 6px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.table-header {
    padding: var(--spacing-6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    background: transparent;
    position: relative;
    z-index: 10;
    overflow: visible;
}

.table-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: white;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    width: 100%;
}

/* Override chart-card overflow for tables */
.chart-card .table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.chart-card.table-card {
    overflow: hidden;
    padding: 0; /* Remove chart-card padding for tables */
}

/* Ensure tables inside charts-grid behave exactly like standalone tables on mobile */
@media (max-width: 768px) {
    .charts-grid .table-card.chart-main {
        width: 100%;
        max-width: none;
        min-width: 0;
    }
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.data-table th {
    background: transparent;
    padding: var(--spacing-3) var(--spacing-4);
    text-align: left;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    position: relative;
}

.data-table th:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.data-table th i {
    margin-left: var(--spacing-2);
    opacity: 0.5;
    transition: opacity var(--transition-normal);
}

.data-table th.sort-asc i::before {
    content: '\f0de';
    opacity: 1;
}

.data-table th.sort-desc i::before {
    content: '\f0dd';
    opacity: 1;
}

.data-table td {
    padding: var(--spacing-3) var(--spacing-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: var(--font-size-sm);
    vertical-align: middle;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.table-pagination {
    padding: var(--spacing-4) var(--spacing-6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-4);
    background: transparent;
}

.amount-positive {
    color: var(--success-color);
    font-weight: 600;
}

.amount-negative {
    color: var(--danger-color);
    font-weight: 600;
}

.amount-neutral {
    color: var(--gray-400);
    font-weight: 500;
}

.amount-zero {
    color: var(--gray-500);
}

.amount-investment {
    color: #fb923c;
    font-weight: 600;
}



.pagination-info {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
}

.pagination-controls-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-6);
}

.rows-per-page {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.rows-per-page label {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

.rows-select {
    padding: var(--spacing-1) var(--spacing-2);
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-sm);
    cursor: pointer;
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.03);
}

.rows-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.1);
}

.pagination-controls {
    display: flex;
    gap: var(--spacing-2);
}

.pagination-btn {
    padding: var(--spacing-2) var(--spacing-3);
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    min-width: 40px;
    text-align: center;
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.03);
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.06);
}

.pagination-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.7));
    color: white;
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.1);
}

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

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .main-content-section {
        grid-template-columns: 1fr;
        gap: var(--spacing-8);
    }

    .hero-title {
        font-size: var(--font-size-3xl);
        margin-top: var(--spacing-8);
    }

    .hero-subtitle {
        font-size: var(--font-size-lg);
        margin-bottom: var(--spacing-12);
    }
    
    .help-card, .upload-area {
        padding: var(--spacing-6);
        height: auto;
        min-height: 400px;
    }

    .help-card .help-icon {
        width: 56px;
        height: 56px;
        font-size: 20px;
    }

    .help-title {
        font-size: var(--font-size-lg);
    }

    .help-text {
        font-size: var(--font-size-sm);
    }

    .step {
        padding: var(--spacing-3);
        gap: var(--spacing-3);
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .step-text {
        font-size: var(--font-size-sm);
    }

    .upload-area {
        height: 330px;
        min-height: unset;
    }

    .upload-loading, .upload-success, .upload-error, .file-selected {
        height: 330px;
        min-height: unset;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: var(--spacing-4);
    }
    
    .file-selected,
    .upload-success {
        justify-content: center;
        padding: 40px var(--spacing-4) 40px var(--spacing-4);
    }
    
    .file-selected h3 {
        margin-bottom: var(--spacing-1);
        margin-top: 0;
    }
    
    .file-selected .file-icon {
        margin-bottom: var(--spacing-2);
    }
    
    .file-selected .file-name {
        margin-bottom: var(--spacing-3);
    }
    
    .upload-buttons-container {
        gap: 0;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .upload-area h3 {
        font-size: var(--font-size-lg);
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-3);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-4);
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-4);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-4);
    }
    
    .chart-container, .chart-main .chart-container {
        height: 350px;
    }
    
    .chart-card-enhanced .chart-container,
    .chart-card-enhanced-portfolio .chart-container,
    .chart-card-enhanced-time .chart-container {
        height: 350px;
    }
    
    .advanced-stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-4);
    }
    
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-3);
    }
    
    .table-actions {
        flex-wrap: wrap;
        gap: var(--spacing-2);
        width: 100%;
    }
    
    .table-actions .btn {
        font-size: var(--font-size-xs);
        padding: var(--spacing-2) var(--spacing-3);
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Ensure all tables scroll horizontally on mobile - only the table content, not headers/pagination */
    .data-table {
        min-width: 800px; /* Force horizontal scroll on mobile */
    }
    
    .data-table th,
    .data-table td {
        white-space: nowrap;
        padding: var(--spacing-2) var(--spacing-3);
    }
    
    .filter-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-3);
    }
    
    .table-pagination {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-3);
    }
    
    .pagination-controls-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-3);
    }
}

@media (max-width: 480px) {

    
    .main-content-section {
        gap: var(--spacing-6);
        max-width: none; /* Remove max-width constraint on mobile */
    }

    .help-card, .upload-area {
        padding: var(--spacing-5);
        border-radius: 20px;
        min-height: 350px;
    }

    .help-card .help-icon {
        width: 48px;
        height: 48px;
        font-size: 18px;
        margin-bottom: var(--spacing-3);
    }

    .help-title, .upload-area h3 {
        font-size: var(--font-size-base);
    }

    .help-text, .upload-area p {
        font-size: var(--font-size-sm);
    }

    .help-steps {
        gap: var(--spacing-3);
    }

    .step {
        padding: var(--spacing-2);
        gap: var(--spacing-2);
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .step-text {
        font-size: var(--font-size-xs);
    }

    .upload-area {
        height: 330px;
        min-height: unset;
    }

    .upload-loading, .upload-success, .upload-error, .file-selected {
        height: 330px;
        min-height: unset;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: var(--spacing-3);
    }
    
    .file-selected,
    .upload-success {
        justify-content: center;
        padding: 35px var(--spacing-3) 35px var(--spacing-3);
    }
    
    .file-selected h3 {
        margin-bottom: var(--spacing-1);
        margin-top: 0;
    }
    
    .file-selected .file-icon {
        margin-bottom: var(--spacing-2);
    }
    
    .file-selected .file-name {
        margin-bottom: var(--spacing-3);
    }

    .upload-icon {
        font-size: 2.5rem;
    }

    .hero-title {
        font-size: var(--font-size-2xl);
        margin-top: var(--spacing-10);
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
        margin-bottom: var(--spacing-10);
    }
    
    .date-range-container {
        flex-direction: column;
    }
    
    .date-presets {
        justify-content: center;
    }
    
    .transaction-types {
        justify-content: center;
    }
    
    .data-table {
        font-size: var(--font-size-xs);
        min-width: 900px; /* Ensure horizontal scroll triggers on very small screens */
    }
    
    .data-table th,
    .data-table td {
        padding: var(--spacing-2);
        white-space: nowrap; /* Prevent text wrapping to ensure horizontal scroll */
    }
    
    .table-actions .btn {
        font-size: var(--font-size-xs);
        padding: var(--spacing-1) var(--spacing-2);
        min-height: 32px;
    }
    
    .table-actions .btn i {
        margin-right: var(--spacing-1);
        font-size: var(--font-size-xs);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus styles for accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --gray-100: #e0e0e0;
        --gray-200: #c0c0c0;
        --gray-300: #a0a0a0;
    }
}

/* Force dark mode always - override system preferences */
:root {
    /* Force dark theme values regardless of system setting */
    --bg-primary: #1f2937 !important;
    --bg-secondary: #111827 !important;
    --bg-tertiary: #0f172a !important;
    --gray-800: #f9fafb !important;
    --gray-700: #f3f4f6 !important;
    --gray-600: #e5e7eb !important;
    --gray-500: #d1d5db !important;
    --gray-400: #9ca3af !important;
    --gray-300: #6b7280 !important;
    --gray-200: #4b5563 !important;
    --gray-100: #374151 !important;
}

/* Override light mode with dark values */
@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #1f2937 !important;
        --bg-secondary: #111827 !important;
        --bg-tertiary: #0f172a !important;
        --gray-800: #f9fafb !important;
        --gray-700: #f3f4f6 !important;
        --gray-600: #e5e7eb !important;
        --gray-500: #d1d5db !important;
        --gray-400: #9ca3af !important;
        --gray-300: #6b7280 !important;
        --gray-200: #4b5563 !important;
        --gray-100: #374151 !important;
    }
}

/* Maintain dark mode when system is dark */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1f2937 !important;
        --bg-secondary: #111827 !important;
        --bg-tertiary: #0f172a !important;
        --gray-800: #f9fafb !important;
        --gray-700: #f3f4f6 !important;
        --gray-600: #e5e7eb !important;
        --gray-500: #d1d5db !important;
        --gray-400: #9ca3af !important;
        --gray-300: #6b7280 !important;
        --gray-200: #4b5563 !important;
        --gray-100: #374151 !important;
    }
}

/* Body scroll lock for modals */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Filter Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all var(--transition-normal);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Prevent background scrolling when mouse is over modal overlay */
.modal-overlay {
    overscroll-behavior: contain;
}

.modal {
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(25px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.4),
        0 10px 25px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 600px;
    max-height: 95vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all var(--transition-normal);
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--spacing-6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}

.modal-header h3 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.modal-header i {
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--font-size-lg);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: var(--spacing-2);
    border-radius: var(--radius);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-content {
    padding: var(--spacing-6);
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

.filter-sections {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
}

.filter-section .filter-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-footer {
    padding: var(--spacing-6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: var(--spacing-3);
    justify-content: flex-end;
    background: transparent;
}

.modal-footer .btn {
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.15),
        0 2px 6px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.modal-footer .btn:hover {
    box-shadow: 
        0 6px 16px rgba(59, 130, 246, 0.2),
        0 3px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-content,
    .modal-footer {
        padding: var(--spacing-4);
    }
    
    .filter-sections {
        gap: var(--spacing-4);
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* Enhanced filter styles for modal */
.modal .date-range-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-3);
}

.modal .date-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: var(--spacing-2);
}

.modal .checkbox-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: var(--spacing-4);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

/* Animation for checkbox items */
.modal .checkbox-item {
    animation: slideInLeft 0.3s ease-out;
    animation-fill-mode: both;
}

.modal .checkbox-item:nth-child(1) { animation-delay: 0.1s; }
.modal .checkbox-item:nth-child(2) { animation-delay: 0.15s; }
.modal .checkbox-item:nth-child(3) { animation-delay: 0.2s; }
.modal .checkbox-item:nth-child(4) { animation-delay: 0.25s; }
.modal .checkbox-item:nth-child(5) { animation-delay: 0.3s; }

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

/* Flatpickr Calendar Styling */
.flatpickr-calendar {
    background: rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: blur(20px) !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.15), 
        0 10px 10px -5px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.flatpickr-calendar .flatpickr-month {
    background: transparent !important;
}

.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.flatpickr-calendar .numInputWrapper {
    background: transparent !important;
}

.flatpickr-calendar .numInputWrapper input {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.flatpickr-calendar .flatpickr-weekdays {
    background: transparent !important;
}

.flatpickr-calendar .flatpickr-weekday {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

.flatpickr-calendar .flatpickr-days {
    background: transparent !important;
}

.flatpickr-calendar .flatpickr-day {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.flatpickr-calendar .flatpickr-day:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: white !important;
}

.flatpickr-calendar .flatpickr-day.selected {
    background: var(--primary-color) !important;
    color: white !important;
}

.flatpickr-calendar .flatpickr-day.today {
    background: var(--accent-color) !important;
    color: white !important;
}

.flatpickr-calendar .flatpickr-day.today:hover {
    background: var(--accent-color) !important;
    color: white !important;
}

.flatpickr-calendar .flatpickr-prev-month,
.flatpickr-calendar .flatpickr-next-month {
    color: rgba(255, 255, 255, 0.7) !important;
}

.flatpickr-calendar .flatpickr-prev-month:hover,
.flatpickr-calendar .flatpickr-next-month:hover {
    color: rgba(59, 130, 246, 0.9) !important;
}

/* Enhanced styling for project type chart */
#project-type-chart {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Beautiful chart card specific enhancements */
.chart-card-enhanced {
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(31, 41, 55, 0.98) 100%);
    border: none;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.chart-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at 30% 20%, 
        rgba(59, 130, 246, 0.1) 0%, 
        rgba(16, 185, 129, 0.05) 50%, 
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.chart-card-enhanced:hover::before {
    opacity: 1;
}

.chart-card-enhanced .chart-header,
.chart-card-enhanced .chart-container {
    position: relative;
    z-index: 1;
}

.chart-card-enhanced .chart-header {
    background: rgba(31, 41, 55, 0.6);
    margin: calc(var(--spacing-6) * -1) calc(var(--spacing-6) * -1) var(--spacing-4);
    padding: var(--spacing-5) var(--spacing-6);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.chart-card-enhanced .chart-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: white;
    margin-bottom: 0;
}

.chart-card-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 24px 60px rgba(0, 0, 0, 0.2),
        0 12px 32px rgba(0, 0, 0, 0.15),
        0 6px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.chart-container-enhanced {
    padding: var(--spacing-4);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Beautiful portfolio exposure chart enhancements - matching project type design */
.chart-card-enhanced-portfolio {
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(31, 41, 55, 0.98) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    margin-top: -1rem;
}

.chart-card-enhanced-portfolio::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at 30% 20%, 
        rgba(16, 185, 129, 0.1) 0%, 
        rgba(6, 182, 212, 0.05) 50%, 
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.chart-card-enhanced-portfolio:hover::before {
    opacity: 1.5;
}

.chart-card-enhanced-portfolio .chart-header,
.chart-card-enhanced-portfolio .chart-container {
    position: relative;
    z-index: 2;
}

.chart-card-enhanced-portfolio .chart-header {
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%
    );
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px 16px 0 0;
    margin: calc(var(--spacing-6) * -1) calc(var(--spacing-6) * -1) var(--spacing-4);
    padding: var(--spacing-6) var(--spacing-6) var(--spacing-8);
}

.chart-card-enhanced-portfolio .chart-header h3 {
    color: #FFFFFF;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chart-card-enhanced-portfolio:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 24px 60px rgba(0, 0, 0, 0.2),
        0 12px 32px rgba(0, 0, 0, 0.15),
        0 6px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.chart-card-enhanced-portfolio canvas {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

/* Enhanced Chart Card Styling for Time Series */
.chart-card-enhanced-time {
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(31, 41, 55, 0.98) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.chart-card-enhanced-time::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at 30% 20%, 
        rgba(59, 130, 246, 0.1) 0%, 
        rgba(16, 185, 129, 0.05) 50%, 
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.chart-card-enhanced-time:hover::before {
    opacity: 1.5;
}

.chart-card-enhanced-time .chart-header,
.chart-card-enhanced-time .chart-container {
    position: relative;
    z-index: 2;
}

.chart-card-enhanced-time .chart-header {
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    margin: calc(var(--spacing-6) * -1) calc(var(--spacing-6) * -1) var(--spacing-4);
    padding: var(--spacing-5) var(--spacing-6);
}

.chart-card-enhanced-time .chart-header h3 {
    color: #FFFFFF;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chart-card-enhanced-time:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 24px 60px rgba(0, 0, 0, 0.2),
        0 12px 32px rgba(0, 0, 0, 0.15),
        0 6px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.chart-card-enhanced-time canvas {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.chart-card-enhanced-time .chart-container {
    overflow: visible !important;
    margin-bottom: -30px;
}

/* Apply same overflow fix to all enhanced chart containers */
.chart-card-enhanced .chart-container,
.chart-card-enhanced-portfolio .chart-container {
    overflow: visible !important;
    padding: 20px;
    margin: -20px;
    height: 400px;
    border-radius: 0 0 16px 16px;
}

.chart-card-enhanced-time .chart-container {
    height: 400px;
    overflow: visible !important;
    margin-bottom: -30px;
    padding-bottom: 30px;
    border-radius: 0 0 16px 16px;
}

/* Also ensure regular chart containers have proper border radius */
.chart-container {
    overflow: visible !important;
    position: relative;
    border-radius: 0 0 20px 20px;
}

.chart-container-enhanced {
    padding: var(--spacing-4);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Ensure all chart containers allow tooltips to overflow */
.chart-card,
.chart-card-enhanced,
.chart-card-enhanced-time,
.chart-card-enhanced-portfolio {
    position: relative;
    overflow: visible !important;
}

/* Ensure chart headers also allow tooltip overflow */
.chart-header {
    position: relative;
    overflow: visible !important;
}

/* Ensure chart containers have enough space for tooltips */
.chart-container {
    overflow: visible !important;
    position: relative;
}

/* Ensure Chart.js tooltips appear above everything */
.chartjs-tooltip {
    z-index: 9999 !important;
} 

/* Ensure tooltips within stat-cards create a new stacking context above all cards */
.stat-card .info-tooltip {
    position: relative;
    z-index: 50; /* Lower than header (100) but higher than content */
}

.stat-card .tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    z-index: 60; /* Lower than header (100) but higher than content */
}

/* Ensure table tooltips appear above everything */
.table-header .info-tooltip {
    position: relative;
    z-index: 50; /* Lower than header (100) but higher than content */
}

.table-header .tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    z-index: 60; /* Lower than header (100) but higher than content */
    margin-bottom: 5px;
}

/* Also ensure table-card allows tooltip overflow */
.table-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: none;
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    overflow: visible;
    transition: all var(--transition-normal);
    padding: 0;
    position: relative;
    z-index: 1;
}

/* Timeline Section */
.timeline-section {
    padding: var(--spacing-8) 0;
}

.timeline-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: none;
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    overflow: hidden;
    transition: all var(--transition-normal);
    padding: var(--spacing-6);
    position: relative;
}

.timeline-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 24px 60px rgba(0, 0, 0, 0.2),
        0 12px 32px rgba(0, 0, 0, 0.15),
        0 6px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.timeline-container {
    position: relative;
    padding: var(--spacing-4) 0;
    min-height: 120px;
}

/* Paged Timeline */
.timeline-paged {
    width: 100%;
    position: relative;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-4);
    padding: 0 var(--spacing-2);
    gap: var(--spacing-3);
}

.timeline-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    backdrop-filter: blur(10px);
}

.timeline-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.timeline-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Timeline Navigation Controls */
.timeline-nav-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-2);
}

.timeline-nav-buttons {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

/* Timeline Filter Button (now part of nav buttons) */
.timeline-filter-btn {
    margin-left: var(--spacing-2);
    font-size: var(--font-size-sm);
    padding: var(--spacing-2) var(--spacing-3);
    height: 40px;
}

/* Timeline Page Counter */
.timeline-page-counter {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    min-width: 60px;
}

/* Timeline Zoom Controls */
.timeline-zoom-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-2);
}

.timeline-zoom-buttons {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.timeline-page-info {
    text-align: center;
    flex: 1;
    margin: 0 var(--spacing-4);
}

.timeline-period-label {
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--spacing-1);
}

.timeline-page-counter {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    font-weight: 500;
}

.timeline-zoom-info {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    text-align: center;
}



.timeline-track {
    position: relative;
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-4);
}

.timeline-line-horizontal {
    position: absolute;
    left: var(--spacing-4);
    right: var(--spacing-4);
    top: 50%;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(59, 130, 246, 0.8) 0%, 
        rgba(16, 185, 129, 0.7) 50%, 
        rgba(59, 130, 246, 0.8) 100%);
    transform: translateY(-50%);
    z-index: 1;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.timeline-events-horizontal {
    position: relative;
    width: calc(100% - var(--spacing-8));
    height: 100%;
    margin: 0 var(--spacing-4);
}

/* Timeline Month Labels */
.timeline-month-labels {
    position: absolute;
    left: var(--spacing-4);
    right: var(--spacing-4);
    bottom: 10px;
    height: 20px;
    z-index: 5;
}

.timeline-month-label {
    position: absolute;
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    text-align: center;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Horizontal Timeline Events */
.timeline-event-horizontal {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    cursor: pointer;
    transition: all var(--transition-fast);
}

/* Clustered events styling */
.timeline-event-horizontal.clustered-event {
    transform: translateY(-50%) scale(0.95);
}

.timeline-event-horizontal.clustered-event:hover {
    transform: translateY(-50%) scale(1.1);
}

.event-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 0 0 3px rgba(255, 255, 255, 0.1);
    transition: all var(--transition-fast);
    position: relative;
}

.timeline-event-horizontal:hover .event-marker {
    transform: scale(1.3);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.4),
        0 0 0 5px rgba(255, 255, 255, 0.2);
}

/* Event Marker Colors for Different Transaction Types */
.event-marker.investice {
    background: linear-gradient(135deg, #059669, #10b981);
}

.event-marker.autoinvestice {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.event-marker.odstoupeni {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.event-marker.prodej {
    background: linear-gradient(135deg, #ea580c, #f97316);
}

.event-marker.vklad-penez {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

.event-marker.vyber-penez {
    background: linear-gradient(135deg, #be123c, #e11d48);
}

/* Vrácení peněz uses the same color as Výběr peněz since they both represent money leaving */

/* Horizontal Timeline Tooltip */
.timeline-tooltip-horizontal {
    position: fixed;
    background: rgba(31, 41, 55, 0.98);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: var(--spacing-3);
    color: white;
    font-size: var(--font-size-sm);
    min-width: 200px;
    max-width: 300px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.4),
        0 8px 20px rgba(0, 0, 0, 0.3);
}

.timeline-tooltip-horizontal .tooltip-header {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--spacing-2);
    padding-bottom: var(--spacing-1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-tooltip-horizontal .tooltip-row {
    margin-bottom: var(--spacing-1);
    line-height: 1.4;
}

.timeline-tooltip-horizontal .tooltip-row:last-child {
    margin-bottom: 0;
}

.timeline-tooltip-horizontal .tooltip-row strong {
    color: rgba(255, 255, 255, 0.8);
    margin-right: var(--spacing-1);
}

.timeline-tooltip-horizontal::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(31, 41, 55, 0.98);
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
}

.timeline-tooltip-horizontal.tooltip-below::after {
    border-top: none;
    border-bottom: 8px solid rgba(31, 41, 55, 0.98);
    top: -8px;
    bottom: auto;
}

/* Empty Timeline State */
.timeline-empty {
    text-align: center;
    padding: var(--spacing-12) var(--spacing-6);
    color: rgba(255, 255, 255, 0.7);
}

.timeline-empty-icon {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: var(--spacing-4);
}

.timeline-empty-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--spacing-2);
}

.timeline-empty-message {
    font-size: var(--font-size-base);
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design for Horizontal Timeline */
@media (max-width: 768px) {
    .timeline-horizontal {
        height: 100px;
    }
    
    .timeline-track {
        padding: 0 var(--spacing-3);
    }
    
    .timeline-line-horizontal {
        left: var(--spacing-3);
        right: var(--spacing-3);
    }
    
    .timeline-events-horizontal {
        width: calc(100% - var(--spacing-6));
        margin: 0 var(--spacing-3);
    }
    
    .event-marker {
        width: 14px;
        height: 14px;
        font-size: 9px;
    }
    
    .timeline-tooltip-horizontal {
        min-width: 180px;
        max-width: 250px;
        font-size: var(--font-size-xs);
    }
    
    /* Mobile timeline header restructure */
    .timeline-header {
        flex-direction: column;
        gap: var(--spacing-3);
        align-items: stretch;
    }
    
    /* First row: Navigation buttons */
    .timeline-mobile-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    /* Left side: nav arrows + filter */
    .timeline-nav-controls {
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-2);
    }
    
    /* Right side: zoom controls */
    .timeline-zoom-controls {
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-2);
    }
    
    /* Make all buttons same size */
    .timeline-nav-btn {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-sm);
    }
    
    .timeline-filter-btn {
        font-size: var(--font-size-xs);
        padding: var(--spacing-2) var(--spacing-3);
        height: 40px;
        margin-left: 0;
        min-width: auto;
    }
    
    /* Second row: Date info centered */
    .timeline-page-info {
        text-align: center;
        margin: 0;
        order: 2;
    }
    
    /* Hide page counter from nav controls on mobile */
    .timeline-nav-controls .timeline-page-counter {
        display: none;
    }
    
    /* Hide zoom info on mobile */
    .timeline-zoom-info {
        display: none;
    }
    
    .chart-card-enhanced-portfolio {
        margin-top: -0.5rem;
    }
    
    .chart-card-enhanced-portfolio .chart-header {
        padding: var(--spacing-5) var(--spacing-6) var(--spacing-6);
    }
}

@media (max-width: 480px) {
    .timeline-card {
        padding: var(--spacing-4);
    }
    
    .timeline-horizontal {
        height: 80px;
    }
    
    .timeline-track {
        padding: 0 var(--spacing-2);
    }
    
    .timeline-line-horizontal {
        left: var(--spacing-2);
        right: var(--spacing-2);
    }
    
    .timeline-events-horizontal {
        width: calc(100% - var(--spacing-4));
        margin: 0 var(--spacing-2);
    }
    
    .event-marker {
        width: 12px;
        height: 12px;
        font-size: 8px;
    }
    
    .timeline-tooltip-horizontal {
        min-width: 160px;
        max-width: 200px;
    }
}

/* Transaction tooltip styling */
.transaction-tooltip {
    cursor: help;
    position: relative;
    transition: opacity 0.2s ease;
}

.transaction-tooltip:hover {
    opacity: 0.8;
}

/* Breakdown Section */
.breakdown-section {
    padding: var(--spacing-8) 0;
    background: var(--bg-secondary);
}

/* Remove container padding for breakdown section to achieve full width */
.breakdown-section .container {
    padding: 0;
    max-width: none;
}

/* Override stats-grid for breakdown section to create asymmetric layout with equal heights */
.breakdown-section .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    gap: var(--spacing-6);
    align-items: stretch;
}

/* Breakdown Card Styling */
.breakdown-card .stat-content {
    position: relative;
    width: 100%;
}

.breakdown-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: var(--spacing-4);
    position: relative;
    gap: var(--spacing-3);
}

.breakdown-header-left {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}



.breakdown-header .stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: white;
    margin-bottom: 0;
    line-height: 1.1;
}

.breakdown-title {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: #9ca3af;
    text-align: right;
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
}

.breakdown-list {
    margin-top: var(--spacing-5);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-5);
    width: 100%;
}

.breakdown-row {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
}

.breakdown-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-2);
}

.breakdown-row-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--gray-700);
    flex-shrink: 0;
}

.breakdown-row-value {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    flex-direction: row-reverse;
}

.breakdown-percentage {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    min-width: 35px;
    text-align: right;
}

.breakdown-progress-wrapper {
    position: relative;
    width: 100%;
    margin-top: var(--spacing-1);
}

.breakdown-progress-track {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.breakdown-progress-fill {
    height: 100%;
    border-radius: var(--radius);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}



.breakdown-progress-fill.early-sale {
    background: linear-gradient(90deg, 
        rgba(59, 130, 246, 0.8) 0%, 
        rgba(16, 185, 129, 0.7) 50%, 
        rgba(59, 130, 246, 0.8) 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.breakdown-progress-fill.withdrawal {
    background: linear-gradient(90deg, 
        rgba(16, 185, 129, 0.8) 0%, 
        rgba(59, 130, 246, 0.7) 50%, 
        rgba(16, 185, 129, 0.8) 100%);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Net Profit Breakdown Progress Colors */
.breakdown-progress-fill.profit-returns {
    background: linear-gradient(90deg, 
        rgba(34, 197, 94, 0.8) 0%, 
        rgba(16, 185, 129, 0.7) 50%, 
        rgba(34, 197, 94, 0.8) 100%);
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
}

.breakdown-progress-fill.profit-bonus {
    background: linear-gradient(90deg, 
        rgba(59, 130, 246, 0.8) 0%, 
        rgba(34, 197, 94, 0.7) 50%, 
        rgba(59, 130, 246, 0.8) 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.breakdown-progress-fill.profit-penalty {
    background: linear-gradient(90deg, 
        rgba(168, 85, 247, 0.8) 0%, 
        rgba(139, 92, 246, 0.7) 50%, 
        rgba(168, 85, 247, 0.8) 100%);
    box-shadow: 0 2px 4px rgba(168, 85, 247, 0.3);
}

.breakdown-progress-fill.profit-interest {
    background: linear-gradient(90deg, 
        rgba(251, 191, 36, 0.8) 0%, 
        rgba(245, 158, 11, 0.7) 50%, 
        rgba(251, 191, 36, 0.8) 100%);
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
}

.breakdown-progress-fill.profit-fees {
    background: linear-gradient(90deg, 
        rgba(239, 68, 68, 0.8) 0%, 
        rgba(220, 38, 38, 0.7) 50%, 
        rgba(239, 68, 68, 0.8) 100%);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Marketing Rewards Progress Colors */
.breakdown-progress-fill.marketing-extraordinary {
    background: linear-gradient(90deg, 
        rgba(236, 72, 153, 0.8) 0%, 
        rgba(219, 39, 119, 0.7) 50%, 
        rgba(236, 72, 153, 0.8) 100%);
    box-shadow: 0 2px 4px rgba(236, 72, 153, 0.3);
}

.breakdown-progress-fill.marketing-reward {
    background: linear-gradient(90deg, 
        rgba(168, 85, 247, 0.8) 0%, 
        rgba(236, 72, 153, 0.7) 50%, 
        rgba(168, 85, 247, 0.8) 100%);
    box-shadow: 0 2px 4px rgba(168, 85, 247, 0.3);
}

/* Hover effects */
.breakdown-row:hover .breakdown-progress-fill {
    transform: scaleY(1.1);
    transition: all 0.3s ease;
}

/* Enhanced info tooltips for breakdown */
.breakdown-card .info-tooltip .info-icon {
    font-size: 11px;
    opacity: 0.7;
}

.breakdown-card .info-tooltip:hover .info-icon {
    opacity: 1;
    color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Stack breakdown cards vertically on mobile */
    .breakdown-section .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-4);
    }
    
    .breakdown-section .breakdown-row-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-1);
    }
    
    /* Keep all breakdown components as row layout for proper spacing */
    .current-month-breakdown .breakdown-row-header,
    .breakdown-card .breakdown-row-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .breakdown-row-value {
        align-self: flex-end;
    }
    
    .breakdown-list {
        gap: var(--spacing-3);
    }
}

@media (max-width: 480px) {
    .breakdown-row-label {
        font-size: var(--font-size-xs);
    }
    
    .breakdown-row-value {
        font-size: var(--font-size-xs);
        gap: var(--spacing-1);
    }
    
    .breakdown-percentage {
        font-size: 10px;
        padding: 2px var(--spacing-1);
        min-width: 30px;
    }
    
    .breakdown-progress-track {
        height: 6px;
    }
}

/* Welcome Message Styling */
.welcome-section {
    padding: var(--spacing-10) 0 var(--spacing-2) 0;
}

.welcome-message {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: none;
    padding: var(--spacing-6) var(--spacing-8);
    margin-bottom: var(--spacing-6);
    text-align: center;
    animation: welcomeFadeIn 0.8s ease-out;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.welcome-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.05) 0%, 
        rgba(16, 185, 129, 0.05) 50%, 
        rgba(236, 72, 153, 0.05) 100%);
    border-radius: 20px;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.welcome-message:hover {
    transform: translateY(-2px) !important;
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.welcome-message:hover::before {
    opacity: 1;
}

.welcome-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-4);
    position: relative;
    z-index: 1;
}

.welcome-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: welcomeBounce 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(34, 197, 94, 0.3));
}

.welcome-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    letter-spacing: 0.025em;
    line-height: 1.4;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

@keyframes welcomeBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) scale(1);
    }
    40% {
        transform: translateY(-3px) scale(1.1);
    }
    60% {
        transform: translateY(-1px) scale(1.05);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .welcome-section {
        padding: calc(100px + var(--spacing-6)) 0 var(--spacing-2) 0; /* Header clearance + normal section spacing */
    }
    
    .welcome-message {
        padding: var(--spacing-5) var(--spacing-6);
        margin-bottom: var(--spacing-4);
        border-radius: 16px;
    }
    
    .welcome-content {
        flex-direction: column;
        gap: var(--spacing-3);
    }
    
    .welcome-icon {
        font-size: 1.75rem;
    }
    
    .welcome-text {
        font-size: 1.125rem;
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    .welcome-section {
        padding: calc(70px + var(--spacing-4)) 0 var(--spacing-2) 0;
    }
    
    .welcome-message {
        padding: var(--spacing-4) var(--spacing-5);
        margin-bottom: var(--spacing-3);
        border-radius: 14px;
    }
    
    .welcome-content {
        gap: var(--spacing-2);
    }
    
    .welcome-icon {
        font-size: 1.5rem;
    }
    
    .welcome-text {
        font-size: 1rem;
        text-align: center;
    }
}

/* Clickable Breakdown Rows */
.breakdown-row-clickable {
    cursor: pointer;
    transition: var(--transition-fast);
}

.breakdown-row-clickable:hover {
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: var(--radius);
}

.breakdown-row-icon {
    margin-left: var(--spacing-2);
    color: var(--gray-400);
    font-size: 0.75rem;
    transition: var(--transition-fast);
}

.breakdown-row-clickable:hover .breakdown-row-icon {
    color: var(--primary-color);
    transform: translateX(2px);
}

/* Current Month Breakdown Customizations */
/* Hide progress bars and percentages for current month component */
.current-month-breakdown .breakdown-progress-wrapper {
    display: none;
}

.current-month-breakdown .breakdown-percentage {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Current Month Component - Full Width with Header */
.current-month-breakdown {
    grid-column: 1 / -1; /* Span full width */
    width: 100%;
}

/* Keep the header like other stat cards */
.current-month-breakdown .breakdown-header {
    /* Use default header styling */
}

.current-month-breakdown .stat-content {
    /* Use default stat content styling */
}

/* Force horizontal layout - single row */
.current-month-breakdown .breakdown-list {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: var(--spacing-3);
    flex-wrap: nowrap !important;
    justify-content: space-between;
    margin-top: var(--spacing-4);
    padding: 0 var(--spacing-2);
    width: 100%;
}

/* Force inline horizontal items */
.current-month-breakdown .breakdown-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    gap: var(--spacing-1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: var(--spacing-3) var(--spacing-3);
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex: 1;
    justify-content: center;
    text-align: center;
    min-width: 0;
    position: relative; /* For absolute positioning of icon */
}

.current-month-breakdown .breakdown-row-header {
    display: flex !important;
    align-items: center;
    gap: var(--spacing-2);
    width: 100%;
    justify-content: center;
    flex-direction: column !important;
}

.current-month-breakdown .breakdown-row-label {
    font-size: var(--font-size-sm); /* Same as "Celkový čistý výnos investic" */
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    order: 2; /* Move label below value */
}

.current-month-breakdown .breakdown-row-value {
    display: block;
    text-align: center;
    order: 1; /* Move value above label */
    width: 100%;
    position: relative;
}

.current-month-breakdown .breakdown-row-value span:not(.breakdown-row-icon) {
    font-size: var(--font-size-xl); /* Bigger font for amounts */
    font-weight: 700; /* Make it bolder */
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    width: 100%;
    display: block;
    margin-bottom: -4px;
}

.current-month-breakdown .breakdown-row-icon {
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    cursor: pointer;
    position: absolute !important;
    top: var(--spacing-2) !important;
    right: var(--spacing-2) !important;
    transform: none !important;
    z-index: 1;
}

/* Subtle hover effects for inline items */
.current-month-breakdown .breakdown-row-clickable:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: none; /* Prevent any transform that could shift elements */
}

.current-month-breakdown .breakdown-row-clickable:hover .breakdown-row-icon {
    color: rgba(255, 255, 255, 0.8);
}


/* Info tooltip styling for current month */
.current-month-breakdown .info-tooltip .info-icon {
    font-size: 11px; /* Same as "Celkový čistý výnos investic" */
    opacity: 0.7; /* Same as reference component */
}

.current-month-breakdown .info-tooltip:hover .info-icon {
    opacity: 1;
    color: var(--primary-color); /* Same as reference component */
}

/* Responsive adjustments - Stack vertically on mobile */
@media (max-width: 768px) {
    .current-month-breakdown .breakdown-list {
        display: flex !important;
        flex-direction: column !important;
        gap: var(--spacing-3);
        align-items: stretch;
        justify-content: flex-start;
    }
    
    .current-month-breakdown .breakdown-row {
        padding: var(--spacing-3) var(--spacing-4);
        gap: var(--spacing-2);
        flex-direction: column;
        text-align: center;
        width: 100%;
        flex: none;
    }
    
    .current-month-breakdown .breakdown-row-header {
        flex-direction: column;
    }
    
    .current-month-breakdown .breakdown-row-label {
        font-size: var(--font-size-sm); /* Keep same size as desktop for consistency */
        order: 2; /* Keep label below value on mobile */
    }
    
    .current-month-breakdown .breakdown-row-value {
        order: 1; /* Keep value above label on mobile */
        display: block;
        text-align: center;
        width: 100%;
    }
    
    .current-month-breakdown .breakdown-row-value span:not(.breakdown-row-icon) {
        font-size: var(--font-size-xl); /* Bigger font for better mobile readability */
        font-weight: 700;
    }
    
    .current-month-breakdown .breakdown-progress-wrapper {
        margin-top: var(--spacing-2); /* Match the gap in breakdown-row-header */
    }
}

/* Additional mobile adjustments for very small screens */
@media (max-width: 480px) {
    .current-month-breakdown .breakdown-row {
        padding: var(--spacing-2) var(--spacing-3);
        gap: var(--spacing-1);
    }
    
    .current-month-breakdown .breakdown-row-value span:not(.breakdown-row-icon) {
        font-size: var(--font-size-lg);
    }
    
    .current-month-breakdown .breakdown-row-label {
        font-size: var(--font-size-xs);
    }
    
    .current-month-breakdown .breakdown-progress-wrapper {
        margin-top: var(--spacing-1); /* Match the gap in breakdown-row for small screens */
    }
}

/* Current Month Progress Fill Colors (hidden but keeping for consistency) */
.breakdown-progress-fill.current-month-returns {
    background: linear-gradient(90deg, 
        rgba(16, 185, 129, 0.8) 0%,
        rgba(16, 185, 129, 1) 100%
    );
}

.breakdown-progress-fill.current-month-bonus {
    background: linear-gradient(90deg, 
        rgba(245, 158, 11, 0.8) 0%,
        rgba(245, 158, 11, 1) 100%
    );
}

.breakdown-progress-fill.current-month-penalty {
    background: linear-gradient(90deg, 
        rgba(59, 130, 246, 0.8) 0%,
        rgba(59, 130, 246, 1) 100%
    );
}

.breakdown-progress-fill.current-month-interest {
    background: linear-gradient(90deg, 
        rgba(168, 85, 247, 0.8) 0%,
        rgba(168, 85, 247, 1) 100%
    );
}

/* Transaction Details Modal - Consistent with component styling */
.modal-container {
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(25px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.4),
        0 10px 25px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.03) 0%, 
        rgba(16, 185, 129, 0.02) 50%, 
        rgba(236, 72, 153, 0.03) 100%);
    border-radius: 24px;
    pointer-events: none;
    z-index: 0;
}

.modal-container > * {
    position: relative;
    z-index: 1;
}

.transaction-details-summary {
    padding: var(--spacing-6);
    background: rgba(37, 99, 235, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px 24px 0 0;
    display: none; /* Hidden since we moved content to header */
}

.transaction-details-summary p {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.modal-subtitle {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    margin-top: var(--spacing-1);
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.modal-subtitle::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    flex-shrink: 0;
}

#transaction-details-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.modal-container .modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.modal-container .modal-content .table-container {
    margin: 0;
    border-radius: 0 0 24px 24px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

#transaction-details-table {
    font-size: var(--font-size-sm);
    background: transparent;
    border-radius: 0;
}

#transaction-details-table th {
    background: rgba(55, 65, 81, 0.8);
    backdrop-filter: blur(10px);
    padding: var(--spacing-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: var(--font-size-xs);
}

#transaction-details-table td {
    padding: var(--spacing-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
    background: rgba(31, 41, 55, 0.3);
}

#transaction-details-table tr:hover td {
    background: rgba(37, 99, 235, 0.1);
    color: white;
}

#transaction-details-table tbody tr:last-child td {
    border-bottom: none;
}

.modal-amount-bold {
    font-weight: 700 !important;
    text-align: right;
}

#transaction-details-table th:last-child {
    text-align: right;
}

#transaction-details-table th:first-child,
#transaction-details-table td:first-child {
    padding-left: var(--spacing-6);
}

#transaction-details-table th:last-child,
#transaction-details-table td:last-child {
    padding-right: var(--spacing-6);
}

@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-height: 85vh;
    }
    
 /*    .current-month-breakdown .breakdown-row-clickable:hover .breakdown-row-header {
        transform: none;
    } */
    
    .current-month-breakdown .breakdown-row-clickable:hover .breakdown-row-icon {
        color: rgba(255, 255, 255, 0.8);
    }
}

/* Portfolio Overview Section */
.portfolio-overview-section {
    margin-bottom: var(--spacing-8);
}

.portfolio-overview-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-6);
    align-items: stretch;
}

.chart-container-overview {
}

.chart-container-overview .chart-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chart-container-overview .chart-header {
    padding-top: var(--spacing-3);
    padding-bottom: var(--spacing-1);
}

.chart-container-overview .chart-container {
    flex: 1;
    height: 280px;
    padding-top: 0;
    display: flex;
    align-items: center;
}

.stats-container-overview {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    height: 100%;
    align-self: stretch;
}

/* Responsive breakpoints for portfolio overview */
@media (max-width: 1024px) {
    .portfolio-overview-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-4);
    }
    
    .chart-container-overview .chart-container {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .stats-container-overview {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-3);
    }
    
    .chart-container-overview .chart-card {
        height: 400px;
    }
}

/* Net Profit Overview Section */
.net-profit-overview-section {
    margin-bottom: var(--spacing-8);
}

.net-profit-overview-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-6);
    align-items: stretch;
}

.stats-container-net-profit {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    height: 100%;
    align-self: stretch;
}

.breakdown-container-overview {
    height: 100%;
}

.breakdown-container-overview .breakdown-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.breakdown-container-overview .stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.breakdown-container-overview .breakdown-list {
    flex: 1;
}

/* Responsive breakpoints for net profit overview */
@media (max-width: 1024px) {
    .net-profit-overview-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-4);
    }
}

@media (max-width: 768px) {
    .stats-container-net-profit {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-3);
    }
}

/* Monthly Performance Section */
.monthly-performance-section {
    margin-bottom: var(--spacing-8);
}

.monthly-performance-section .section-title {
    margin-bottom: var(--spacing-6);
}

/* About Project Modal */
.about-modal {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 24px;
}

.about-author-section {
    text-align: center;
    padding: var(--spacing-8) var(--spacing-6) var(--spacing-6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: var(--spacing-6);
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.author-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-6);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    text-align: center;
    max-width: 350px;
    margin: 0 auto;
}

/* Specific spacing between author rows */
.author-row:nth-child(1) {
    margin-bottom: 0.125rem; /* Very tight space between name and position */
}

.author-row:nth-child(2) {
    margin-bottom: var(--spacing-4); /* Bigger space between position and email */
}

.author-row:nth-child(3) {
    margin-bottom: 0.125rem; /* Very tight space between email and LinkedIn */
}

.author-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-3);
    transition: all 0.3s ease;
}

.author-row:hover {
    transform: translateY(-1px);
}

.author-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.author-icon.fa-user {
    color: #3B82F6;
}

.author-icon.fa-briefcase {
    color: #10B981;
}

.author-icon.fa-envelope {
    color: #F59E0B;
}

.author-icon.fa-linkedin {
    color: #0077B5;
}

.author-value {
    color: var(--text-primary);
    font-weight: 400;
}

.author-value.name {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.author-email {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
}

.author-email:hover {
    color: #60A5FA;
    text-decoration: underline;
}

.author-linkedin {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
}

.author-linkedin:hover {
    color: #60A5FA;
    text-decoration: underline;
}

/* About Sections */
.about-section {
    margin-bottom: var(--spacing-6);
    padding: 0 var(--spacing-6);
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.about-section:last-child {
    margin-bottom: 0;
    padding-bottom: var(--spacing-6);
}

.about-section h4 {
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-4);
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.about-section h4 i.fa-info-circle {
    color: #3B82F6;
    font-size: var(--font-size-base);
}

.about-section h4 i.fa-list-alt {
    color: #10B981;
    font-size: var(--font-size-base);
}

.about-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-3);
}

.about-section p:last-child {
    margin-bottom: 0;
}

.changelog-table {
    margin-top: var(--spacing-3);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.changelog-table .data-table {
    margin-bottom: 0;
}

.changelog-table td {
    vertical-align: top;
    font-size: var(--font-size-base);
}

.changelog-table ul {
    margin: 0;
    padding-left: var(--spacing-4);
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

.changelog-table li {
    margin-bottom: var(--spacing-1);
    font-size: var(--font-size-base);
}

.changelog-table li:last-child {
    margin-bottom: 0;
}

/* Remove hover effect from changelog table headers */
.changelog-table .data-table th:hover {
    background: transparent;
    color: var(--text-primary);
}

/* Table layout and scrolling */
.changelog-table .data-table {
    width: 100%;
    table-layout: fixed;
    box-sizing: border-box;
    border-collapse: collapse;
}

.changelog-table .data-table th {
    font-size: var(--font-size-base);
}

/* Column widths */
.changelog-table .data-table th:first-child,
.changelog-table .data-table td:first-child {
    width: 140px; /* First column width */
    max-width: 140px;
    box-sizing: border-box;
}

.changelog-table .data-table th:last-child,
.changelog-table .data-table td:last-child {
    width: calc(100% - 140px);
    max-width: calc(100% - 140px);
    box-sizing: border-box;
}

/* Mobile: No horizontal scrolling, content wraps */
@media (max-width: 768px) {
    .changelog-table {
        width: 100%;
        max-width: 100%;
        overflow: hidden; /* Prevent any overflow */
        box-sizing: border-box;
    }
    
    .changelog-table .data-table {
        width: 100%;
        max-width: 100%;
        table-layout: fixed;
        box-sizing: border-box;
    }
    
    .changelog-table .data-table th,
    .changelog-table .data-table td {
        word-wrap: break-word;
        white-space: normal;
        vertical-align: top;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    /* Ensure content wraps instead of scrolling */
    .changelog-table .data-table td ul {
        white-space: normal;
        word-wrap: break-word;
        max-width: 100%;
        box-sizing: border-box;
    }
}




/* Mobile tooltip support - add active state for touch devices */
.info-tooltip.active .tooltip-content,
.info-tooltip:active .tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* Mobile-specific tooltip adjustments */
@media (max-width: 768px) {
    .tooltip-content {
        /* Make tooltips slightly larger and more touch-friendly on mobile */
        font-size: var(--font-size-sm);
        padding: var(--spacing-4);
        max-width: 90vw;
        min-width: 250px;
        /* Ensure tooltips don't go off screen on mobile */
        box-sizing: border-box;
    }
    
    /* Smart positioning to prevent off-screen tooltips */
    .info-tooltip {
        position: relative;
    }
    
    /* For tooltips that would go off left edge - align to left */
    .tooltip-content.tooltip-left {
        left: 0;
        transform: translateY(-5px);
    }
    
    .tooltip-content.tooltip-left::after {
        left: 20px;
        margin-left: 0;
    }
    
    /* For tooltips that would go off right edge - align to right */
    .tooltip-content.tooltip-right {
        right: 0;
        left: auto;
        transform: translateY(-5px);
    }
    
    .tooltip-content.tooltip-right::after {
        right: 20px;
        left: auto;
        margin-left: 0;
    }
    
    /* For tooltips that can be safely centered */
    .tooltip-content.tooltip-center {
        left: 50%;
        transform: translateX(-50%) translateY(-5px);
    }
    
    .tooltip-content.tooltip-center::after {
        left: 50%;
        margin-left: -5px;
    }
    
    /* Add visual feedback for touch */
    .info-tooltip:active {
        color: var(--primary-color);
        transform: scale(1.1);
        transition: all 0.1s ease;
    }
}


/* Mobile font size consistency fixes - with stronger specificity for iPhone Safari */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 1) {
    /* Force consistent font sizes in modal tables - iPhone Safari specific */
    .modal-overlay #transaction-details-table td,
    .modal-overlay #transaction-details-table td * {
        font-size: var(--font-size-xs) !important;
        line-height: 1.4 !important;
    }
    
    .modal-overlay #transaction-details-table th,
    .modal-overlay #transaction-details-table th * {
        font-size: var(--font-size-xs) !important;
        line-height: 1.4 !important;
    }
    
    /* Force consistent font sizes in changelog */
    .modal-overlay .changelog-table ul,
    .modal-overlay .changelog-table ul *,
    .modal-overlay .changelog-table li,
    .modal-overlay .changelog-table li * {
        font-size: var(--font-size-base) !important;
        line-height: 1.4 !important;
    }
    
    .modal-overlay .changelog-table .data-table td,
    .modal-overlay .changelog-table .data-table td * {
        font-size: var(--font-size-base) !important;
        line-height: 1.4 !important;
    }
    
    .modal-overlay .changelog-table .data-table th,
    .modal-overlay .changelog-table .data-table th * {
        font-size: var(--font-size-base) !important;
        line-height: 1.4 !important;
    }
    
    /* Specifically target project name cells (second column) */
    .modal-overlay #transaction-details-table td:nth-child(2),
    .modal-overlay #transaction-details-table td:nth-child(2) *,
    #transaction-details-table td:nth-child(2),
    #transaction-details-table td:nth-child(2) * {
        font-size: 12px !important;
        line-height: 16px !important;
        -webkit-text-size-adjust: none !important;
        text-size-adjust: none !important;
        max-width: 200px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
}

/* Fallback for all mobile devices */
@media (max-width: 768px) {
    /* Modal table consistency */
    #transaction-details-table td {
        font-size: var(--font-size-xs) !important;
    }
    
    #transaction-details-table th {
        font-size: var(--font-size-xs) !important;
    }
    
    /* Changelog consistency */
    .changelog-table ul,
    .changelog-table li {
        font-size: var(--font-size-base) !important;
    }
    
    .changelog-table .data-table td,
    .changelog-table .data-table th {
        font-size: var(--font-size-base) !important;
    }
}

/* AGGRESSIVE iPhone Safari font size fix - prevent auto-zoom on modal table cells */
@media (max-width: 768px) {
    /* Target modal table cells with maximum specificity and absolute pixel values */
    .modal-overlay #transaction-details-table td,
    .modal-overlay #transaction-details-table td *,
    .modal-overlay table td,
    .modal-overlay table td *,
    #transaction-details-modal td,
    #transaction-details-modal td *,
    #transaction-details-table td,
    #transaction-details-table td *,
    /* CHANGELOG ELEMENTS - aggressive targeting for bullet points */
    .modal-overlay .changelog-table ul,
    .modal-overlay .changelog-table ul *,
    .modal-overlay .changelog-table li,
    .modal-overlay .changelog-table li *,
    #about-project-modal .changelog-table ul,
    #about-project-modal .changelog-table ul *,
    #about-project-modal .changelog-table li,
    #about-project-modal .changelog-table li *,
    .changelog-table ul,
    .changelog-table ul *,
    .changelog-table li,
    .changelog-table li * {
        font-size: 16px !important;
        line-height: 16px !important;
        -webkit-text-size-adjust: none !important;
        text-size-adjust: none !important;
        -webkit-transform: scale(1) !important;
        transform: scale(1) !important;
        zoom: 1 !important;
    }
}
