/* Theme tokens */
:root {
    --bg-page: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    --bg-surface: rgba(255, 255, 255, 0.95);
    --bg-surface-solid: #ffffff;
    --bg-muted: #f8f9fa;
    --bg-inner: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    --text: #2c3e50;
    --text-body: #333333;
    --text-muted: #6c757d;
    --text-on-dark: #ffffff;
    --border: #e9ecef;
    --border-strong: #dee2e6;
    --header-bg: rgba(52, 73, 94, 0.95);
    --sticky-bg: rgba(52, 73, 94, 0.95);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 8px 32px rgba(0, 0, 0, 0.3);
    --primary: #667eea;
    --primary-2: #764ba2;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --theme-color: #667eea;
    --input-bg: #ffffff;
    --hover-row: #f8f9fa;
    --notes-bg: #f8f9fa;
    --transition-theme: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg-page: linear-gradient(135deg, #0f1419 0%, #1a1f2e 50%, #0f1419 100%);
    --bg-surface: rgba(30, 36, 48, 0.96);
    --bg-surface-solid: #1e2430;
    --bg-muted: #252b38;
    --bg-inner: linear-gradient(135deg, #252b38 0%, #1e2430 100%);
    --text: #e8eaed;
    --text-body: #e8eaed;
    --text-muted: #9aa0a6;
    --text-on-dark: #ffffff;
    --border: #3a4254;
    --border-strong: #4a5568;
    --header-bg: rgba(26, 31, 46, 0.96);
    --sticky-bg: rgba(26, 31, 46, 0.96);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --shadow-strong: 0 8px 32px rgba(0, 0, 0, 0.55);
    --primary: #7b8ff0;
    --primary-2: #8b6bb8;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --theme-color: #1a1f2e;
    --input-bg: #252b38;
    --hover-row: #2a3140;
    --notes-bg: #252b38;
    color-scheme: dark;
}

/* Βασικά Στυλ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-page);
    min-height: 100vh;
    color: var(--text-body);
    line-height: 1.6;
    transition: var(--transition-theme);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px 30px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    color: white;
}

/* Category Tabs */
.category-tabs {
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.tabs-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-radius: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #2c3e50;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.category-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.05) 0%, rgba(0, 86, 179, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-tab:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.category-tab:hover::before {
    opacity: 1;
}

.tab-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.tab-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.tab-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #2c3e50;
}

.tab-description {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.4;
}

/* Χρώματα για κάθε κατηγορία */
.category-tab-1 .tab-icon { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); }
.category-tab-1:hover { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); color: white; }

.category-tab-2 .tab-icon { background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); }
.category-tab-2:hover { background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); color: white; }

.category-tab-3 .tab-icon { background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%); }
.category-tab-3:hover { background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%); color: white; }

.category-tab-4 .tab-icon { background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%); }
.category-tab-4:hover { background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%); color: white; }

.category-tab-5 .tab-icon { background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%); }
.category-tab-5:hover { background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%); color: white; }

/* Νέα κατηγορίες με σωστά IDs */
.category-tab-12 .tab-icon { background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%); }
.category-tab-12:hover { background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%); color: white; }

