/* ==========================================================================
   crawl.css — страница «Обход роботом»
   ========================================================================== */

.cr-page {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* ==========================================================================
   Сводка
   ========================================================================== */
.cr-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--gap);
}

.cr-summary .stat-card { gap: 12px; padding: 14px; }
.cr-summary .stat-card__ico { width: 40px; height: 40px; }
.cr-summary .stat-card__ico .icon { width: 19px; height: 19px; }
.cr-summary .stat-card__label { font-size: 11.5px; }
.cr-summary .stat-card__value { font-size: 21px; }

.stat-card__unit {
  margin-left: 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
}

/* ==========================================================================
   Статистика обхода
   ========================================================================== */
.cr-stats__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 12px;
  font-size: 11.5px;
  color: var(--text-2);
}

.cr-stats__legend-item { display: inline-flex; align-items: center; gap: 7px; }

.cr-stats__swatch {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 2px;
}

.cr-stats__swatch--line {
  width: 16px;
  height: 0;
  border-radius: 0;
  border-top: 2px solid var(--brand);
  position: relative;
}
.cr-stats__swatch--line::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1.5px solid var(--brand);
  background: #fff;
}

.cr-stats__axis-name {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--text-2);
}

.cr-stats .chart-frame { grid-template-columns: 40px minmax(0, 1fr) 40px; }
.cr-stats .chart-xlabels { margin: 8px 40px 0 40px; }

/* ==========================================================================
   Ряды карточек
   ========================================================================== */
.cr-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gap);
  align-items: stretch;
}

.cr-row--wide { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }

/* --- проблемы --- */
.cr-issues__table td:first-child,
.cr-issues__table th:first-child { width: 100%; }

.cr-issues__name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.cr-issues__name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cr-issues__ico--err  { color: var(--red); flex: none; }
.cr-issues__ico--warn { color: var(--amber); flex: none; }
.cr-issues__ico--info { color: var(--brand); flex: none; }

.cr-issues__example {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  white-space: nowrap;
}

/* --- скорость обхода --- */
.cr-speed__current {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}

.cr-speed__legend {
  display: flex;
  gap: 18px;
  margin: 14px 0 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-2);
}

.cr-speed__bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 96px;
}

.cr-speed__bar {
  flex: 1;
  min-width: 0;
  border-radius: 3px 3px 0 0;
  background: #c7dcfb;
  transition: background .14s ease;
}
.cr-speed__bar--mid  { background: var(--brand); }
.cr-speed__bar--high { background: #22c55e; }
.cr-speed__bar { cursor: pointer; }
.cr-speed__bar:hover { filter: brightness(0.92); }

.cr-speed__hours {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 10.5px;
  color: var(--text-3);
}

/* ползунок диапазона */
.cr-speed__range {
  position: relative;
  height: 6px;
  margin: 16px 0 8px;
  border-radius: var(--r-pill);
  background: #e3ebf6;
}

.cr-speed__range-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 26%;
  right: 26%;
  border-radius: var(--r-pill);
  background: var(--brand);
}

.cr-speed__knob {
  position: absolute;
  top: 50%;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
  margin-left: -7.5px;
  border: 2px solid var(--brand);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 30, 54, .25);
  cursor: grab;
}

.cr-speed__hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
}

.cr-speed__foot {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}
.cr-speed__foot .btn:last-child { margin-left: auto; }

/* --- активность робота --- */
.cr-activity__table { font-size: 12px; }
.cr-activity__table td { padding: 10px 0; }
.cr-activity__table td + td,
.cr-activity__table th + th { padding-left: 14px; }

.cr-activity__url {
  display: block;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--brand);
}

.cr-activity__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.cr-activity__status--ok   { color: var(--green); }
.cr-activity__status--err  { color: var(--red); }
.cr-activity__status--warn { color: var(--amber); }
.cr-activity__status--info { color: var(--brand); }
.cr-activity__status b { font-weight: 500; color: var(--text-2); }

/* --- информация --- */
.cr-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.cr-info__item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding-left: 18px;
  border-left: 1px solid var(--border);
}
.cr-info__item:first-child { padding-left: 0; border-left: 0; }

.cr-info__ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--brand);
}

.cr-info__label { font-size: 11.5px; color: var(--text-3); }
.cr-info__value { margin-top: 2px; font-size: 13px; font-weight: 600; }
.cr-info__note  { margin-top: 1px; font-size: 11.5px; color: var(--text-3); }
.cr-info__link  { margin-top: 1px; font-size: 11.5px; font-weight: 500; color: var(--brand); }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 1150px) {
  .cr-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1050px) {
  .cr-row,
  .cr-row--wide { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .cr-summary { grid-template-columns: 1fr; }
  .cr-info { grid-template-columns: 1fr; }
  .cr-info__item { padding-left: 0; border-left: 0; }
}
