.table-container {
    /* Максимальная ширина таблицы */
    --table-max-width: 900px;

    /* Внешний отступ таблицы от краев контейнера */
    --table-margin: 30px;

    /* Внутренний отступ контейнера таблицы */
    --container-padding: 0;

    /* Цвет границы таблицы */
    --table-border-color: #1A9BBE;

    /* Цвет заголовка таблицы */
    --table-title-color: #1A9BBE;

    /* Толщина границы таблицы */
    --table-border-width: 2px;

    /* Радиус скругления углов таблицы */
    --table-border-radius: 15px;

    /* Цвет текста в ячейках */
    --table-text-color: #5B5B5B;

    /* Размер шрифта в ячейках */
    /* --table-cell-font-size: 20px; */
    --table-cell-font-size: 18px;

    /* Размер шрифта в заголовках */
    --table-header-font-size: 14px;

    /* Стандартный внутренний отступ в ячейках по горизонтали */
    --table-cell-padding-x: 15px;

    /* Стандартный внутренний отступ в ячейках по вертикали */
    --table-cell-padding-y: 12px;

    /* Боковой отступ для крайних ячеек (от рамки) */
    --table-edge-padding: 22px;

    /* Отступ слева для первого столбца */
    --table-edge-padding-left: 35px;

    /* Вертикальный отступ между строками */
    --table-row-spacing: 35px;

    /* Отступ от верха таблицы до первой строки */
    --table-first-td-padding-top: 35px;

    /* Отступ от верха таблицы до первой строки */
    --table-top-margin: 35px;

    /* Отступ заголовка от верхней границы */
    --header-top-offset: -10px;

    /* Отступ для текста заголовка */
    --header-text-padding: 10px;

    /* Высота нулевой ячейки заголовка */
    --header-cell-height: 0;

    /* Компенсация высоты таблицы для рамки */
    --table-height-compensation: 65px;

    /* Ширина таблицы */
    --table-width: 100%;

    /* Значение для центрирования (transform) */
    --center-transform: -50%;

    /* Отступ для мобильного заголовка */
    --mobile-header-padding: 5px;

    max-width: var(--table-max-width);

    margin: var(--table-margin) auto;
    margin-top: 0;
    margin-bottom: 0;

    padding: var(--container-padding);
    /* padding-top: 0; */
    /* padding-bottom: 0; */
}

.custom-table {
    width: var(--table-width);
    border-collapse: collapse;
    background-color: white;
    position: relative;
    margin-top: var(--table-top-margin);
}

.custom-table::before {
    content: '';
    position: absolute;
    top: calc(-1 * var(--table-border-width));
    left: 0;
    right: 0;
    height: calc(100% - var(--table-height-compensation) + var(--table-row-spacing) / 2);
    border: var(--table-border-width) solid var(--table-border-color);
    border-radius: var(--table-border-radius);
    pointer-events: none;
}

.custom-table thead th {
    padding: 0;
    position: relative;
    height: var(--header-cell-height);
    border: none;
    line-height: 0;
    text-align: center;
}

.custom-table thead th::before {
    content: attr(data-label);
    color: var(--table-title-color);
    position: absolute;
    left: 50%;
    transform: translateX(var(--center-transform));
    top: var(--header-top-offset);
    padding: 0 var(--header-text-padding);
    background-color: white;
    z-index: 1;
    white-space: nowrap;
    line-height: normal;
    font-family: 'Rubik', sans-serif;
    font-weight: 400;
    font-size: var(--table-header-font-size);

    white-space: pre; /* или pre-line */
}

.custom-table thead th:first-child::before {
    left: var(--table-edge-padding);
    transform: none;
}

.custom-table tbody tr {
    padding-top: calc(var(--table-row-spacing) / 2);
    padding-bottom: calc(var(--table-row-spacing) / 2);
    display: table-row;
}

.custom-table td {
    padding: var(--table-cell-padding-y) var(--table-cell-padding-x);
    font-family: 'Rubik', sans-serif;
    font-weight: 400;
    font-size: var(--table-cell-font-size);
    color: var(--table-text-color);
    text-align: center;
}

.custom-table td:first-child {
    padding-left: var(--table-edge-padding-left);
}

.custom-table td:last-child {
    padding-right: var(--table-edge-padding);
}

.custom-table tbody tr:not(:last-child)::after {
    content: '';
    display: block;
    height: var(--table-row-spacing);
}

.custom-table tbody tr:first-child td {
    padding-top: var(--table-first-td-padding-top);
}

.custom-table tbody tr:last-child td {
    font-weight: 500 !important;
}

.custom-table tbody tr:last-child td * {
    font-weight: 500 !important;
}

.custom-table tbody tr:last-child td:nth-child(2) {
    color: var(--table-title-color);
}



@media screen and (max-width: 900px) {
    .table-container {
        /* Изменение значений переменных для мобильной версии */
        --table-cell-padding-x: 8px;
        --table-cell-padding-y: 8px;
        --table-cell-font-size: 16px;
        --container-padding: 10px;
        --header-text-padding: var(--mobile-header-padding);

        /* Отступ от верха таблицы до первой строки */
        /* --table-top-margin: 35px; */

        /* Отступ от верха таблицы до первой строки */
        --table-first-td-padding-top: 20px;

        /* Компенсация высоты таблицы для рамки */
        --table-height-compensation: 52px;
    }

    .table-container {
        overflow-x: auto;
    }
}

