/* ═══ TABLE WRAP ═══ */
.table-wrap {
  width: 540px;
  min-width: 280px;
  background: var(--card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

/* ─── Table Tabs ─── */
.table-tabs {
  display: flex;
  gap: 0;
  padding: 5px 8px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--card);
}
.ttab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--faint);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  margin-bottom: -1px;
  font-family: inherit;
}
.ttab:hover { color: var(--dim); }
.ttab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

/* ─── Search ─── */
.table-top {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-wrap  { position: relative; flex: 1; }
.search-icon  { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--dim); font-size: 13px; pointer-events: none; }
.search-box   {
  background: var(--input); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px 7px 28px;
  font-size: 11px; color: var(--text); outline: none;
  width: 100%; font-family: inherit; transition: border-color 0.15s;
}
.search-box:focus { border-color: var(--accent); }
.search-box::placeholder { color: var(--faint); }
.hot-only-btn {
  flex-shrink: 0;
  height: 31px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: .12s;
}
.hot-only-btn:hover { color: var(--text); border-color: var(--dim); }
.hot-only-btn.on { color: #fff; border-color: rgba(246,70,93,.55); background: rgba(246,70,93,.22); box-shadow: 0 0 14px rgba(246,70,93,.14); }

/* ─── Container ─── */
.table-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--faint) transparent;
}
.table-container::-webkit-scrollbar       { width: 3px; }
.table-container::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 3px; }
.table-container::-webkit-scrollbar-track { background: transparent; }

/* ─── Table ─── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
}

/* ─── Column widths ─── */
th.th-fav,
td:first-child     { width: 22px; min-width: 22px; }
th:nth-child(2),
td:nth-child(2)    { width: 20%; }       /* Монета */
th:nth-child(3),
td:nth-child(3)    { width: 13%; }       /* Цена */
th:nth-child(4),
td:nth-child(4)    { width: 10%; }       /* 24ч% */
th:nth-child(5),
td:nth-child(5)    { width: 12%; }       /* Объём */
th:nth-child(6),
td:nth-child(6)    { width: 9%; }       /* Сделки */
th:nth-child(7),
td:nth-child(7)    { width: 7%; }        /* Вол */
th:nth-child(8),
td:nth-child(8)    { width: 10%; }       /* Фанд */
th:nth-child(9),
td:nth-child(9)    { width: 17%; }       /* Score */

/* ─── Headers ─── */
th {
  padding: 6px 4px;
  font-size: 9px;
  font-weight: 700;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: right;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.12s;
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 2;
}
th:hover          { color: var(--dim); }
th.sorted         { color: var(--accent); }
th[data-sort="signalScore"].sorted {
  color: #f0b90b;
  background: linear-gradient(180deg, rgba(240,185,11,.12), var(--card));
}
th.th-fav         { cursor: default; }
th:nth-child(2)   { text-align: left; padding-left: 2px; }

.sort-arr { font-size: 8px; margin-left: 2px; color: var(--accent); opacity: 0.7; }

/* ─── Rows ─── */
tr {
  cursor: pointer;
  transition: background 0.08s;
}
tr:hover td { background: rgba(108,142,191,0.04); }
tr.active td { background: rgba(108,142,191,0.06); }
tr.active td:nth-child(2) {
  border-left: 2px solid var(--accent);
  padding-left: 0;
}

