/* Таблица */
table {
  width: 100%;
  /* margin: 24px auto; */
  background-color: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  /* overflow: hidden; */
  border-collapse: separate; /* Чтобы контролировать границы ячеек */
  border-spacing: 0;
  white-space: nowrap;
}

/* Заголовок таблицы */
thead {
  background-color: var(--color-bg-blue); /* Фон шапки таблицы */
  white-space: nowrap;
}

thead tr {
  height: 48px;
  background: #f7f8fa;
  white-space: nowrap;
}

/* Ячейки заголовка */
thead th {
    color: #7c838d;
    white-space: nowrap;
    height: 48px;

    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 18px;
    /* leading-trim в CSS пока не поддерживается в браузерах, можно убрать */
    letter-spacing: 0;
}

th,
td {
  padding: 0 24px;
  height: 72px;
  font-family: "Inter", sans-serif;
  font-weight: 500; /* Medium */
  font-style: normal;
  font-size: 14px;
  line-height: 140%;
  letter-spacing: 0;
  font-variant-numeric: lining-nums tabular-nums;
  text-align: left;
  color: var(--color-type-black);
  border-top: 1px solid #f0f2f5;
  border-bottom: 1px solid #f0f2f5;
  border-left: none !important;
  border-right: none !important;
}

/* Стили при наведении на строку */
tbody tr:hover {
  background-color: var(--color-bg-blue);
  cursor: pointer;
}

/* Ячейки тела */
tbody td {
}

/* Стили заголовков */
th {
  font-weight: 600;
  color: var(--color-gray); /* Цвет текста в заголовках */
  position: relative; /* Чтобы можно было добавить иконки сортировки */
  user-select: none; /* Отключаем выделение текста заголовка */
}

/* Иконки сортировки (если понадобится) */
th.sortable a::after {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-left: 6px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  vertical-align: middle;
  opacity: 0.6;
  background-image: url("/static/icons/sorting.svg"); /* по умолчанию */
}

th.sortable.sorted-asc a::after {
  background-image: url("/static/icons/arrow_up.svg");
  opacity: 1;
  width: 12px;
  height: 12px;
}

th.sortable.sorted-desc a::after {
  background-image: url("/static/icons/arrow_down.svg");
  opacity: 1;
  width: 12px;
  height: 12px;
}

th.sortable a {
    text-decoration: none;
    color: var(--color-table-gray);
    font-weight: normal;

    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 18px;
    letter-spacing: 0;
    /* leading-trim: NONE; убрано, т.к. не поддерживается */
}

th.sortable a:hover {
  color: var(--color-gray); /* отключаем изменение цвета при наведении */
  text-decoration: none;
}

/* Контейнер для переключателя и поиска */
.table-controls {
  display: flex; /* Расположим элементы в строку */
  justify-content: space-between;
  gap: 16px; /* Промежуток между элементами */
  max-width: 1700px;
  width: 100%;
  align-items: center; /* Выравнивание по центру по вертикали */
  padding-bottom: 24px;
}

/* Переключатель "Показывать по 10/20/30" */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search {
  display: flex;
  align-items: center;
  position: relative;
  width: 230px; /* Уменьшаем ширину поиска */
}

.search input {
  padding: 6px 12px 6px 30px; /* Отступ слева для иконки */
  font-size: 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background-color: var(--color-bg);
  height: 40px;
}

.search input::placeholder {
  color: var(--color-gray);
}

.search input:focus {
  outline: none;
  border-color: var(--color-main);
  box-shadow: 0 0 6px rgba(73, 140, 247, 0.5);
}

.search input:hover {
  border-color: var(--color-main);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Пагинация под таблицей */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 24px auto;
  gap: 8px;
}