@media screen and (max-width: 768px) {
    .table-container {
        /* Изменение значений переменных для мобильной версии */

        /* Стандартный внутренний отступ в ячейках по горизонтали */
        --table-cell-padding-x: 5px;

        /* Стандартный внутренний отступ в ячейках по вертикали */
        --table-cell-padding-y: 5px;

        --table-cell-font-size: 12px;
        --container-padding: 5px;
        --header-text-padding: var(--mobile-header-padding);
        --table-header-font-size: 12px;

        /* Боковой отступ для крайних ячеек (от рамки) */
        --table-edge-padding: 15px;

        /* Отступ слева для первого столбца */
        --table-edge-padding-left: 15px;


        /* Отступ от верха таблицы до первой строки */
        --table-first-td-padding-top: 20px;

        /* Компенсация высоты таблицы для рамки */
        --table-height-compensation: 45px;
    }
}

@media screen and (max-width: 740px) {
    .table-container {
        /* Изменение значений переменных для мобильной версии */

        /* Стандартный внутренний отступ в ячейках по горизонтали */
        --table-cell-padding-x: 3px;

        /* Стандартный внутренний отступ в ячейках по вертикали */
        --table-cell-padding-y: 3px;

        --table-cell-font-size: 10px;
        --table-header-font-size: 10px;
        --container-padding: 5px;
        --header-text-padding: var(--mobile-header-padding);

        /* Боковой отступ для крайних ячеек (от рамки) */
        --table-edge-padding: 15px;

        /* Отступ слева для первого столбца */
        --table-edge-padding-left: 15px;


        /* Отступ от верха таблицы до первой строки */
        --table-first-td-padding-top: 20px;

        /* Компенсация высоты таблицы для рамки */
        --table-height-compensation: 40px;

        /* Добавляем перенос слов в заголовках */
        --header-text-padding: 3px;
    }

    /* Добавляем перенос текста для заголовков */
    .custom-table thead th::before {
        white-space: normal;
        width: min-content;
        min-width: 40px;
        font-size: 9px;
        line-height: 1.2;
    }
}

@media screen and (max-width: 600px) {
    .table-container {
        --table-cell-font-size: 9px;
        --table-header-font-size: 9px;
        --table-edge-padding: 10px;
        --table-edge-padding-left: 10px;
        --table-height-compensation: 30px;
        --table-cell-padding-x: 2px;
        --table-cell-padding-y: 2px;

        /* Компенсация высоты таблицы для рамки */
        --table-height-compensation: 36px;
    }
}

@media screen and (max-width: 540px) {
    .table-container {
        --table-cell-font-size: 8px;
        --table-header-font-size: 8px;
        --table-edge-padding: 8px;
        --table-edge-padding-left: 8px;
    }

    /* Задаем фиксированную ширину для первого столбца */
    .custom-table td:first-child,
    .custom-table th:first-child {
        width: 30px;
        min-width: 30px;
        max-width: 30px;
    }

    /* Распределяем оставшееся пространство поровну между остальными столбцами */
    .custom-table td:not(:first-child),
    .custom-table th:not(:first-child) {
        width: calc((100% - 30px) / 5); /* 5 - количество оставшихся столбцов */
    }

    /* Уменьшаем отступ для заголовка первого столбца */
    .custom-table thead th:first-child::before {
        left: 5px;
    }
}


@media screen and (max-width: 400px) {
    .table-container {
        --table-cell-font-size: 7px;
        --table-header-font-size: 6px; /* Единый размер шрифта для всех заголовков */
        --table-edge-padding: 5px;
        --table-edge-padding-left: 15px;
        --table-border-width: 1px;
        --table-border-radius: 10px;
    }

    .custom-table td:first-child,
    .custom-table th:first-child {
        width: 25px;
        min-width: 25px;
        max-width: 25px;
    }

    .custom-table td:not(:first-child),
    .custom-table th:not(:first-child) {
        width: calc((100% - 25px) / 5);
    }
}

@media screen and (max-width: 380px) {
    .table-container {
        --table-cell-font-size: 6px;
        --table-header-font-size: 5px; /* Единый размер шрифта для всех заголовков */
        --table-edge-padding: 2px;
        --table-edge-padding-left: 15px;
    }

    .custom-table td:first-child,
    .custom-table th:first-child {
        width: 20px;
        min-width: 20px;
        max-width: 20px;
    }

    .custom-table td:not(:first-child),
    .custom-table th:not(:first-child) {
        width: calc((100% - 20px) / 5);
    }
}

@media screen and (max-width: 340px) {
    .table-container {
        --table-cell-font-size: 5px;
        --table-header-font-size: 4px; /* Единый размер шрифта для всех заголовков */
        --table-edge-padding: 3px;
        --table-edge-padding-left: 15px;
    }

    .custom-table td:first-child,
    .custom-table th:first-child {
        width: 15px;
        min-width: 15px;
        max-width: 15px;
    }

    .custom-table td:not(:first-child),
    .custom-table th:not(:first-child) {
        width: calc((100% - 15px) / 5);
    }
}

/* горизонтальная прокрутка для таблицы на малых экранах */
@media screen and (max-width: 540px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* чередование цветов строк на мобильных устройствах */
@media screen and (max-width: 600px) {
    .custom-table tbody tr:nth-child(even) {
        background-color: rgba(26, 155, 190, 0.05);
    }
}