/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Geometria', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    /* Light theme colors */
    --primary-color: #00A4FF;
    --primary-dark: #0088CC;
    --secondary-color: #FF6600;
    --secondary-dark: #FF5500;
    --danger-color: #FF3300;
    --success-color: #00CC99;
    --warning-color: #FFCC00;
    --info-color: #9966FF;
    
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hover-color: rgba(0, 164, 255, 0.05);
    
    /* Размеры */
    --sidebar-width: 280px;
    --sidebar-width-laptop: 260px;
    --sidebar-width-small: 240px;
    --sidebar-width-tablet: 220px;
    --sidebar-width-mobile: 80px;
    
    --header-height: 60px;
    --border-radius: 12px;
    
    --font-size-base: 14px;
    --font-size-small: 13px;
    --font-size-xs: 12px;
    
    --spacing-base: 20px;
    --spacing-small: 15px;
    --spacing-xs: 10px;
}

[data-theme="dark"] {
    /* Dark theme colors */
    --primary-color: #4DA6FF;
    --primary-dark: #0066CC;
    --secondary-color: #FF944D;
    --secondary-dark: #FF7A00;
    --danger-color: #FF6666;
    --success-color: #33CC99;
    --warning-color: #FFD966;
    --info-color: #B399FF;
    
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --text-color: #e6e6e6;
    --text-muted: #a0aec0;
    --border-color: #2d3748;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --hover-color: rgba(77, 166, 255, 0.1);
}

/* ========== BODY & LAYOUT ========== */
body {
    font-family: 'Geometria', sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: var(--font-size-base);
    overflow-x: hidden;
}

.main-container {
    display: flex;
    min-height: 100vh;
}

.content-container {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-base);
    flex: 1;
    width: 100%;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px var(--shadow-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Стили для скроллбара сайдбара */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

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

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-dark);
}

.logo {
    padding: 0 20px 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 20px;
}

.logo h1 {
    font-size: 24px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ffffff;
    font-family: 'Geometria', sans-serif;
}

.logo i {
    font-size: 28px;
    color: var(--secondary-color);
}

.nav-menu {
    flex: 1;
    padding: 0 20px;
}

.nav-section {
    margin-bottom: 25px;
}

.nav-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 15px;
    padding: 0 10px;
    font-family: 'Geometria', sans-serif;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Geometria', sans-serif;
}

.nav-btn:hover {
    background: rgba(255,102,0,0.2);
    color: white;
    transform: translateX(5px);
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255,102,0,0.3);
}

.nav-btn i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.logout-area {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: linear-gradient(135deg, var(--danger-color) 0%, #CC2900 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Geometria', sans-serif;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,51,0,0.4);
}

/* Theme Toggle */
.theme-toggle {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: auto;
}

.theme-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: 'Geometria', sans-serif;
}

.theme-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* ========== HEADER ========== */
.header {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px var(--shadow-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 5px solid var(--secondary-color);
}

.header h1 {
    color: var(--primary-dark);
    font-size: 28px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: 'Geometria', sans-serif;
}

.header h1 i {
    color: var(--secondary-color);
    font-size: 32px;
}

/* ========== FOOTER ========== */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-family: 'Geometria', sans-serif;
}

/* ========== BUTTONS ========== */
.apply-btn, .reset-btn, .export-btn, .save-settings-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Geometria', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.apply-btn {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
}

.apply-btn:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, #FF4400 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,102,0,0.4);
}

.reset-btn {
    background: rgba(255,255,255,0.2);
    color: white;
}

.reset-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.export-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.export-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #0066CC 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,164,255,0.4);
}

.save-settings-btn {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
    color: white;
}

.save-settings-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(156, 39, 176, 0.3);
}

.save-settings-btn:active {
    transform: translateY(0);
}

.settings-saved {
    animation: pulse 0.5s ease-in-out;
}

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

/* ========== CARDS ========== */
.stat-card {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
    padding: var(--spacing-base);
    border-radius: var(--border-radius);
    text-align: center;
    transition: all 0.3s ease;
    font-family: 'Geometria', sans-serif;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255,102,0,0.3);
}

