/* =============================================
   screening_stock — table.css
   ============================================= */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg2);
  min-height: 200px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
}

thead {
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}

th {
  padding: 11px 12px;
  text-align: left;
  font-size: 10px; font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
th.th-sort { cursor: pointer; transition: color 0.15s; }
th.th-sort:hover { color: var(--text2); }
th.th-sorted { color: var(--accent); }
th:first-child { padding-left: 16px; }
th.num { text-align: right; }

tbody tr {
  border-bottom: 1px solid rgba(36,47,74,0.5);
  cursor: pointer;
  transition: background 0.1s;
}
tbody tr:hover { background: var(--surface); }
tbody tr:last-child { border-bottom: none; }
tbody tr.fade-row { animation: fadeUp 0.3s ease both; }

td {
  padding: 11px 12px;
  font-size: 12px;
  vertical-align: middle;
}
td:first-child { padding-left: 16px; }
td.num { text-align: right; font-family: var(--font-mono); }

/* Stock name cell */
.td-sym {
  font-family: var(--font-mono); font-size: 13px;
  font-weight: 500; color: var(--accent); margin-bottom: 1px;
}
.td-name { font-size: 11px; color: var(--text2); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Inline bar */
.bar-cell { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.bar-cell .val { font-family: var(--font-mono); }
.bar-wrap {
  width: 50px; height: 3px;
  background: var(--surface2); border-radius: 2px; flex-shrink: 0;
}
.bar-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
}

/* Change cell */
.chg-cell {
  font-family: var(--font-mono); font-size: 12px;
  text-align: right; white-space: nowrap;
}
.chg-cell.up { color: var(--green); }
.chg-cell.dn { color: var(--red); }

/* Watchlist star */
.star-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 13px; padding: 2px;
  transition: color 0.15s, transform 0.15s;
  line-height: 1;
}
.star-btn:hover { color: var(--gold); transform: scale(1.2); }
.star-btn.on { color: var(--gold); }

/* N/A value */
.na { color: var(--text3); font-family: var(--font-mono); }

/* Live indicator dot */
.live-dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--green);
  margin-right: 4px; vertical-align: middle;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.3; }
}
