/* Стили для панели навигации истории */
.navigation-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background-color: white;
    border-radius: 15px;
    padding: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 300px;
}

.nav-section {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 5px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.nav-button {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    border: none;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.nav-button:hover {
    background-color: #2980b9;
}

.nav-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
}

/* Стили для разных разделов */
.section-year {
    border-left: 4px solid #e74c3c;
}

.section-year .nav-title {
    color: #e74c3c;
}

.section-month {
    border-left: 4px solid #f39c12;
}

.section-month .nav-title {
    color: #f39c12;
}

/* Стили для таблицы страницы истории */
.table-container {
    background-color: white;
    border-radius: 15px;
    padding: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.table-header {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    padding: 5px 0px 10px 0px;
    border-bottom: 2px solid #3498db;
}

.summary-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 10px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.summary-profitability {
    padding-bottom: 0px;
    border-bottom: 1px solid #A6A6A6;
}

.summary-label {
    color: #2c3e50;
}


/* Таблица операций */
.operations-table {
    width: 100%;
    border-collapse: collapse;
}

.operations-table th {
    background-color: #3498db;
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: bold;
}

.operations-table td {
    padding: 10px;
    border-bottom: 1px solid #ecf0f1;
    position: relative;
}

.comment-icon {
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%); /* по центру по высоте */
    pointer-events: none;
}

.operations-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.operations-table tr:hover {
    background-color: #e8f4f8;
}

.operation-income {
    color: #27ae60;
    font-weight: bold;
}

.operation-expense {
    color: #e74c3c;
    font-weight: bold;
}

.amount-income {
    color: #27ae60;
    font-weight: bold;
}

.amount-expense {
    color: #e74c3c;
    font-weight: bold;

}
/* Модальное окно */
.modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 9000;
            margin: 0 auto;
        }

        .modal {
            background: white;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            width: 100%;
            max-width: 450px;
            overflow: hidden;
            animation: slideIn 0.3s ease-out;
        }

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

        .modal-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 20px 25px;
        }

        .operation-summary {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 20px;
            font-weight: 500;
        }

        .date-info, .amount-info {
            display: flex;
            flex-direction: column;
        }

        .date-label, .amount-label {
            font-size: 16px;
            opacity: 0.9;
            margin-bottom: 3px;
        }

        .date-value, .amount-value {
            font-size: 20px;
            font-weight: 600;
        }

        .modal-body {
             padding: 16px;
              flex: 1;
              max-height: calc(80vh - 100px);
              overflow-y: auto; /* Вертикальная прокрутка при переполнении */
              min-height: 100px;

        }

        .comment-section {
            margin-bottom: 20px;

        }

        .comment-title {
            font-size: 17px;
            color: #666;
            margin-bottom: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .comment-content {
            background-color: #f8f9fa;
            border-radius: 8px;
            padding: 15px;
            font-size: 15px;
            line-height: 1.5;
            color: #333;
            border-left: 3px solid #667eea;
            word-wrap: break-word;
            overflow-wrap: break-word;
            white-space: pre-wrap;
        }

        .modal-footer {
            padding: 0 25px 25px;
            text-align: center;
        }

        .close-button {
             display: block;
             width: 100%;
             padding: 15px;
             border: none;
             border-radius: 12px;
             font-size: 16px;
             font-weight: 600;
             cursor: pointer;
             transition: all 0.3s ease;
             margin-bottom: 15px;
             text-align: center;
             background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
             color: white;
        }

        .close-button:hover {
           transform: translateY(-2px);
           box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        }

        /* Адаптивность */
        @media (max-width: 480px) {
            .modal {
                margin: 15px;
                max-width: none;
            }

            .modal-header {
                padding: 18px 20px;
            }

            .operation-summary {

                gap: 10px;
                text-align: center;
            }

            .date-value, .amount-value {
                font-size: 18px;
            }

            .modal-body {
                padding: 20px;
            }

            .comment-content {
                padding: 12px;
                font-size: 16px;
            }

            .modal-footer {
                padding: 0 20px 20px;
            }
        }

        @media (max-width: 360px) {
            .modal-header {
                padding: 15px;
            }

            .date-label, .amount-label {
                font-size: 14px;
            }

            .date-value, .amount-value {
                font-size: 18px;
            }

            .modal-body {
                padding: 15px;
            }

            .comment-title {
                font-size: 14px;
                margin-bottom: 8px;
            }

            .comment-content {
                padding: 10px;
                font-size: 16px;
            }
        }
/* Hover-эффект для строк таблицы */
#operations-table tbody tr:hover {
    background-color: #f0f4ff; /* Лёгкий синий фон для акцента */
    cursor: pointer; /* Курсор в виде указателя */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Лёгкая тень для фокуса */
    transition: background-color 0.2s ease, box-shadow 0.2s ease; /* Плавный переход */
}