/* ================= ТАБЛИЦА ================= */

.funding-table {
  width: 100% !important;
  min-width: 1050px;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

/* Порядок колонок:
   1: TOP m-cap
   2: Coin
   3: Exchange
   4: Live Fund
   5: Live Price
   6: Live APR
   7: Hist. Fund
   8: APR
   9: m-cap
   10: Payouts
   11: Time
*/

/* 1 и 2 скрыты, но даём разумные размеры */
.funding-table th:nth-child(1),
.funding-table td:nth-child(1) {
  width: 11ch !important; /* было 6ch */
}

.funding-table th:nth-child(2),
.funding-table td:nth-child(2) {
  width: 15ch !important; /* было 10ch */
}

/* EXCHANGE — ~16 символов */
.funding-table th:nth-child(3),
.funding-table td:nth-child(3) {
  width: 14ch !important; /* было 11ch */
}

/* LIVE FUND — ~12 символов */
.funding-table th:nth-child(4),
.funding-table td:nth-child(4) {
  width: 18ch !important; /* было 7ch */
}

/* LIVE PRICE — ~16 символов */
.funding-table th:nth-child(5),
.funding-table td:nth-child(5) {
  width: 19ch !important; /* было 11ch */
}

/* LIVE APR — ~15 символов */
.funding-table th:nth-child(6),
.funding-table td:nth-child(6) {
  width: 18ch !important; /* было 10ch */
}

/* HIST. FUND — ~16 символов */
.funding-table th:nth-child(7),
.funding-table td:nth-child(7) {
  width: 21ch !important; /* было 11ch */
}

/* APR — ~16 символов */
.funding-table th:nth-child(8),
.funding-table td:nth-child(8) {
  width: 21ch !important; /* было 11ch */
}

/* M-CAP (hidden) — +5ch */
.funding-table th:nth-child(9),
.funding-table td:nth-child(9) {
  width: 14ch !important;      /* было 9ch */
  max-width: 14ch !important;
  min-width: 14ch !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* PAYOUTS — ~12 символов */
.funding-table th:nth-child(10),
.funding-table td:nth-child(10) {
  width: 11ch !important; /* было 7ch */
}

/* TIME — ~12 символов */
.funding-table th:nth-child(11),
.funding-table td:nth-child(11) {
  width: 11ch !important; /* было 7ch */
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll .funding-table {
  min-width: 1050px;
}

/* монета */
.coin-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 2px 6px;
  transition:
    transform 0.12s ease-out,
    box-shadow 0.12s ease-out,
    background-color 0.12s ease-out;
}
.coin-logo {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  background: #020617;
  box-shadow: 0 0 0 1px rgba(15,23,42,0.9);
}
.coin-logo img {
  display: block;
  width: 100%;
  height: 100%;
}
.coin-name {
  color: #e5e7eb;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

/* биржа */
.ex-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 2px 6px;
  transition:
    transform 0.12s ease-out,
    box-shadow 0.12s ease-out,
    background-color 0.12s ease-out;
}
.ex-logo {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  background: #020617;
  box-shadow: 0 0 0 1px rgba(15,23,42,0.9);
}
.ex-logo img {
  display: block;
  width: 100%;
  height: 100%;
}
.ex-name {
  color: #e5e7eb;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

/* кликабельные ячейки (монеты и биржи) */
.cell-clickable {
  cursor: pointer;
  transform-origin: center left;
  transition:
    transform 0.14s ease-out,
    box-shadow 0.14s ease-out,
    background-color 0.14s ease-out;
}

/* сильнее зум при наведении на монету или биржу */
.cell-clickable:hover {
  transform: scale(1.08);
  background-color: var(--accent-soft);
  box-shadow:
    0 0 0 1px rgba(6,182,212,0.55),
    0 0 18px rgba(6,182,212,0.25);
}

.cell-clickable:hover .coin-name,
.cell-clickable:hover .ex-name {
  text-decoration: none;
  color: var(--text);
}

thead {
  background: rgba(31, 41, 55, 0.6);
}
th,
td {
  padding: 8px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(31, 41, 55, 0.7);
  white-space: nowrap;
  color: var(--text);
  font-weight: 500;
}
th:nth-child(2),
td:nth-child(2) {
  padding-right: 4px;
}

th:nth-child(3),
td:nth-child(3) {
  padding-left: 4px;
}

/* обрезаем содержимое в узких колонках */
.funding-table td:nth-child(3),
.funding-table td:nth-child(4),
.funding-table td:nth-child(5),
.funding-table td:nth-child(6),
.funding-table td:nth-child(7),
.funding-table td:nth-child(8),
.funding-table td:nth-child(10),
.funding-table td:nth-child(11) {
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #e5e7eb;
  font-weight: 800;
  background: transparent;
  border-radius: 0;
  border: none;
}
th.num,
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
th.num { font-weight: 800; }
td.num { font-weight: 600; }

.num-positive { color: var(--positive); }
.num-negative { color: var(--negative); }

/* TOP m-cap — цифры слева, перебиваем num */
.funding-table th.col-top-mcap,
.funding-table td.col-top-mcap {
  text-align: left !important;
}

/* скрываем колонки TOP, Coin и m-cap в таблице */
.funding-table th.col-top-mcap,
.funding-table td.col-top-mcap,
.funding-table th.col-coin,
.funding-table td.col-coin,
.funding-table th.col-mcap,
.funding-table td.col-mcap {
  display: none;
}

/* строка над группой монет */
tr.symbol-header td {
  padding: 2px 12px; /* было 6px – делаем компактнее, почти в одну строку */
  border-bottom: none;
  background: #020617 !important;
}
tr.symbol-header:hover {
  background: #020617 !important;
}

/* если вдруг есть разделительные строки – без лишнего вертикального воздуха */
tr.symbol-sep td {
  padding: 0;
  border-bottom: none;
  background: transparent !important;
}
.symbol-header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.symbol-header-rank {
  font-weight: 600;
  color: var(--accent);
}
.symbol-header-name {
  font-weight: 700;
  color: #e5e7eb;
}
.symbol-header-mcap {
  font-variant-numeric: tabular-nums;
}

/* funding / APR ячейки, на которые навешан график */
.funding-cell,
.apr-cell {
  cursor: help;
}

/* тултип с мини-графиком funding */
.funding-chart-tooltip {
  position: absolute;
  z-index: 1000;
  background: #020617;
  border-radius: 12px;
  border: 1px solid rgba(31,41,55,0.95);
  padding: 10px 14px 12px;
  box-shadow: 0 24px 50px rgba(15,23,42,0.96);
  font-size: 11px;
  line-height: 1.3;
  width: 900px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  color: var(--text);
}

.funding-chart-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.funding-chart-tooltip__title {
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.funding-chart-tooltip__note {
  margin-top: 4px;
  opacity: 0.6;
  font-size: 10px;
}

.funding-chart-tooltip svg {
  display: block;
  width: 100%;
  height: 320px;
}

/* сортируемые заголовки и стрелка */
th.th-sortable {
  cursor: pointer;
  user-select: none;
}
.th-arrow {
  font-size: 11px;
  margin-left: 4px;
  opacity: 0.85;
}

tbody tr:nth-child(2n) {
  background: rgba(15,23,42,0.8);
}
tbody tr:hover {
  background: rgba(30,64,175,0.35);
}
tr.symbol-sep td {
  padding: 6px 0;
  border-bottom: none;
  background: transparent !important;
}
tr.symbol-sep:hover {
  background: transparent !important;
}

.pager {
  display: flex;
  align-items: center;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(31,41,55,0.9);
  font-size: 12px;
  color: var(--muted);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 8px;
  justify-content: center;
  position: relative;
}
#pagerLabel {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 0;
  flex: 0 0 auto;
}
.pager-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  margin-left: 0;
  background: transparent;
  border: none;
  padding: 0;
  justify-content: center;
}
.pager-btn {
  border: none;
  outline: none;
  background: transparent;
  border-radius: 999px;
  padding: 8px 14px;
  min-width: 34px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}
.pager-btn:hover {
  background: rgba(244, 214, 170, 0.18);
  color: #f9fafb;
  transform: translateY(-1px);
}
.pager-btn--active {
  background: #e2c9a3;
  color: #111827;
  box-shadow:
    0 0 0 1px rgba(226, 201, 163, 0.45),
    0 0 14px rgba(226, 201, 163, 0.22);
}
.pager-btn--active:hover {
  background: #e9d4b5;
}
.pager-btn--arrow {
  padding-inline: 18px;
  font-size: 20px;
  min-width: 44px;
}
.pager-btn[disabled] {
  opacity: 0.35;
  cursor: default;
  transform: none;
}
.pager-ellipsis {
  padding: 0 4px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

thead #thTotalFunding,
thead #thApr {
  /* шапка Hist. Fund / APR — прозрачный жёлтый */
  background-color: rgba(250, 204, 21, 0.18) !important;
}

.funding-table td.funding-cell,
.funding-table td.apr-cell {
  /* сами ячейки колонок Hist. Fund / APR */
  background-color: rgba(250, 204, 21, 0.10);
}

/* при наведении на строку делаем эти две колонки чуть ярче */
tbody tr:hover td.funding-cell,
tbody tr:hover td.apr-cell {
  background-color: rgba(250, 204, 21, 0.22);
}