/* Обёртка таблицы с прокруткой */
.autopark-table-wrapper {
    width: 100%;
    overflow: auto;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    max-height: 400px;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

/* Основная таблица */
.autopark-table {
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 14px;
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

/* Ячейки */
.autopark-table th,
.autopark-table td {
    border: 1px solid #ddd;
    padding: 10px;
    white-space: nowrap;
    text-align: left;
    background: white;
}

/* Закреплённая верхняя строка */
.autopark-table thead th {
    position: sticky;
    top: 0;
    background-color: #666;
    color: white;
    z-index: 2;
}

/* Закреплённый первый столбец */
.autopark-table th:first-child,
.autopark-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
}

/* Пересечение первой строки и первого столбца */
.autopark-table thead th:first-child {
    z-index: 3;
    background-color: #666;
    color: white;
}

/* Чередование строк */
.autopark-table tbody tr:nth-child(odd) {
    background-color: #f9f9f9;
}

.autopark-table tbody tr:nth-child(even) {
    background-color: #ffffff;
}

/* Сохраняем фон в первом столбце в строках */
.autopark-table tbody tr:nth-child(odd) td:first-child {
    background-color: #f9f9f9;
}

.autopark-table tbody tr:nth-child(even) td:first-child {
    background-color: #ffffff;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .autopark-table th,
    .autopark-table td {
        font-size: 12px;
        padding: 6px;
    }

    .autopark-table-wrapper {
        max-height: 300px;
    }
}
