/* Страница «Рейтинг офферов»: на всю ширину, карточки, границы столбцов */

.offer-rating-page {
  width: 100%;
  max-width: none;
}

/* Вкладки */
.or-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.or-tab {
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.35));
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.or-tab:hover {
  background: rgba(255, 255, 255, 0.06);
}
.or-tab--active {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.18);
  color: #e0e7ff;
}

/* Панель фильтров: одна строка, кнопки справа */
.or-toolbar-one-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.65rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.or-toolbar-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-width: 0;
}
.or-toolbar-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  align-self: flex-end;
  padding-bottom: 0.05rem;
}

/* Селекты как у geo-picker (cell-creo-btn): те же высота, рамка, chevron */
.offer-rating-toolbar .offer-rating-select.offer-rating-select--sm {
  box-sizing: border-box;
  min-width: 8.5rem;
  max-width: 100%;
  min-height: var(--th-control-h, 36px);
  margin: 0;
  padding: 6px 28px 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  background: var(--bg);
  color: var(--text);
  font-size: var(--th-font-md);
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238888a0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
  transition: border-color var(--transition, 0.15s ease);
}
.offer-rating-toolbar .offer-rating-select.offer-rating-select--sm:hover {
  border-color: var(--border-hover);
}

.offer-rating-field--geo {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 18rem;
}

/* GEO: глобальные стили geo-picker; только ширина контейнера */
.offer-rating-toolbar .geo-picker-mount {
  min-width: 8.5rem;
  max-width: 16rem;
}

.offer-rating-input-dt {
  box-sizing: border-box;
  min-width: 11rem;
  min-height: var(--th-control-h, 36px);
  padding: 6px 12px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: var(--th-font-md);
}

.or-arch-hint {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  line-height: 1.4;
  word-break: break-word;
}

/* Таблица на всю ширину области контента */
.offer-rating-page .statistics-table-inner.admin-table-wrap.offer-rating-main-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
}
.offer-rating-page .statistics-table-inner .admin-table.statistics-table.offer-rating-table {
  width: 100%;
  min-width: min(100%, 64rem);
  table-layout: auto;
}

.offer-rating-page .statistics-table-inner .admin-table th:first-child,
.offer-rating-page .statistics-table-inner .admin-table td:first-child {
  text-align: left;
}

.offer-rating-meta {
  margin: 0 0 1rem;
  font-size: 0.85rem;
}

.offer-rating-card {
  margin-bottom: 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: 12px;
  background: var(--surface-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.25));
}

.offer-rating-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.offer-rating-card__lead {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
}

.offer-rating-mini-wrap,
.offer-rating-main-wrap {
  overflow-x: auto;
  margin: 0 -0.15rem;
}

.offer-rating-toolbar {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: var(--surface-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.25));
}

.offer-rating-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: flex-end;
}

.offer-rating-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.2));
}

.offer-rating-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.offer-rating-field__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #94a3b8);
}

.offer-rating-select {
  min-width: 11rem;
  max-width: 100%;
}

/* Вертикальные разделители столбцов */
.offer-rating-table th,
.offer-rating-table td {
  white-space: nowrap;
  border-right: 1px solid rgba(148, 163, 184, 0.22);
}

/* Архив: в одной ячейке значение + дельта — допускаем перенос */
#or-archive-table td:nth-child(n + 4) {
  white-space: normal;
  max-width: 11rem;
}

.offer-rating-table th:last-child,
.offer-rating-table td:last-child {
  border-right: none;
}

.offer-rating-table td:first-child,
.offer-rating-table th:first-child {
  white-space: normal;
  max-width: min(28rem, 42vw);
}

.offer-rating-slot--badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
}

.offer-rating-delta--up {
  color: #4ade80;
  font-weight: 600;
}

.offer-rating-delta--flat {
  color: var(--text-muted, #94a3b8);
}

.offer-rating-delta--down {
  color: #f87171;
  font-weight: 600;
}

@media (max-width: 720px) {
  .offer-rating-toolbar__row {
    flex-direction: column;
    align-items: stretch;
  }

  .offer-rating-select {
    width: 100%;
  }

  .offer-rating-table td:first-child,
  .offer-rating-table th:first-child {
    max-width: 12rem;
  }

  .or-toolbar-one-line {
    flex-wrap: nowrap;
  }
}