.stat-card i {
    font-size: 32px;
    opacity: 0.9;
    margin-bottom: 10px;
    color: rgba(255,255,255,0.9);
}

.stat-card .value {
    font-size: 28px;
    font-weight: bold;
    margin: 10px 0;
    color: white;
    font-family: 'Geometria', sans-serif;
}

.stat-card .label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.9);
    font-family: 'Geometria', sans-serif;
}

.feature-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: 0 4px 6px var(--shadow-color);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-color);
    display: block;
    border-top: 4px solid var(--secondary-color);
    font-family: 'Geometria', sans-serif;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow-color);
}

.feature-card i {
    font-size: 40px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.service-stat .sub-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========== FORMS ========== */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.filter-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Geometria', sans-serif;
}

select, input, textarea {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: 'Geometria', sans-serif;
    background-color: var(--card-bg);
    color: var(--text-color);
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(255,102,0,0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    font-family: 'Geometria', sans-serif;
}

/* ========== BADGES ========== */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    font-family: 'Geometria', sans-serif;
}

.badge-success {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #FFAA00 100%);
    color: white;
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #CC2900 100%);
    color: white;
}

/* ========== TABLES ========== */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -10px;
    padding: 0 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    min-width: 600px;
}

th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: white;
    border-bottom: 2px solid var(--primary-dark);
    font-family: 'Geometria', sans-serif;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Geometria', sans-serif;
}

tr:hover {
    background: var(--hover-color);
}

/* ========== CHARTS ========== */
.chart-container {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 6px var(--shadow-color);
    margin-bottom: 25px;
    border-left: 5px solid var(--primary-color);
}

.chart-wrapper.scrollable {
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
}

.chart-wrapper.scrollable canvas {
    min-width: 1200px;
}

.hourly-load-container .chart-wrapper canvas {
    background: var(--card-bg);
}

.hourly-load-container .chart-wrapper {
    background: var(--card-bg);
    border-radius: 8px;
}

/* Стили для скроллбара графика */
.chart-wrapper::-webkit-scrollbar {
    height: 8px;
}

.metric-filter {
    background: rgba(0,164,255,0.05);
    padding: 12px 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.metric-filter-btn {
    padding: 8px 16px;
    background: rgba(0,164,255,0.1);
    color: var(--primary-dark);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.metric-filter-btn:hover {
    background: rgba(0,164,255,0.2);
}

.metric-filter-btn.active {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
    border-color: var(--secondary-color);
}

.chart-wrapper::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

.chart-wrapper::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.chart-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-dark);
}

/* ========== QUICK DATE BUTTONS ========== */
.quick-date-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.quick-date-btn {
    padding: 8px 15px;
    background: rgba(0,164,255,0.1);
    color: var(--primary-dark);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    font-family: 'Geometria', sans-serif;
}

.quick-date-btn:hover {
    background: rgba(0,164,255,0.2);
    transform: translateY(-2px);
}

.quick-date-btn.active {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
}

/* ========== MODAL ========== */
.modal-overlay {
    animation: fadeIn 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;
    backdrop-filter: blur(3px);
}

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

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 2px solid var(--secondary-color);
    font-family: 'Geometria', sans-serif;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

#exportOptions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

#exportOptions label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(0,164,255,0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-family: 'Geometria', sans-serif;
}

#exportOptions label:hover {
    background: rgba(0,164,255,0.1);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,164,255,0.1);
}

#exportOptions label:has(input[value="all"]) {
    background: rgba(255,102,0,0.1);
    border: 1px solid var(--secondary-color);
}

#exportProgress {
    background: rgba(0,164,255,0.05);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    margin-top: 20px;
    text-align: center;
}

