@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap");

:root {
  --bg: transparent;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #94a3b8;
  --muted2: #64748b;
  --brand: #1bac5d;
  --brand-soft: rgba(27, 172, 93, 0.1);
  --brand-soft-2: rgba(27, 172, 93, 0.2);
  --border: #f1f5f9;
  --surface: #f8fafc;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  padding: 8px;
}

.widget {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

@media (min-width: 820px) {
  .top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
}

.search {
  width: 100%;
  max-width: 240px;
  position: relative;
}

.search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--surface);
  border: none;
  border-radius: 15px;
  outline: none;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.search input::placeholder {
  color: #94a3b8;
}

.search input:focus {
  box-shadow: 0 0 0 3px var(--brand-soft-2);
}

.search .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94a3b8;
  transition: color 0.15s ease;
}

.search:focus-within .icon {
  color: var(--brand);
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.select {
  padding: 8px 10px;
  border: none;
  border-radius: 15px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  outline: none;
}

.select:focus {
  box-shadow: 0 0 0 3px var(--brand-soft-2);
}

.btn {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(0.99);
}

.count {
  font-size: 11px;
  font-weight: 900;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  white-space: nowrap;
}

.count strong {
  color: var(--brand);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-scroll {
  overflow: auto;
  max-height: 640px;
}

.trades-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

thead th {
  position: sticky;
  top: 0;
  background: rgba(248, 250, 252, 0.75);
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #94a3b8;
  text-align: left;
  white-space: nowrap;
}

.th-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.th-link:hover {
  color: var(--brand);
}

.th-link .icon {
  width: 12px;
  height: 12px;
  opacity: 0.18;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.th-link.is-active {
  color: var(--brand);
}

.th-link.is-active .icon {
  opacity: 1;
}

tbody td {
  border-bottom: 1px solid #f8fafc;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

tbody tr:hover td {
  background: rgba(248, 250, 252, 0.8);
}

.ticker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ticker-bar {
  width: 4px;
  height: 24px;
  border-radius: 999px;
  background: #e2e8f0;
}

.ticker-bar.positive {
  background: var(--brand);
}

.ticker-bar.negative {
  background: #fb7185;
}

.ticker-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ticker-symbol {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.05;
}

.type-label {
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.type-label.long {
  color: var(--brand);
}

.type-label.short {
  color: #818cf8;
}

.ticker-note {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}

.detail {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.price {
  font-size: 12px;
  font-weight: 800;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}

.date {
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
}

.pnl-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}

.pnl-chip.positive {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(27, 172, 93, 0.2);
}

.pnl-chip.negative {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(244, 63, 94, 0.16);
}

.pnl-chip .icon {
  width: 12px;
  height: 12px;
}

.actions {
  text-align: right;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #cbd5e1;
  background: transparent;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.icon-btn:hover {
  color: #0f172a;
  background: #ffffff;
  border-color: var(--border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.icon-btn .icon {
  width: 14px;
  height: 14px;
}

.footnote {
  margin-top: 12px;
  text-align: center;
  font-size: 10px;
  font-weight: 900;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.empty {
  padding: 22px 18px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.table-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 10px;
}

.table-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
}

@media (max-width: 560px) {
  .top {
    margin-bottom: 10px;
  }

  /* On very small widths, drop the action column. */
  .trades-table thead th:nth-child(5),
  .trades-table tbody td:nth-child(5) {
    display: none;
  }
}
