/* ==========================================================================
   dashboard.css — страница «Главная»
   Сетка строгая, по рядам:
     ряд 1 — 1 Сайты · 2 Трафик и позиции · 3 Подбор ключевых слов
     ряд 2 — 4 Индексация · 5 Индекс сайта · 6 Карта сайта
     ряд 3 — 7 Ссылки (2 колонки) · 9 Чистка выдачи
     ряд 4 — 8 Обход роботом (вся ширина)
     ряд 5 — 10 Чего нельзя (вся ширина)
   Карточки в одном ряду всегда одной высоты.
   ========================================================================== */

.dash {
  display: grid;
  grid-template-columns: 1fr 1.22fr 0.96fr;
  gap: var(--gap);
  align-items: stretch;
}

.dash > .card { min-width: 0; }

.dash__span-2 { grid-column: span 2; }
.dash__wide   { grid-column: 1 / -1; }

/* Номер блока в заголовке */
.card__num { color: var(--text); }

/* ==========================================================================
   1. Сайты
   ========================================================================== */
.sites__table td { padding: 8px 0; }
.sites__table .kebab { margin-left: auto; }
.sites__cell-actions { width: 30px; }

.sites__actions { margin-top: auto; }

/* ==========================================================================
   2. Трафик и позиции
   ========================================================================== */
.traffic__kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.traffic__chart-wrap { margin-top: 14px; }

.traffic__legend { justify-content: center; margin-bottom: 2px; }

.traffic__table { margin-top: 12px; }
.traffic__table th:first-child,
.traffic__table td:first-child { width: 100%; }

.traffic__more { margin-top: auto; padding-top: 12px; }

.traffic__more .btn {
  width: 100%;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--brand);
}
.traffic__more .btn:hover { border-color: var(--brand); background: var(--brand-soft); }

/* ==========================================================================
   3. Подбор ключевых слов
   ========================================================================== */
.kw__volume {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.kw__volume-text { flex: none; }

.kw__spark { flex: 1; min-width: 0; }

.kw__chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.kw__chips .chip--more { grid-column: 2; justify-self: end; width: 44px; }

.kw__section-title {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-3);
}

/* ==========================================================================
   4. Индексация
   ========================================================================== */
.idx__submit {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.idx__submit .field { flex: 1; min-width: 0; }

.idx__quotas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.idx__list-title {
  margin-top: 16px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-3);
}

.idx__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}

.idx__url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}

.idx__mark { flex: none; }
.idx__mark--ok   { color: var(--green); }
.idx__mark--wait { color: var(--brand); }
.idx__mark--err  { color: var(--red); }

/* ==========================================================================
   5. Индекс сайта
   ========================================================================== */
.index__search {
  display: flex;
  gap: 8px;
}
.index__search .field { flex: 1; min-width: 0; }

.index__filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.index__result {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.index__result-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.index__result-title { font-size: 13px; font-weight: 600; }

.index__code {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green);
}

.index__meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.index__meta-label { font-size: 11px; color: var(--text-3); }
.index__meta-value { margin-top: 2px; font-size: 12.5px; font-weight: 500; }

/* ==========================================================================
   6. Карта сайта
   ========================================================================== */
.sitemap__table td:first-child { width: 100%; }
.sitemap__table .cell-status { text-align: right; }

/* ==========================================================================
   7. Ссылки
   ========================================================================== */
.links__grid {
  display: grid;
  grid-template-columns: 0.62fr 1fr;
  gap: 18px;
}

.links__stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.links__donut {
  display: grid;
  place-items: center;
  margin-top: 4px;
}

.links__list-title {
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-3);
}

.links__table td:first-child { width: 100%; }

/* ==========================================================================
   8. Обход роботом — широкий блок
   ========================================================================== */
.crawl__grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.crawl__stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.crawl__issues-title,
.crawl__chart-title {
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-3);
}

.crawl__issue {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12.5px;
}

.crawl__issue-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}

.crawl__issue-count { font-weight: 600; white-space: nowrap; }

.crawl__issue-ico--err  { color: var(--red); }
.crawl__issue-ico--warn { color: var(--amber); }
.crawl__issue-ico--info { color: var(--brand); }

/* ==========================================================================
   9. Чистка выдачи
   ========================================================================== */
.cleanup__list { margin-top: 2px; }

/* ==========================================================================
   10. Чего нельзя
   ========================================================================== */
.limits { position: relative; overflow: hidden; }

.limits__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  position: relative;
  z-index: 1;
}

.limits__item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.limits__ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-2);
}

.limits__title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  line-height: 1.3;
}

.limits__text {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.4;
}

.limits__wave {
  position: absolute;
  right: -10px;
  bottom: -34px;
  width: 320px;
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 1400px) {
  .crawl__grid { grid-template-columns: 170px minmax(0, 1fr) 280px; gap: 18px; }
}

@media (max-width: 1150px) {
  .dash { grid-template-columns: 1fr 1fr; }
  .dash__span-2 { grid-column: span 2; }
  .limits__grid { grid-template-columns: repeat(2, 1fr); }
  .crawl__grid { grid-template-columns: 160px minmax(0, 1fr); }
  .crawl__issues { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .dash__span-2 { grid-column: auto; }
  .links__grid,
  .crawl__grid { grid-template-columns: 1fr; }
  .limits__grid { grid-template-columns: 1fr; }
  .limits__wave { display: none; }
}

.index__hint {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

/* Поле пакетной отправки: то же поле, что и для одного адреса, но
   многострочное — переключается вместе с режимом */
.idx__batch {
  min-height: 84px;
  padding: 8px 10px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}