/* ========== УВЕДОМЛЕНИЯ (NOTIFICATIONS) - ИСПРАВЛЕННЫЙ БЛОК ========== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 24px;
    border-radius: 12px;
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease;
    font-family: 'Geometria', sans-serif;
    backdrop-filter: blur(8px);
}

/* Светлая тема - белый фон с темным текстом */
.notification {
    background: #ffffff;
    color: #333333;
    border: 1px solid #e2e8f0;
}

.notification.success {
    border-left: 4px solid #00CC99;
    background: #ffffff;
    color: #2d3748;
}

.notification.success i {
    color: #00CC99;
}

.notification.error {
    border-left: 4px solid #FF3300;
    background: #ffffff;
    color: #2d3748;
}

.notification.error i {
    color: #FF3300;
}

.notification.info {
    border-left: 4px solid #2196F3;
    background: #ffffff;
    color: #2d3748;
}

.notification.info i {
    color: #2196F3;
}

.notification.warning {
    border-left: 4px solid #FF9800;
    background: #ffffff;
    color: #2d3748;
}

.notification.warning i {
    color: #FF9800;
}

/* Темная тема - темный фон со светлым текстом */
[data-theme="dark"] .notification {
    background: #2d3748;
    color: #f7fafc;
    border-color: #4a5568;
}

[data-theme="dark"] .notification.success {
    border-left-color: #00E6B3;
    background: #2d3748;
    color: #f7fafc;
}

[data-theme="dark"] .notification.error {
    border-left-color: #FF5533;
    background: #2d3748;
    color: #f7fafc;
}

[data-theme="dark"] .notification.info {
    border-left-color: #33A6FF;
    background: #2d3748;
    color: #f7fafc;
}

[data-theme="dark"] .notification.warning {
    border-left-color: #FFAD33;
    background: #2d3748;
    color: #f7fafc;
}