.category-tab-13 .tab-icon { background: linear-gradient(135deg, #dc3545 0%, #c82333 100%); }
.category-tab-13:hover { background: linear-gradient(135deg, #dc3545 0%, #c82333 100%); color: white; }

.category-tab-14 .tab-icon { background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%); }
.category-tab-14:hover { background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%); color: white; }

.category-tab-15 .tab-icon { background: linear-gradient(135deg, #6c757d 0%, #545b62 100%); }
.category-tab-15:hover { background: linear-gradient(135deg, #6c757d 0%, #545b62 100%); color: white; }

.category-tab-16 .tab-icon { background: linear-gradient(135deg, #fd7e14 0%, #e8590c 100%); }
.category-tab-16:hover { background: linear-gradient(135deg, #fd7e14 0%, #e8590c 100%); color: white; }

.category-tab-17 .tab-icon { background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%); }
.category-tab-17:hover { background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%); color: white; }

/* Κουμπιά τύπων ποσού */
.amount-type-section {
    margin: 20px 0;
}

.amount-type-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 20px;
    border: 2px solid #34495e;
    border-radius: 12px;
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    max-height: none;
    overflow: visible;
    width: 100%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.amount-type-btn {
    padding: 15px 20px;
    border: 2px solid #34495e;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: #2c3e50;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    white-space: normal;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
    position: relative;
}

.amount-type-btn:hover {
    border-color: #3498db;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
    color: white;
}

.amount-type-btn.selected {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.5);
}

.amount-type-btn.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Mobile Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.1rem;
}

.navbar-text {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
}

/* Mobile Forms */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0;
    }
    
    .form-container {
        padding: 15px;
    }
    
    .simple-form {
        max-width: none;
    }
    
    .form-control-lg {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 16px;
    }
    
    .btn-lg {
        padding: 12px 24px;
        font-size: 16px;
    }
    
    .amount-type-section {
        margin: 10px 0;
    }
    
    .amount-type-buttons {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
        padding: 15px;
    }
    
    .amount-type-btn {
        padding: 12px 15px;
        font-size: 13px;
        min-height: 50px; /* Touch-friendly */
    }
    
    .category-tabs {
        padding: 10px;
    }
    
    .tabs-container {
        gap: 8px;
    }
    
    .category-tab {
        padding: 15px 10px;
        min-height: 60px;
    }
    
    .tab-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .tab-title {
        font-size: 14px;
        font-weight: 600;
    }
}

@media (max-width: 480px) {
    .amount-type-section {
        margin: 8px 0;
    }
    
    .amount-type-buttons {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 6px;
        padding: 12px;
    }
    
    .amount-type-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-height: 45px;
    }
    
    .category-tab {
        padding: 12px 8px;
        min-height: 50px;
    }
    
    .tab-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .tab-title {
        font-size: 13px;
    }
    
    /* Mobile Tables */
    .table-responsive {
        font-size: 14px;
    }
    
    .table th, .table td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    /* Mobile Charts */
    .chart-container {
        height: 250px !important;
        margin: 10px 0;
    }
    
    /* Mobile Filters */
    .filters {
        padding: 10px;
    }
    
    .filter-form {
        flex-direction: column;
    }
    
    .filter-group {
        margin-bottom: 10px;
    }
    
    .filter-group label {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .filter-group input, .filter-group select {
        font-size: 16px;
        padding: 8px 12px;
    }
}

/* Month Selection */
.month-selection {
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.month-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.month-selection h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.year-toggle-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.year-toggle-btn {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 80px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.year-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
    background: #f8f9fa;
}

.year-toggle-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.year-count {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.year-toggle-btn.active .year-count {
    background: rgba(255, 255, 255, 0.2);
}

.months-container {
    margin-top: 20px;
}

/* Εμφάνιση μηνών του τρέχοντος έτους από την αρχή */
.month-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    transition: all 0.3s ease;
}

/* Year Sections */
.year-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.year-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 15px;
}

.year-header:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.year-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.year-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e9ecef;
    transition: all 0.3s ease;
}

.year-header:hover .year-toggle {
    background: #667eea;
    color: white;
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.year-header h4 {
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.year-total {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    background: #f8f9fa;
    padding: 5px 12px;
    border-radius: 15px;
}

.view-toggle {
    display: flex;
    gap: 10px;
}

.toggle-btn {
    padding: 8px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f8f9fa;
}

.toggle-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.month-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.month-btn {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.month-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
    color: #2c3e50;
    background: #f8f9fa;
}

.month-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.month-btn .month-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.month-btn .month-count {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 500;
}

.month-btn.active .month-count {
    opacity: 0.9;
}

/* Year Buttons */
.year-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.year-btn {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.year-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
    color: #2c3e50;
    background: #f8f9fa;
}

.year-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.year-btn .year-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.year-btn .year-count {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 500;
}

.year-btn.active .year-count {
    opacity: 0.9;
}

/* Category Tab Totals */
.tab-totals {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.tab-amount {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.tab-count {
    font-size: 0.85rem;
    opacity: 0.8;
    font-weight: 500;
}

/* Quick Shortcuts */
.quick-shortcuts {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.quick-shortcuts h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

.shortcut-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.shortcut-buttons .btn {
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 2px solid #e9ecef;
    background: white;
    color: #2c3e50;
    font-weight: 600;
}

.shortcut-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #667eea;
    background: #f8f9fa;
}

.shortcut-buttons .btn .badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
}

/* Responsive shortcuts */
@media (max-width: 768px) {
    .shortcut-buttons {
        flex-direction: column;
    }
    
    .shortcut-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

.header h1 {
    color: white;
    font-size: 2.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header h1 i {
    color: #3498db;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-info .text-muted {
    color: #bdc3c7 !important;
    font-size: 0.95rem;
}

.user-info strong {
    color: white;
    font-weight: 600;
}

.user-info .btn-outline-danger {
    border-color: #e74c3c;
    color: #e74c3c;
    background: transparent;
    transition: all 0.3s ease;
}

.user-info .btn-outline-danger:hover {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-edit {
    background: #28a745;
    color: white;
    padding: 8px 12px;
    font-size: 12px;
}

.btn-edit:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-delete {
    background: #dc3545;
    color: white;
    padding: 8px 12px;
    font-size: 12px;
}

.btn-delete:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Filters */
.filters {
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.filter-group input,
.filter-group select {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Summary */
.summary {
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-item .label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.summary-item .amount {
    font-size: 2rem;
    font-weight: 700;
    color: #28a745;
}

.summary-item .count {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

/* Expenses List */
.expenses-list {
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-data i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #dee2e6;
}

.no-data p {
    font-size: 1.2rem;
    margin-bottom: 25px;
}

/* Table */
.expenses-table {
    overflow-x: auto;
}

.expenses-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface-solid);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.expenses-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.expenses-table td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    background: var(--bg-surface-solid);
    color: var(--text);
}

.expenses-table tr:hover {
    background: var(--hover-row);
}

.expenses-table tr:hover td {
    background: var(--hover-row);
}

.expenses-table tr:last-child td {
    border-bottom: none;
}

.expense-description {
    max-width: 300px;
}

.expense-description .notes {
    display: block;
    color: #6c757d;
    font-size: 12px;
    margin-top: 5px;
    font-style: italic;
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    background: #6c757d;
}

.category-1 { background: #e74c3c; }
.category-2 { background: #f39c12; }
.category-3 { background: #3498db; }
.category-4 { background: #2ecc71; }
.category-5 { background: #9b59b6; }
.category-6 { background: #1abc9c; }
.category-7 { background: #95a5a6; }

.amount-type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text);
    background: var(--bg-muted);
    border: 1px solid var(--border-strong);
}

.amount {
    font-weight: 700;
    color: #28a745;
    text-align: right;
}

.actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* Form Container */
.form-container {
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.expense-form {
    /* max-width: 800px; */
}

/* Simple Form */
.simple-form {
    /* max-width: 400px; */
    margin: 0 auto;
    text-align: center;
}

.simple-form .form-group {
    margin-bottom: 25px;
}

.simple-form .form-group label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.simple-form .form-group input,
.simple-form .form-group select {
    width: 100%;
    padding: 15px 20px;
    border: 3px solid #e9ecef;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
}

.simple-form .form-group input:focus,
.simple-form .form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.simple-form .form-group input[type="number"] {
    font-size: 24px;
    color: #28a745;
}

.simple-form .form-group select {
    font-size: 16px;
    color: #2c3e50;
}

.btn-large {
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 12px;
    margin: 20px 10px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Stats Overview */
.stats-overview {
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.stats-overview h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-month-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    animation: pulse 2s infinite;
}

.current-month-banner i {
    font-size: 1.2rem;
    opacity: 0.9;
}

.month-name {
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.month-indicator {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: auto;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    }
    100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    color: #2c3e50;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 2px solid #e9ecef;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

/* Ensure text colors are properly displayed */
.stat-value.text-success {
    color: #28a745 !important;
}

.stat-value.text-danger {
    color: #dc3545 !important;
}

/* Additional color overrides for better visibility */
.stat-card .stat-value {
    font-weight: 700;
    font-size: 1.8rem;
}

.stat-card .stat-value.text-success {
    color: #28a745 !important;
    text-shadow: 0 1px 2px rgba(40, 167, 69, 0.2);
}

.stat-card .stat-value.text-danger {
    color: #dc3545 !important;
    text-shadow: 0 1px 2px rgba(220, 53, 69, 0.2);
}

.stat-card .stat-value.text-info {
    color: #17a2b8 !important;
    text-shadow: 0 1px 2px rgba(23, 162, 184, 0.2);
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

/* Stats Section */
.stats-section {
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

/* Category Row Hover Effects */
.category-row {
    transition: all 0.3s ease;
}

.category-row:hover {
    background: #f8f9fa !important;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-row.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.category-row.active td {
    color: white !important;
}

.category-row.active .badge {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

.category-row.active .percentage-bar {
    background: rgba(255, 255, 255, 0.3);
}

.category-row.active .percentage-fill {
    background: rgba(255, 255, 255, 0.8);
}

.category-row.active .percentage-text {
    color: white;
    font-weight: 600;
}

/* Month Row Hover Effects */
.month-row {
    transition: all 0.3s ease;
}

.month-row:hover {
    background: #f8f9fa !important;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.month-row.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.month-row.active td {
    color: white !important;
}

/* Category Modal Styling */
.modal-xl {
    max-width: 90vw;
}

.modal-content {
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

.modal-body {
    border-radius: 0 0 15px 15px;
}

.category-details .card {
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.category-details .card:hover {
    transform: translateY(-2px);
}

.notes-content {
    max-width: 200px;
    word-wrap: break-word;
    font-size: 0.9rem;
    color: #6c757d;
}

@media (max-width: 768px) {
    .modal-xl {
        max-width: 95vw;
        margin: 10px;
    }
    
    .category-details .row {
        margin: 0;
    }
    
    .category-details .col-md-6 {
        margin-bottom: 15px;
    }
    
    .notes-content {
        max-width: 150px;
        font-size: 0.8rem;
    }
}

/* Notes Styling */
.notes-cell {
    max-width: 200px;
    word-wrap: break-word;
}

.notes-content {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
    cursor: help;
    padding: 5px;
    border-radius: 4px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.notes-content:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: scale(1.02);
}

/* Modal Table Styling */
.modal .table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border: none;
}

.modal .table td {
    vertical-align: middle;
    border-color: #e9ecef;
}

.modal .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(102, 126, 234, 0.05);
}

.stats-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-table {
    overflow-x: auto;
}

.stats-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface-solid);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.stats-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.stats-table td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface-solid);
    color: var(--text);
}

.stats-table tr:hover {
    background: var(--hover-row);
}

.stats-table tr:hover td {
    background: var(--hover-row);
}

.stats-table tr:last-child td {
    border-bottom: none;
}

/* Percentage Bar */
.percentage-bar {
    position: relative;
    background: #e9ecef;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
}

.percentage-fill {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.percentage-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .filter-form {
        grid-template-columns: 1fr;
    }
    
    .summary {
        flex-direction: column;
        text-align: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .expenses-table {
        font-size: 14px;
    }
    
    .expenses-table th,
    .expenses-table td {
        padding: 10px 8px;
    }
    
    /* Month Selection Mobile */
    .month-selection-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .year-toggle-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .year-toggle-btn {
        min-width: 70px;
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .month-buttons {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .month-btn {
        padding: 15px;
    }
    
    .month-btn .month-name {
        font-size: 1rem;
    }
    
    .month-btn .month-count {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    /* Month Selection Small Mobile */
    .year-toggle-buttons {
        gap: 8px;
    }
    
    .year-toggle-btn {
        min-width: 60px;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .year-count {
        font-size: 0.7rem;
        padding: 1px 4px;
    }
    
    .month-buttons {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .month-btn {
        padding: 12px;
    }
    
    .month-btn .month-name {
        font-size: 0.9rem;
    }
    
    .month-btn .month-count {
        font-size: 0.7rem;
    }
}

/* Mobile Sticky Navigation */
.mobile-sticky-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 0;
}

.sticky-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    max-width: 100%;
}

.sticky-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    min-width: 60px;
    position: relative;
}

.sticky-nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.sticky-nav-item.active {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.sticky-nav-item i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.sticky-nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
    line-height: 1;
}

.sticky-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    left: auto;
    min-width: 200px;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
}

.sticky-dropdown .dropdown-item {
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.sticky-dropdown .dropdown-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.sticky-dropdown .dropdown-item i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.sticky-dropdown .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 5px 0;
}

/* Add bottom padding to body for mobile sticky nav */
@media (max-width: 991.98px) {
    body {
        padding-bottom: 70px;
    }
}


/* ========== Dark mode surface overrides ========== */
[data-theme="dark"] .category-tab,
[data-theme="dark"] .year-toggle-btn,
[data-theme="dark"] .month-btn,
[data-theme="dark"] .year-btn,
[data-theme="dark"] .toggle-btn {
    background: var(--bg-inner);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .tab-title,
[data-theme="dark"] .month-selection h3,
[data-theme="dark"] .filter-group label,
[data-theme="dark"] .summary-item h3,
[data-theme="dark"] .expenses-list h2,
[data-theme="dark"] .stats-section h2,
[data-theme="dark"] .stats-overview h2,
[data-theme="dark"] .form-container h2,
[data-theme="dark"] .quick-shortcuts h3 {
    color: var(--text);
}

[data-theme="dark"] .tab-description,
[data-theme="dark"] .text-muted,
[data-theme="dark"] .notes-content {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .filter-group input,
[data-theme="dark"] .filter-group select,
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .form-control {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .expenses-table,
[data-theme="dark"] .expenses-table table,
[data-theme="dark"] .stats-table table,
[data-theme="dark"] .table {
    background: var(--bg-surface-solid) !important;
    color: var(--text);
}

[data-theme="dark"] .expenses-table td,
[data-theme="dark"] .expenses-table th,
[data-theme="dark"] .stats-table td,
[data-theme="dark"] .table td {
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .expenses-table tbody tr,
[data-theme="dark"] .expenses-table tbody td,
[data-theme="dark"] .stats-table tbody tr,
[data-theme="dark"] .stats-table tbody td,
[data-theme="dark"] .table tbody tr,
[data-theme="dark"] .table tbody td {
    background: var(--bg-surface-solid) !important;
    color: var(--text);
}

[data-theme="dark"] .expenses-table tr:hover,
[data-theme="dark"] .expenses-table tr:hover td,
[data-theme="dark"] .stats-table tr:hover,
[data-theme="dark"] .stats-table tr:hover td,
[data-theme="dark"] .table tbody tr:hover {
    background: var(--hover-row) !important;
}

[data-theme="dark"] .category-badge,
[data-theme="dark"] .amount-type-badge {
    background: var(--bg-muted);
    color: var(--text);
    border: 1px solid var(--border);
}

[data-theme="dark"] .expense-description,
[data-theme="dark"] .expense-date {
    color: var(--text);
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .form-container,
[data-theme="dark"] .stats-overview,
[data-theme="dark"] .stats-section {
    background: var(--bg-surface);
    color: var(--text);
}

[data-theme="dark"] .stat-content h3,
[data-theme="dark"] .stat-value {
    color: var(--text);
}

[data-theme="dark"] .notes-content {
    background: var(--notes-bg);
    border-color: var(--border);
}

[data-theme="dark"] .percentage-bar {
    background: var(--border);
}

[data-theme="dark"] .percentage-text {
    color: var(--text);
}

[data-theme="dark"] .year-toggle-btn:hover,
[data-theme="dark"] .month-btn:hover,
[data-theme="dark"] .category-tab:hover {
    background: var(--hover-row);
    border-color: var(--primary);
}

[data-theme="dark"] .modal-content {
    background: var(--bg-surface-solid);
    color: var(--text);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--border);
}

[data-theme="dark"] .dropdown-menu.sticky-dropdown,
[data-theme="dark"] .sticky-dropdown {
    background: var(--sticky-bg);
}

[data-theme="dark"] .card,
[data-theme="dark"] .list-group-item {
    background: var(--bg-surface-solid);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .amount-type-btn {
    background: var(--bg-muted);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .login-container {
    background: var(--bg-surface-solid);
    color: var(--text);
}

[data-theme="dark"] .demo-credentials {
    background: var(--bg-muted);
    color: var(--text);
}

[data-theme="dark"] .demo-credentials h6 {
    color: var(--text);
}

[data-theme="dark"] .offline-container,
[data-theme="dark"] .download-card {
    background: var(--bg-surface-solid);
    color: var(--text);
}

/* Theme toggle UI */
.theme-toggle {
    cursor: pointer;
    border: none;
    appearance: none;
    -webkit-appearance: none;
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
    transition: var(--transition-theme), transform 0.15s ease, background 0.2s ease;
}

.theme-toggle:active {
    transform: scale(0.94);
}

.theme-icon-sun,
[data-theme="dark"] .theme-icon-moon,
[data-theme="dark"] .theme-label-light {
    display: none !important;
}

.theme-icon-moon,
.theme-label-light {
    display: inline-block;
}

[data-theme="dark"] .theme-icon-sun,
[data-theme="dark"] .theme-label-dark {
    display: inline-block !important;
}

.theme-label-dark {
    display: none;
}

.theme-toggle-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle-nav {
    background: transparent;
    color: inherit;
    border: none;
    padding: 0.5rem 0;
}

.theme-toggle-nav .theme-icon-moon,
.theme-toggle-nav .theme-icon-sun {
    width: 1.25rem;
    text-align: center;
    margin-right: 0.35rem;
}

.theme-toggle-login {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    z-index: 1100;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    font-size: 1.15rem;
}

[data-theme="dark"] .theme-toggle-login {
    background: rgba(30, 36, 48, 0.85);
    color: #f1c40f;
}

.sticky-nav-item.theme-toggle {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    min-width: 64px;
    min-height: 52px;
}

.sticky-nav-item.theme-toggle:hover,
.sticky-nav-item.theme-toggle:focus-visible {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.sticky-nav-item.theme-toggle i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.sticky-nav-item.theme-toggle span {
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1;
}

.mobile-sticky-nav {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Only pages with sticky bottom nav need extra body padding */
@media (max-width: 991.98px) {
    body.has-sticky-nav {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }
}

.category-tabs,
.filters,
.summary,
.expenses-list,
.form-container,
.month-selection,
.stats-overview,
.stats-section,
.header,
.mobile-sticky-nav,
.stat-card {
    transition: var(--transition-theme);
}

.navbar .theme-toggle-header {
    padding: 8px 12px;
    min-width: 44px;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: none;
    border-radius: 10px;
}

.navbar .theme-toggle-header:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
    transform: none;
}

.navbar .theme-toggle-header .theme-label-light,
.navbar .theme-toggle-header .theme-label-dark {
    display: none !important;
}

[data-theme="dark"] .offline-container {
    background: linear-gradient(135deg, #1a1f2e 0%, #2c2340 100%);
}

[data-theme="dark"] .offline-card {
    background: #1e2430;
    color: #e8eaed;
}

[data-theme="dark"] .offline-title {
    color: #e8eaed;
}

[data-theme="dark"] .offline-message {
    color: #9aa0a6;
}


/* ========== Mobile polish v3 ========== */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

button, a.btn, .btn, .sticky-nav-item, .category-tab, .amount-type-btn,
.month-btn, .year-toggle-btn, .theme-toggle {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.25);
}

.navbar.navbar-expand-lg {
    padding-top: max(0.5rem, env(safe-area-inset-top));
}

.sticky-more {
    position: relative;
}

.sticky-more > .sticky-nav-item.dropdown-toggle {
    border: none;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
}

.sticky-more > .sticky-nav-item.dropdown-toggle::after {
    display: none;
}

.sticky-dropdown {
    z-index: 1050;
}

@media (hover: hover) and (pointer: fine) {
    .btn:hover {
        transform: translateY(-2px);
    }
}

.btn:active,
.category-tab:active,
.amount-type-btn:active,
.sticky-nav-item:active,
.month-btn:active {
    transform: scale(0.97);
}

@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;
    }
}

@media (max-width: 991.98px) {
    input, select, textarea, .form-control,
    .filter-group input, .filter-group select,
    .form-group input, .form-group select, .form-group textarea {
        font-size: 16px !important;
    }

    .container-fluid {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .tabs-container {
        grid-template-columns: 1fr;
    }

    .category-tab {
        min-height: 64px;
    }

    .sticky-nav-item {
        min-height: 48px;
        min-width: 56px;
        padding: 10px 8px;
        justify-content: center;
    }

    .btn-edit, .btn-delete, .actions .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 12px;
        font-size: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .year-toggle-btn {
        min-height: 44px;
    }

    .form-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px;
    }

    .simple-form .form-group input:focus,
    .simple-form .form-group select:focus,
    .simple-form .form-group textarea:focus {
        transform: none;
    }

    .notes-content {
        max-width: none;
    }

    .month-row:hover {
        transform: none;
    }

    .expenses-table thead {
        display: none;
    }

    .expenses-table table,
    .expenses-table tbody,
    .expenses-table tr,
    .expenses-table td {
        display: block;
        width: 100%;
    }

    .expenses-table table {
        background: transparent !important;
        box-shadow: none;
        overflow: visible;
    }

    .expenses-table tr {
        background: var(--bg-surface-solid);
        border: 1px solid var(--border);
        border-radius: 14px;
        margin-bottom: 12px;
        padding: 12px 14px;
        box-shadow: var(--shadow);
    }

    .expenses-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        border-bottom: 1px solid var(--border);
        padding: 8px 0;
        background: transparent !important;
        text-align: right;
    }

    .expenses-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .expenses-table td:first-child {
        padding-top: 0;
    }

    .expenses-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.8rem;
        text-align: left;
        flex-shrink: 0;
    }

    .expenses-table td.actions {
        justify-content: flex-end;
        gap: 8px;
    }

    .expenses-table td.actions::before {
        margin-right: auto;
    }

    .expenses-table .amount {
        font-size: 1.05rem;
    }

    .stats-table {
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }

    .quick-shortcuts {
        background: var(--bg-surface);
        border-radius: 15px;
        padding: 16px;
        margin-bottom: 20px;
        box-shadow: var(--shadow);
    }

    .navbar-text {
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

[data-theme="dark"] .quick-shortcuts {
    background: var(--bg-surface);
    color: var(--text);
}

[data-theme="dark"] .info-card,
[data-theme="dark"] .browser-info {
    background: var(--bg-surface-solid) !important;
    color: var(--text) !important;
}

[data-theme="dark"] .info-card h2,
[data-theme="dark"] .info-card h4,
[data-theme="dark"] .info-card h5,
[data-theme="dark"] .info-card p,
[data-theme="dark"] .info-card li,
[data-theme="dark"] .browser-info li {
    color: var(--text) !important;
}

[data-theme="dark"] .month-row:hover {
    background: var(--hover-row) !important;
}

[data-theme="dark"] .month-row.active {
    background: var(--primary-gradient) !important;
}