.pagination-controls a,
.pagination-controls span {
  padding: 8px 12px;
  border-radius: 4px;
  background-color: var(--color-bg);
  color: var(--color-black);
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

/* Активная страница */
.pagination-controls .current {
  background-color: var(--color-border);
  color: black;
  font-weight: bold;
}

th.sortable {
  white-space: nowrap;
  text-align: left;
}

th.sortable .arrow {
  margin-left: 4px;
  text-decoration: none;
  color: #999;
  font-size: 0.8em;
}

th.sortable .arrow.active {
  color: #000;
  font-weight: bold;
}

.detail-link {
  text-decoration: underline;
  color: inherit;
}

.table-section {
  max-width: 1320px;
  width: 100%;
  overflow-x: auto;
}

.table-header-row th {
  width: 190px;
  height: 48px;
  padding: 0 24px;
  background: #f7f8fa;
  border-bottom: 1px solid #f0f2f5;
  font-weight: 600;
  font-size: 14px;
  color: #7c838d; /* Светло-серый */
  white-space: nowrap;
  border-left: none;
  border-right: none;
}

.table-body-row td {
  width: 190px;
  height: 72px;
  padding: 0 24px;
  border-bottom: 1px solid #f0f2f5;
  font-size: 14px;
  color: #1c1c1e; /* Обычный текст */
  border-left: none;
  border-right: none;
}

.data-pill-container {
  display: inline-flex;
  align-items: center;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  border: 1px solid #f0f2f5;
}

.data-pill-container select {
  background-color: transparent;
  width: 100%;
  border: none;
  font-size: 14px;
  color: #333;
  margin-left: 8px;
  border-radius: 10px;
  padding: 0;
}

.data-pill-container select:focus {
  outline: none;
}

.table-footer {
  font-size: 14px;
  color: #666;
  border-top: 1px solid #f0f2f5;
  padding: 10px 15px;
}

.table-footer .highlight {
  font-weight: bold;
  color: #333;
}

.pagination-container {
  display: flex;
  justify-content: space-between; /* Разделяет элементы на два конца */
  align-items: center; /* Выравнивает элементы по центру по вертикали */
}

.pagination-info {
  display: inline-block;
  margin-right: 20px;
  white-space: nowrap;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-style: normal; /* Medium */
  font-size: 14px;
  line-height: 130%;
  letter-spacing: 0%;
}

.pagination-info .highlight {
  color: #666f8d; /* серый цвет для чисел и слова "из" */
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end; /* Выравнивает элементы по правому краю */
  width: 100%; /* Это важное свойство для того, чтобы элементы по правому краю сдвигались */
}

.page-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 6px;
  background-color: transparent;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.page-arrow:hover {
  background-color: #f0f0f0;
}

.page-arrow:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-light-gray); /* Или замените на нужный цвет */
}

.page-number {
  color: #333;
  text-decoration: none;
  margin: 0 5px;
  font-size: 14px;
  padding: 5px 10px;
  border-radius: 8px;
  background-color: #f9f9f9;
}

.sort-icon {
  width: 12px;
  height: 12px;
  margin-left: 6px;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

.sort-icon--placeholder {
  opacity: 0.2;
}

.page-header {
  display: flex;
  align-items: center; /* Выравнивание по вертикали */
  justify-content: space-between;
  padding-top: 45px;
  padding-bottom: 30px;
  gap: 20px; /* Расстояние между элементами */
}

.arrow-icon {
  width: 12px;
  vertical-align: middle;
}

.file-link {
  display: inline-flex; /* иконка + текст в одну строку */
  align-items: center; /* вертикально центрируем */
  gap: 4px; /* расстояние между svg и текстом */
  text-decoration: none; /* убираем подчёркивание, если нужно */
}

/* при желании можно ограничить размер svg */
.file-icon {
  width: 16px;
  height: 16px;
}

.manager-inline {
  display: inline-flex; /* или flex, если хотите блочный вариант */
  align-items: center;
  gap: 0; /* нет промежутка между иконкой и текстом */
}

.status-icon {
  width: 32px; /* размеры по необходимости */
  height: 24px;
  margin-right: 0; /* на всякий случай убираем возможный margin */
  vertical-align: middle;
}

.table-controls .filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap; /* если места мало, пусть переходят на следующую строку */
  align-items: center;
}

