/* Убираем прокрутку у всей страницы */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Основные стили для таблицы */
.table-container {
    max-height: 70vh;
    overflow: auto;
    margin: 20px auto;
    padding: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background: white;
    position: relative;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #f9f9f9;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Фиксированная шапка с датами */
thead th {
    position: sticky;
    top: 0;
    margin-top: 0px;
    z-index: 100;
    background-color: #6495ED;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 18px;
}

/* Фиксированный первый столбец с названиями метрик */
tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 50;
    background-color: #f9f9f9;
    font-weight: bold;
    min-width: 250px;
}

/* Стили для ячеек таблицы */
td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
    min-width: 200px;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    background-color: white;
}



/* Подсветка строки при наведении */
tr:hover td {
    background-color: #ADD8E6	;
}


/* Стиль для последнего столбца (итоги) */
td:last-child {
    background-color: #B0C4DE;
    font-weight: bold;
}
th:last-child {
    background-color: #4682B4;
    font-weight: bold;
}

/* Стили для формы */
.form-container {
    display: flex;
    gap: 20px;
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
}

.column {
    flex: 1;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #696969;
    font-size: 18px;
}

h1 {
    color: #696969;
    text-align: center;
    margin: 20px 0;
}

.form-group select,
.form-group input[type="date"] {
    width: 90%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    color: #555;
}

#fetchData {
    width: 100%;
    padding: 12px;
    margin: 20px auto;
    max-width: 600px;
    display: block;
    background-color: #6495ED;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#fetchData:hover {
    background-color: #4682B4;
}

/* Стили для скроллбара */
.table-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #6495ED;
    border-radius: 6px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #4682B4;
}

.error-message {
            color: red;
            font-weight: bold;
            text-align: center;
            margin: 20px 0;
            font-size: 18px;
        }

/* Стили для строк с особым фоном */
table tr:nth-child(7) td,  /* Все удержания WB */
table tr:nth-child(12) td, /* Все удержания */
table tr:nth-child(26) td{ /* Оплата на Р/К */
    background-color: #f0f8ff; /* Голубоватый фон */
    font-weight: bold;
}

table tr:nth-child(27) td {
    background-color: #8FBC8F			;
    font-weight: bold;
}

table tr:nth-child(28) td,
table tr:nth-child(29) td{
    background-color: #B0C4DE			;
    font-weight: bold;
}

/* Адаптивные стили */
@media (max-width: 768px) {
    .form-container {
        flex-direction: column;
        gap: 10px;
    }

    .table-container {
        max-height: 60vh;
    }

    tbody td:first-child {
        min-width: 180px;
    }
}