/* Наживки — статистика уловов по водоёмам.
   Базовая тёмная тема и топбар — из style.css; здесь только раздел. */

/* ─────────────────────────── каркас ─────────────────────────── */

.baits-main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 16px 18px 56px;
}

.baits-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 14px;
  padding: 4px 2px 0;
}

.baits-kicker {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.baits-title {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 22px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: .2px;
}

.baits-lede {
  max-width: 720px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.baits-updated {
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ─────────────────────────── фильтры ─────────────────────────── */

.baits-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-1);
}

.baits-toolbar .field { min-width: 170px; }
.baits-toolbar .baits-search { flex: 1 1 260px; }

.baits-reset {
  align-self: flex-end;
  margin-left: auto;
  padding: 8px 14px;
  color: var(--muted);
}

/* ─────────────────────────── раскладка ─────────────────────────── */

.baits-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 302px;
  align-items: start;
  gap: 16px;
}

.baits-table-wrap { min-width: 0; }

.baits-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.baits-hint {
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.3;
  text-align: right;
}

/* ─────────────────────────── таблица ─────────────────────────── */

.baits-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-1);
}

.baits-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.baits-table thead th {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #131a1c;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .7px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.baits-table thead th.num { text-align: right; }

.baits-table thead th:nth-child(1) { width: 24%; }
.baits-table thead th:nth-child(2) { width: 32%; }
.baits-table thead th:nth-child(3),
.baits-table thead th:nth-child(4) { width: 9%; }
.baits-table thead th:nth-child(5),
.baits-table thead th:nth-child(6) { width: 13%; }

.th-sort {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: color .12s;
}
.th-sort::after {
  content: "↕";
  margin-left: 4px;
  color: #55655f;
  font-size: 9px;
  font-weight: 400;
}
.th-sort:hover { color: var(--text); }
.th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.baits-table th.is-sorted { color: #cdeed9; }
.baits-table th.is-sorted .th-sort::after { content: "↓"; color: var(--accent); }

.baits-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.4;
  vertical-align: top;
}

.baits-table tbody tr:last-child td { border-bottom: 0; }
.baits-table tbody tr:hover td { background: #141c1e; }

.baits-table tbody td.num {
  color: var(--text);
  font-family: var(--mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.cell-wb,
.cell-bait {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-wb { color: var(--text-dim); }
.cell-bait { color: var(--text); font-weight: 500; }

.bait-spot {
  display: inline-block;
  margin-top: 3px;
  padding: 0 5px;
  border: 1px solid #4a3f22;
  border-radius: 4px;
  background: #221d10;
  color: #cbb06a;
  font: 500 9.5px/1.5 var(--mono);
  letter-spacing: .2px;
}

.cell-catches { color: #b9e3c8; font-weight: 600; }
.cell-weight { color: var(--coords); }
.dash { color: var(--muted-2); }

/* ─────────────────────────── пусто / ошибка ─────────────────────────── */

.baits-empty {
  margin-top: 12px;
  padding: 42px 20px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}
.baits-empty h2 { margin-bottom: 6px; color: var(--text); font-size: 15px; font-weight: 600; }
.baits-empty p { margin-bottom: 15px; font-size: 12.5px; line-height: 1.55; }

.baits-table-wrap .loading-line { margin: 20px 0 8px; }
.baits-table-wrap .notice { margin: 12px 0 0; }

/* ─────────────────────────── топ-5 ─────────────────────────── */

.baits-top {
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
  padding: 12px 13px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #131a1c, #101516);
}

.baits-top-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line-soft);
}

.baits-top-title {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .1px;
}

.baits-top-sub {
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
}

.baits-top-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px;
  padding: 7px 4px;
  border-radius: 6px;
  transition: background-color .12s;
}
.top-item:hover { background: var(--bg-2); }

.top-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border: 1px solid #33543f;
  border-radius: 50%;
  background: #182720;
  color: #b9e3c8;
  font: 600 9.5px/1 var(--mono);
}
.top-item:nth-child(1) .top-rank {
  border-color: #6b5a2a;
  background: #241f12;
  color: #e3bc70;
}

.top-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.top-name {
  overflow: hidden;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-wb {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-bar {
  display: block;
  height: 3px;
  margin-top: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: #1b2528;
}
.top-bar > span {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #3c6b50, #6fc394);
}

.top-catches {
  padding-top: 1px;
  color: var(--coords);
  font: 600 10.5px/1.4 var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.baits-top-empty {
  padding: 16px 2px;
  color: var(--muted-2);
  font-size: 11.5px;
  text-align: center;
}

.baits-note {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px dashed var(--line-soft);
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.45;
}

/* ─────────────────────────── адаптив ─────────────────────────── */

@media (max-width: 1120px) {
  .baits-layout { grid-template-columns: minmax(0, 1fr); }
  .baits-top { position: static; order: -1; }
  .baits-top-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2px 8px;
  }
}

@media (max-width: 720px) {
  .baits-main { padding: 12px 10px 40px; }
  .baits-title { font-size: 19px; }
  .baits-toolbar { padding: 10px; }
  .baits-toolbar .field { min-width: 0; flex: 1 1 100%; }
  .baits-reset { margin-left: 0; width: 100%; }
  .baits-hint { display: none; }

  .baits-table-scroll { overflow: visible; border: 0; background: none; }
  .baits-table { display: block; }
  .baits-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .baits-table tbody { display: flex; flex-direction: column; gap: 8px; }
  .baits-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 10px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--bg-1);
  }
  .baits-table tbody td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 0;
    border: 0;
    font-size: 11.5px;
    text-align: left;
    white-space: normal;
  }
  .baits-table tbody tr:hover td { background: none; }
  .baits-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted-2);
    font: 600 9px/1.4 var(--sans);
    letter-spacing: .5px;
    text-transform: uppercase;
  }
  .baits-table tbody td:nth-child(1),
  .baits-table tbody td:nth-child(2) { grid-column: 1 / -1; }
  .baits-table tbody td:nth-child(2) { padding-bottom: 6px; }
  .baits-table tbody td:nth-child(1)::before,
  .baits-table tbody td:nth-child(2)::before { content: none; }
  .baits-table tbody td.num { text-align: right; }
  .cell-wb,
  .cell-bait {
    overflow: visible;
    white-space: normal;
    text-align: right;
    overflow-wrap: anywhere;
  }
  .cell-wb { font-weight: 600; }
  .bait-spot { margin-top: 0; }
}