table a,
table a:visited,
table a:hover,
table a:active,
table a:focus,
.deal-stats__pill a,
.deal-stats__pill a:visited,
.deal-stats__pill a:hover,
.deal-stats__pill a:active,
.deal-stats__pill a:focus,
.data-pill-participant a,
.data-pill-participant a:visited,
.data-pill-participant a:hover,
.data-pill-participant a:active,
.data-pill-participant a:focus,
.register-link a,
.register-link a:visited,
.register-link a:hover,
.register-link a:active,
.register-link a:focus {
  color: inherit;
  text-decoration: underline;
}

.pill-name {
  /* color: inherit !important; */
  /* text-decoration: underline; */
}

.header-buttons {
  display: flex;
  gap: 12px;
}

.header-buttons a {
  text-decoration: none;
  display: flex; /* ключевой момент — кнопка занимает всю ссылку */
}

.non-link-style {
  text-decoration: none;
  color: var(--color-gray);
  font-weight: normal;
  cursor: default; /* Чтобы не выглядело как ссылка */
}

.page-header-clients {
  display: flex;
  align-items: center; /* Выравнивание по вертикали */
  justify-content: space-between; /* Или flex-start, если кнопка должна быть рядом с заголовком */
  padding-top: 45px;
  padding-bottom: 40px;
  gap: 20px; /* Расстояние между элементами */
}

.table-scroll-container {
  overflow-x: auto;
  overflow-y: hidden;
}

.sticky-col {
  position: sticky;
  right: 0;
  background: #fff; /* обязательно, чтобы не просвечивало содержимое под таблицей */
  z-index: 2;
}

@media (max-width: 1024px) {
  .table-button-wrapper {
    display: grid;
    grid-auto-flow: row; /* по умолчанию кнопки в ряд */
    gap: 4px;
  }
}

th {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0;
  color: var(--color-gray);
}

.pagination .data-pill-container label {
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-style: normal; /* Regular */
  font-size: 14px;
  line-height: 130%;
  letter-spacing: 0;
  color: #666f8d;
}

.pagination .data-pill-container select {
  font-family: "Inter", sans-serif;
  font-weight: 500; /* Medium */
  font-style: normal; /* Medium */
  font-size: 14px;
  line-height: 130%;
  letter-spacing: 0;
  color: #19213d; /* по желанию можно задать цвет текста */
  background-color: transparent; /* чтобы сохранить стиль подложки */
  padding: 0; /* для удобства */
}

.stats-export-form {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
}

/* Внутренний блок */
.stats-export-form form {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Общий стиль для input и select */
.stats-export-form input[type="text"],
.stats-export-form select {
    height: 43px;
    padding: 11px 12px;
    border: 1px solid #f0f2f5;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;

    /* ШРИФТ, КАК В ПАГИНАЦИИ */
    font-family: "Inter", sans-serif;
    font-weight: 500;
    font-style: normal;
    font-size: 14px;
    line-height: 130%;
    letter-spacing: 0;
    color: #19213d;
}
/* Hover / focus — как у фильтров */
.stats-export-form input[type="text"]:focus,
.stats-export-form select:focus {
    border-color: #3b82f6;
    outline: none;
}

.stats-export-form input[type="text"]:hover,
.stats-export-form select:hover {
    border-color: #9CA3AF;
}

/* Мобильная версия */
@media (max-width: 1024px) {
    .stats-export-form form {
        flex-direction: column;
        align-items: stretch; /* чтобы поля растягивались на всю ширину */
        gap: 12px;
    }

    .stats-export-form .data-pill-container {
        width: 100%;
    }

    .stats-export-form input[type="text"],
    .stats-export-form select {
        width: 100%;
    }

    .stats-export-form button {
        width: 100%;
    }

    .stats-export-form form {
      flex: 1 1 100%;  
      display: flex;
      gap: 12px;
    }
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 12px;              /* отступ слева */
    transform: translateY(-50%);
    width: 15px;             /* размер иконки */
    height: 15px;
    background: url("../icons/search_icon.svg") no-repeat center;
    background-size: contain;
    pointer-events: none;    /* чтобы клики проходили в input */
}