.notification i {
    font-size: 18px;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

/* Анимация исчезновения */
.notification.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .notification {
        top: auto;
        bottom: 20px;
        right: 20px;
        left: 20px;
        padding: 12px 20px;
        font-size: 13px;
    }
    
    @keyframes slideInRight {
        from {
            opacity: 0;
            transform: translateY(100px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Устаревший класс заменен, оставляем для обратной совместимости */
.export-success-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--success-color) 0%, #00AA80 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,204,153,0.3);
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease;
    font-family: 'Geometria', sans-serif;
}

[data-theme="dark"] .export-success-notification {
    background: linear-gradient(135deg, #00E6B3 0%, #00B386 100%);
    color: white;
}

/* ========== LOADING ========== */
.loading {
    text-align: center;
    padding: 50px;
    color: var(--text-muted);
    font-family: 'Geometria', sans-serif;
}

.loading i {
    font-size: 40px;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

/* ========== UTILITIES ========== */
.error-message {
    background: linear-gradient(135deg, var(--danger-color) 0%, #CC2900 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    display: none;
    border-left: 4px solid var(--danger-color);
    font-family: 'Geometria', sans-serif;
}

.date-range-info, .period-info-display {
    background: linear-gradient(135deg, rgba(0,164,255,0.2) 0%, rgba(0,136,204,0.2) 100%);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--primary-dark);
    border-left: 4px solid var(--secondary-color);
    font-family: 'Geometria', sans-serif;
}

.trend-period-info {
    background: rgba(0,164,255,0.05);
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    border-left: 3px solid var(--secondary-color);
}

.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(255,102,0,0.3);
    z-index: 100;
    transition: all 0.3s ease;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(255,102,0,0.4);
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--secondary-color);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: var(--secondary-dark);
    transform: scale(1.05);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    backdrop-filter: blur(2px);
    transition: all 0.3s ease;
}

.overlay.active {
    display: block;
}

/* ========== GRIDS ========== */
.payment-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.payment-type-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 4px var(--shadow-color);
    border-top: 4px solid var(--secondary-color);
    transition: all 0.3s ease;
}

.payment-type-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.hourly-tables-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.hourly-table-wrapper {
    overflow-x: auto;
    max-width: 100%;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 4px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.hourly-table {
    min-width: 450px;
    font-size: 12px;
}

/* ========== RESPONSIVE DESIGN ========== */
@media screen and (max-width: 1366px) {
    :root {
        --sidebar-width: var(--sidebar-width-laptop);
        --spacing-base: 15px;
        --font-size-base: 13px;
    }
    
    .content-container {
        margin-left: var(--sidebar-width);
    }
    
    .stat-card .value {
        font-size: 24px;
    }
    
    .stat-card i {
        font-size: 28px;
    }
}

@media screen and (max-width: 1280px) {
    :root {
        --sidebar-width: var(--sidebar-width-small);
        --spacing-base: 12px;
    }
    
    .content-container {
        margin-left: var(--sidebar-width);
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .nav-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media screen and (max-width: 1024px) {
    :root {
        --sidebar-width: var(--sidebar-width-tablet);
        --spacing-base: 10px;
    }
    
    .content-container {
        margin-left: var(--sidebar-width);
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .header h1 i {
        font-size: 28px;
    }
    
    .stat-card .value {
        font-size: 22px;
    }
    
    .feature-card {
        padding: 20px;
    }
    
    .feature-card i {
        font-size: 36px;
    }
    
    .hourly-tables-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: var(--sidebar-width-mobile);
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .content-container {
        margin-left: 0;
        padding-top: 70px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .overlay {
        display: none;
    }
    
    .overlay.active {
        display: block;
    }
    
    .container {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .filters-row {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .date-range-selector {
        flex-direction: column;
    }
    
    .filter-buttons {
        flex-direction: column;
    }
    
    .apply-btn, .reset-btn, .export-btn {
        width: 100%;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .feature-cards {
        grid-template-columns: 1fr;
    }
    
    .payment-types-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    #exportOptions {
        grid-template-columns: 1fr;
    }
    
    .modal-content button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    th, td {
        padding: 10px;
        font-size: 12px;
    }
    
    .table-container {
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    .quick-date-buttons {
        justify-content: center;
    }
    
    .quick-date-btn {
        flex: 1;
        text-align: center;
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .payment-types-grid {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .header h1 i {
        font-size: 24px;
    }
    
    .stat-card .value {
        font-size: 20px;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .logo i {
        font-size: 24px;
    }
    
    .nav-section h3 {
        font-size: 10px;
    }
    
    .theme-btn, .logout-btn {
        font-size: 12px;
        padding: 8px;
    }
}

/* ========== PLATFORM SPECIFIC ========== */
/* Windows specific */
@media screen and (min-width: 0\0) and (min-resolution: +72dpi) {
    body {
        zoom: 0.95;
    }
    
    .sidebar {
        width: 260px;
    }
    
    .content-container {
        margin-left: 260px;
    }
    
    @media (max-width: 768px) {
        .sidebar {
            width: 280px;
        }
        
        .content-container {
            margin-left: 0;
        }
    }
}

/* Safari specific */
@media screen and (min-color-index:0) and(-webkit-min-device-pixel-ratio:0) {
    @media {
        .sidebar {
            width: 260px;
        }
        
        .content-container {
            margin-left: 260px;
        }
        
        .stat-card {
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }
        
        @media (max-width: 768px) {
            .sidebar {
                width: 280px;
            }
            
            .content-container {
                margin-left: 0;
            }
        }
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    .sidebar, .mobile-menu-toggle, .scroll-to-top,
    .theme-toggle, .logout-area, .filter-buttons,
    .quick-date-buttons, .autoupdate-checkbox {
        display: none;
    }
    
    .content-container {
        margin-left: 0;
        padding: 0;
    }
    
    .stat-card, .feature-card, .card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    table {
        break-inside: avoid;
    }
    
    .table-container {
        overflow: visible;
    }
}

/* ========== HIGH CONTRAST ========== */
@media screen and (forced-colors: active) {
    .apply-btn, .nav-btn.active, .save-settings-btn {
        outline: 2px solid Highlight;
    }
    
    .stat-card {
        border: 2px solid currentColor;
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* ========== SCROLLBAR GLOBAL ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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