/* ==========================================================================
   sitemaps.css — страница «Карта сайта»
   ========================================================================== */

.sm-page {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* ==========================================================================
   Добавление sitemap
   ========================================================================== */
.sm-add {
  display: flex;
  gap: 12px;
}
.sm-add .field { flex: 1; min-width: 0; height: 46px; }
.sm-add .btn { height: 46px; padding: 0 24px; }

/* ==========================================================================
   Сводка
   ========================================================================== */
.sm-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--gap);
}

.sm-summary .stat-card { gap: 12px; padding: 14px; }
.sm-summary .stat-card__ico { width: 40px; height: 40px; }
.sm-summary .stat-card__ico .icon { width: 19px; height: 19px; }
.sm-summary .stat-card__value { font-size: 21px; }
.sm-summary .stat-card__label { font-size: 11.5px; }

/* ==========================================================================
   Таблица карт сайта
   ========================================================================== */
.sm-table-card { padding: 6px 16px; }

.sm-table { font-size: 12.5px; }

.sm-table th {
  padding: 14px 12px 12px;
  border-bottom: 1px solid var(--border);
}
.sm-table th:first-child { padding-left: 4px; }
.sm-table th:last-child  { padding-right: 4px; text-align: right; }

.sm-table td {
  padding: 13px 12px;
  border-top: 1px solid var(--border);
}
.sm-table td:first-child { padding-left: 4px; }
.sm-table td:last-child  { padding-right: 4px; text-align: right; }

.sm-table tbody tr:first-child td { border-top: 0; }

.sm-table tr.is-active td { background: var(--brand-soft); }

.sm-table .num { text-align: right; }

/* ==========================================================================
   Детали выбранной карты
   ========================================================================== */
.sm-details__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.sm-details__url {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sm-details__remove {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}
.sm-details__remove:hover { color: var(--red); }

.sm-details__tabs { margin-top: 14px; }

.sm-details__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: 16px;
  align-items: stretch;
}

.sm-panel {
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.sm-panel__title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

.sm-panel .deflist__key { width: 160px; }
.sm-panel .deflist__row { padding: 7px 0; }

.sm-panel__foot { margin-top: auto; padding-top: 12px; }

.sm-status--ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
}

/* вложенные sitemap */
.sm-nested { display: flex; flex-direction: column; gap: 12px; }

.sm-nested__item { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.sm-nested__item:last-child { border-bottom: 0; padding-bottom: 0; }

.sm-nested__url {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--brand);
  font-weight: 500;
}

.sm-nested__meta {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.sm-nested__col { font-size: 11px; color: var(--text-3); }
.sm-nested__col b { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.sm-nested__col--right { margin-left: auto; text-align: right; }

/* ==========================================================================
   Подпись внизу
   ========================================================================== */
.sm-note {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 4px;
  font-size: 12px;
  color: var(--text-2);
}
.sm-note .icon { color: var(--text-3); flex: none; }
.sm-note a { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 1150px) {
  .sm-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1050px) {
  .sm-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm-details__grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sm-summary { grid-template-columns: 1fr; }
  .sm-table-card { overflow-x: auto; }
  .sm-table { min-width: 820px; }
}

/* ==========================================================================
   Сводка по всем сайтам
   ========================================================================== */

.stat-card__ico--amber { background: var(--amber-soft); color: var(--amber); }

/* ==========================================================================
   Таблица сайтов
   ========================================================================== */

.sm-table th:nth-child(1) { width: auto; }
.sm-table th:nth-child(2) { width: 26%; }
.sm-table th:nth-child(3) { width: 130px; }
.sm-table th:nth-child(4) { width: 80px; }
.sm-table th:nth-child(5) { width: 140px; }
.sm-table th:nth-child(6) { width: 108px; }
.sm-table th:nth-child(7) { width: 110px; }

.sm-table tbody tr { cursor: pointer; }
.sm-table tbody tr.is-selected { background: var(--brand-soft); }
.sm-table tbody tr.is-selected:hover { background: var(--brand-soft-2); }

/* Адрес карты: домен виден в соседней колонке, здесь только путь */
.sm-feed {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-2);
}

.sm-feed__more {
  flex: none;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 10px;
  font-family: inherit;
}

/* ==========================================================================
   Список карт выбранного сайта
   ========================================================================== */

.sm-nested__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.sm-nested__row:last-child { border-bottom: 0; }

.sm-nested__row .sm-nested__url { flex: 1; min-width: 0; }

.sm-nested__count {
  flex: none;
  color: var(--text-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.sm-nested__del {
  flex: none;
  padding: 3px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-3);
  cursor: pointer;
}
.sm-nested__del:hover { background: var(--red-soft); color: var(--red); }

/* ==========================================================================
   События обхода
   ========================================================================== */

.events__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.events__row:last-child { border-bottom: 0; }

.events__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.events__time { flex: none; color: var(--text-3); font-size: 11px; }

@media (max-width: 900px) {
  .sm-table { min-width: 860px; }
  .sm-table-card { overflow-x: auto; }
}
