/* ==========================================================================
   performance.css — страница «Эффективность»
   ========================================================================== */

.perf-page {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* ==========================================================================
   Панель фильтров
   ========================================================================== */
.perf-filters {
  display: grid;
  grid-template-columns: 210px 1fr 1fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

.perf-filters .select { height: 42px; font-size: 13px; }

.perf-filters__export { height: 42px; }

/* ==========================================================================
   Вертикали поиска + время обновления
   ========================================================================== */
.perf-verticals {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 16px 0;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.perf-verticals .tabs {
  flex: 1;
  min-width: 0;
  gap: 22px;
  border-bottom: 0;
  overflow-x: auto;
}

.perf-verticals .tabs__item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 0 13px;
  font-size: 13px;
}

.perf-verticals .tabs__item::after { bottom: 0; }

.perf-updated {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

/* ==========================================================================
   Показатели
   ========================================================================== */
.perf-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

.metric {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: border-color .14s ease, box-shadow .14s ease;
}

.metric:hover { border-color: #cddbec; }

.metric.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(22, 104, 255, .1);
}

.metric__ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  color: #fff;
}
.metric__ico .icon { width: 17px; height: 17px; }

.metric__ico--blue   { background: var(--brand); }
.metric__ico--violet { background: #7c4dff; }
.metric__ico--teal   { background: #17b3a3; }
.metric__ico--amber  { background: #f5a524; }

.metric__body { flex: 1; min-width: 0; }

.metric__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric__label {
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric__info { margin-left: auto; color: var(--text-3); flex: none; }

.metric__value {
  margin: 2px 0 5px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.metric__delta { font-size: 12.5px; font-weight: 600; }

.metric__compare {
  margin-top: 1px;
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   График «Клики и показы»
   ========================================================================== */
.perf-chart__legend {
  justify-content: center;
  margin-bottom: 6px;
}

.perf-chart__axis-name {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 11.5px;
  color: var(--text-2);
}

.perf-chart .chart-frame { grid-template-columns: 46px minmax(0, 1fr) 54px; }
.perf-chart .chart-xlabels { margin: 8px 54px 0 46px; }

.perf-chart__periods {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--text-2);
}

.perf-chart__period {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.perf-chart__dash {
  width: 26px;
  height: 0;
  border-top: 2px solid var(--text-3);
}
.perf-chart__dash--solid  { border-color: var(--text-2); }
.perf-chart__dash--dotted { border-top-style: dashed; }

/* ==========================================================================
   Нижний ряд таблиц
   ========================================================================== */
.perf-bottom {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1.05fr;
  gap: var(--gap);
  align-items: stretch;
}

.perf-table { font-size: 12.5px; }

.perf-table th { padding-bottom: 10px; }
.perf-table td { padding: 9px 0; }

.perf-table .num { padding-left: 14px; }

.perf-table td:first-child,
.perf-table th:first-child { width: 100%; }

.perf-table .rank {
  display: inline-block;
  min-width: 15px;
  color: var(--text-3);
}

.perf-table__row--active td {
  background: var(--surface-2);
  font-weight: 500;
}

.perf-table .cell-page {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}

/* заголовок «Страница: …» в третьей карточке */
.perf-selected {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -8px 0 12px;
  font-size: 12px;
  color: var(--text-2);
  min-width: 0;
}

.perf-selected__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--brand);
  font-weight: 500;
}
.perf-selected__link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Подпись про часовой пояс
   ========================================================================== */
.perf-timezone {
  padding: 2px 4px 0;
  font-size: 11.5px;
  color: var(--text-3);
}

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 1150px) {
  .perf-filters { grid-template-columns: 1fr 1fr 1fr; }
  .perf-filters__export { grid-column: 3; justify-self: end; }
  .perf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .perf-bottom { grid-template-columns: 1fr 1fr; }
  .perf-bottom > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .perf-filters,
  .perf-kpis,
  .perf-bottom { grid-template-columns: 1fr; }
  .perf-filters__export { grid-column: auto; justify-self: stretch; }
  .perf-bottom > :last-child { grid-column: auto; }
}

/* Домен рядом с адресом страницы: в сводке по всем сайтам одинаковые
   пути с разных доменов иначе неразличимы */
.perf-host {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
}

.perf-table__row--active { background: var(--brand-soft); }
.perf-table tbody tr[data-page] { cursor: pointer; }