/* ─── Cells ─── */
td {
  padding: 6px 4px;
  border-bottom: 1px solid rgba(42,47,58,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  vertical-align: middle;
}
td:first-child { padding: 6px 0; }

/* Монета */
.td-sym { text-align: left !important; }
.sym-name {
  font-weight: 600;
  font-size: 11px;
  color: var(--text);
  display: block;
  line-height: 1.2;
}
.sym-exch {
  font-size: 8px;
  color: var(--faint);
  font-weight: 500;
  letter-spacing: 0.05em;
}
.sym-mkt {
  display: inline-flex;
  gap: 1px;
  margin-left: 5px;
  vertical-align: middle;
}
.mkt-btn {
  font-size: 7px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  padding: 1px 3px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  line-height: 1;
  transition: all .12s;
}
.mkt-btn:hover { color: var(--text); border-color: var(--dim); background: var(--input); }
.mkt-btn.on { color: var(--accent); border-color: var(--accent); background: rgba(108,142,191,0.12); }

/* Листинг */
.listing-meta {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  flex-wrap: nowrap;
}
.lm-date {
  font-size: 9px;
  color: var(--faint);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.lm-tag {
  font-size: 7.5px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
}
.lm-exch { background: rgba(240,185,11,0.12); color: var(--gold, #f0b90b); }
.lm-mkt  { background: rgba(108,142,191,0.15); color: var(--faint); }
.lm-inline { vertical-align: middle; margin-left: 3px; }

/* Цена */
.td-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text);
}

/* Изменение */
.td-chg {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
}

/* Объём, Сделки */
.td-vol, .td-trades {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--dim);
}

/* Волатильность */
.td-vola {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--dim);
}

/* Фандинг */
.td-fund {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 500;
}

/* Signal Score */
.td-score {
  text-align: left;
  padding: 4px 4px;
}
.score-cell{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}
.td-score-badge {
  display: inline-block;
  min-width: 28px;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  cursor: default;
}
.score-meta{display:block;max-width:100%;font-size:8px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.score-dir{display:inline-flex;max-width:100%;font-size:8px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;border-radius:999px;padding:1px 5px;background:rgba(148,163,184,.12);color:var(--dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.score-dir.long_bias{background:rgba(46,189,133,.14);color:#2ebd85}
.score-dir.short_bias{background:rgba(246,70,93,.14);color:#f6465d}
.score-dir.neutral{background:rgba(240,185,11,.12);color:#f0b90b}
.score-reason{display:block;max-width:100%;font-size:8.5px;color:var(--faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.score-zero   { color: var(--faint); background: transparent; }
.score-neutral{ color: var(--dim);   background: rgba(150,160,180,0.10); }
.score-yellow { color: #e8c840;      background: rgba(232,200,64,0.15); }
.score-orange { color: #f08030;      background: rgba(240,128,48,0.18); }
.score-hot    { color: #f04040;      background: rgba(240,64,64,0.20);
                box-shadow: 0 0 6px rgba(240,64,64,0.35); }
.empty-row td{padding:28px 10px;text-align:center;color:var(--faint);font-size:12px;background:transparent!important}

/* Цвета */
.green { color: var(--green); }
.red   { color: var(--red);   }
.dim   { color: var(--dim);   }

/* ─── Favourite star ─── */
.fav-star {
  font-size: 15px;
  cursor: pointer;
  color: var(--faint);
  transition: all 0.15s;
  user-select: none;
  line-height: 1;
  display: inline-block;
}
.fav-star:hover        { color: var(--gold); transform: scale(1.2); }
.fav-star.active       { color: var(--gold); text-shadow: 0 0 8px rgba(240,185,11,0.4); }

/* ─── Pagination ─── */
.table-info {
  font-size: 9px;
  color: var(--faint);
  padding: 5px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 6px;
}
.table-info button {
  background: var(--input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 10px;
  transition: border-color 0.12s;
}
.table-info button:hover    { border-color: var(--accent); color: var(--accent); }
.table-info button:disabled { opacity: 0.3; cursor: default; }

/* ─── Favourites mode button ─── */
.fav-mode-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 14px;
  cursor: pointer;
  color: var(--faint);
  transition: all 0.15s;
  flex-shrink: 0;
  line-height: 1;
}
.fav-mode-btn:hover { border-color: var(--gold); color: var(--gold); }
.fav-mode-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(240,185,11,0.12); box-shadow: 0 0 8px rgba(240,185,11,0.15); }
