/* ============================================================
   style.css — Indodax Crypto Scanner PWA
   Premium Dark Glassmorphism Theme
   ============================================================ */

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

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:         #020817;
  --bg2:        #0f172a;
  --bg3:        #1e293b;
  --glass:      rgba(15, 23, 42, 0.7);
  --border:     rgba(255,255,255,0.08);
  --border2:    rgba(59,130,246,0.25);
  --blue:       #3b82f6;
  --blue-dim:   rgba(59,130,246,0.15);
  --green:      #10b981;
  --green-dim:  rgba(16,185,129,0.15);
  --red:        #ef4444;
  --red-dim:    rgba(239,68,68,0.15);
  --amber:      #f59e0b;
  --amber-dim:  rgba(245,158,11,0.15);
  --text:       #f1f5f9;
  --text2:      #94a3b8;
  --text3:      #475569;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(0,0,0,0.4);
}

:root[data-theme="light"] {
  --bg:         #f8fafc;
  --bg2:        #ffffff;
  --bg3:        #f1f5f9;
  --glass:      rgba(255, 255, 255, 0.85);
  --border:     rgba(0,0,0,0.08);
  --border2:    rgba(59,130,246,0.3);
  --text:       #0f172a;
  --text2:      #475569;
  --text3:      #94a3b8;
  --shadow:     0 4px 24px rgba(0,0,0,0.06);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 10% 10%, rgba(59,130,246,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 90%, rgba(16,185,129,0.04) 0%, transparent 50%);
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }

/* ── Header ────────────────────────────────────────────────── */
#app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(2, 8, 23, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--blue-dim);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.logo-icon.indodax-icon {
  background: transparent;
  border: none;
}
.logo-text { font-size: 15px; font-weight: 700; color: var(--text); }
.logo-sub  { font-size: 11px; color: var(--text2); font-weight: 400; }

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

/* Live badge */
.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg2);
  letter-spacing: .3px;
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text3);
}
.live-badge.live .live-dot {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
.live-badge.live { color: var(--green); border-color: rgba(16,185,129,0.3); }

@keyframes pulse-dot {
  0%,100% { opacity:1; transform: scale(1); }
  50%      { opacity:.6; transform: scale(1.3); }
}

/* Interval select */
.interval-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
}
select {
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
select:focus { border-color: var(--blue); }

/* Toggle auto-scan */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  user-select: none;
}
.toggle-track {
  width: 36px; height: 20px;
  background: var(--bg3);
  border-radius: 99px;
  position: relative;
  transition: background .2s;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.toggle-track.on { background: var(--blue); border-color: var(--blue); }
.toggle-thumb {
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px; left: 2px;
  transition: left .2s;
}
.toggle-track.on .toggle-thumb { left: 18px; }

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: #2563eb; box-shadow: 0 0 16px rgba(59,130,246,.4); }
.btn-ghost {
  background: var(--bg2);
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg3); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Install button */
#install-btn { display: none; }

/* Notification bell */
#notif-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: var(--radius-sm);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all .15s;
}
#notif-btn:hover { background: var(--bg3); color: var(--text); }
#notif-btn.active { color: var(--amber); border-color: rgba(245,158,11,.4); }

/* ── Countdown bar ─────────────────────────────────────────── */
#countdown-bar {
  height: 3px;
  background: var(--bg3);
  overflow: hidden;
}
#countdown-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  width: 100%;
  transition: width 1s linear;
}

/* ── Stats bar ─────────────────────────────────────────────── */
#stats-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.stat-card {
  background: var(--glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  text-align: center;
  transition: transform .15s, border-color .15s;
}
.stat-card:hover { transform: translateY(-1px); border-color: var(--border2); }
.stat-label { font-size: 10px; color: var(--text2); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.stat-val   { font-size: 20px; font-weight: 800; color: var(--blue); line-height: 1; }
.stat-val.green  { color: var(--green); }
.stat-val.red    { color: var(--red); }
.stat-val.amber  { color: var(--amber); }
.stat-val.small  { font-size: 14px; }

/* ── Toolbar ───────────────────────────────────────────────── */
#toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.toolbar-label { font-size: 12px; color: var(--text3); white-space: nowrap; }

#search-input {
  flex: 1;
  min-width: 140px;
  max-width: 220px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
#search-input::placeholder { color: var(--text3); }
#search-input:focus { border-color: var(--blue); }

.toolbar-sep { flex: 1; }

/* Filter chips */
.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
}
.chip:hover { background: var(--bg3); }
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip[data-f="strong-buy"].active  { background: #065f46; border-color: #10b981; }
.chip[data-f="buy"].active         { background: #064e3b; border-color: #34d399; }
.chip[data-f="hold"].active        { background: #422006; border-color: var(--amber); }
.chip[data-f="sell"].active        { background: #450a0a; border-color: #f87171; }
.chip[data-f="strong-sell"].active { background: #3b0202; border-color: var(--red); }

/* ── Main body layout ──────────────────────────────────────── */
#main-body {
  display: flex;
  height: calc(100vh - 60px - 3px - 70px - 48px);
  min-height: 400px;
  overflow: hidden;
}

/* ── Table area ────────────────────────────────────────────── */
#table-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.table-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
}

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

thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg2);
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color .12s;
}
thead th:hover { color: var(--text); }
thead th.sort-asc::after  { content: ' ↑'; color: var(--blue); }
thead th.sort-desc::after { content: ' ↓'; color: var(--blue); }
thead th:first-child { text-align: left; padding-left: 20px; cursor: default; }

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background .12s;
  animation: row-in .25s ease both;
}
tbody tr:hover { background: rgba(59,130,246,0.06); }
tbody tr.selected { background: rgba(59,130,246,0.10); border-left: 2px solid var(--blue); }

@keyframes row-in {
  from { opacity:0; transform: translateY(6px); }
  to   { opacity:1; transform: translateY(0); }
}

td {
  padding: 11px 14px;
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}
td:first-child { text-align: left; padding-left: 20px; }

.coin-sym  { font-weight: 700; font-size: 14px; color: var(--text); }
.coin-name { font-size: 11px; color: var(--text2); margin-top: 1px; }

.price-cell { font-family: 'Courier New', monospace; font-size: 12px; color: var(--text); }

.change-pos { color: var(--green); font-weight: 600; }
.change-neg { color: var(--red);   font-weight: 600; }
.change-neu { color: var(--text2); }

.rsi-low  { color: var(--green); font-weight: 700; }
.rsi-high { color: var(--red);   font-weight: 700; }
.rsi-mid  { color: var(--text);  font-weight: 600; }

.ema-bull { color: var(--green); font-weight: 600; }
.ema-bear { color: var(--red);   font-weight: 600; }

.score-pos { color: var(--green); font-weight: 700; }
.score-neg { color: var(--red);   font-weight: 700; }
.score-neu { color: var(--text2); font-weight: 600; }

.signal-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  border: 1px solid transparent;
}
.signal-badge.strong-buy  { background: rgba(16,185,129,.15); color: #6ee7b7; border-color: rgba(16,185,129,.3); }
.signal-badge.buy         { background: rgba(52,211,153,.12); color: #34d399; border-color: rgba(52,211,153,.25); }
.signal-badge.hold        { background: rgba(245,158,11,.12); color: #fbbf24; border-color: rgba(245,158,11,.25); }
.signal-badge.sell        { background: rgba(239,68,68,.12);  color: #f87171; border-color: rgba(239,68,68,.25); }
.signal-badge.strong-sell { background: rgba(239,68,68,.2);   color: #fca5a5; border-color: rgba(239,68,68,.35); }

.live-tag {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 4px;
  vertical-align: middle;
}

/* Empty / loading state */
.table-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 24px;
  color: var(--text3);
  font-size: 14px;
  text-align: center;
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--bg3);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton rows */
.skeleton-row td { padding: 14px; }
.skeleton {
  display: inline-block;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Detail sidebar ────────────────────────────────────────── */
#detail-panel {
  width: 0;
  overflow: hidden;
  transition: width .25s cubic-bezier(.4,0,.2,1);
  border-left: 0px solid var(--border);
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
#detail-panel.open {
  width: 280px;
  border-left-width: 1px;
  overflow-y: auto;
}

#detail-panel .dp-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
#dp-sym   { font-size: 26px; font-weight: 800; color: var(--text); }
#dp-name  { font-size: 12px; color: var(--text2); margin-top: 2px; }
#dp-signal { margin-top: 8px; }

#dp-close {
  background: var(--bg3);
  border: none;
  color: var(--text2);
  border-radius: var(--radius-sm);
  width: 28px; height: 28px;
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .12s;
}
#dp-close:hover { background: var(--border); color: var(--text); }

.dp-rows { padding: 12px 16px; flex: 1; }
.dp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
}
.dp-row:last-child { border-bottom: none; }
.dp-key   { color: var(--text2); font-size: 12px; }
.dp-val   { font-weight: 600; color: var(--text); }

.dp-legend { padding: 12px 16px; border-top: 1px solid var(--border); }
.dp-legend h4 { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.dp-legend-row { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 4px; }

.dp-disclaimer {
  padding: 12px 16px;
  font-size: 10px;
  color: var(--text3);
  line-height: 1.5;
  border-top: 1px solid var(--border);
}

/* ── Footer / status bar ───────────────────────────────────── */
#status-bar {
  padding: 8px 20px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--text3);
  flex-shrink: 0;
}
#status-text { flex: 1; }

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ── Toast notifications ───────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 60px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  pointer-events: all;
  animation: toast-in .25s ease both;
  max-width: 300px;
  line-height: 1.4;
}
.toast.buy  { border-left: 3px solid var(--green); }
.toast.sell { border-left: 3px solid var(--red); }
.toast .toast-title { font-weight: 700; margin-bottom: 3px; }
.toast .toast-body  { font-size: 12px; color: var(--text2); }
@keyframes toast-in {
  from { opacity:0; transform: translateX(16px); }
  to   { opacity:1; transform: translateX(0); }
}

/* ── PWA install banner ────────────────────────────────────── */
#install-banner {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  z-index: 998;
  gap: 12px;
  align-items: center;
  max-width: 380px;
  width: calc(100% - 32px);
}
#install-banner.show { display: flex; animation: toast-in .25s ease both; }
#install-banner-close {
  background: none; border: none; color: var(--text2);
  cursor: pointer; font-size: 18px; line-height: 1; padding: 0; margin-left: auto;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  #stats-bar { grid-template-columns: repeat(3,1fr); }
  #stats-bar .stat-card:nth-child(4),
  #stats-bar .stat-card:nth-child(5) { grid-column: span 1; }

  #app-header { height: 60px; padding: 0 8px; flex-wrap: nowrap; }
  .header-controls { flex-wrap: nowrap; overflow-x: visible; gap: 4px; justify-content: flex-end; }
  .hide-mobile { display: none; }
  .logo-icon { width: 28px; height: 28px; }
  .logo-icon img { width: 28px; height: 28px; }
  #theme-btn, #notif-btn { padding: 4px; }
  #install-btn, #scan-btn { padding: 4px 8px; font-size: 14px; }
  select { padding: 4px; }
  .toggle-track { width: 30px; height: 16px; }
  .toggle-thumb { width: 12px; height: 12px; }
  .toggle-track.on .toggle-thumb { left: 16px; }
  .logo-text { display: none; }
  .logo-sub { display: none; }
  .live-badge { display: none; }
  .interval-wrap > span { display: none; }
  .toggle-wrap > span { display: none; }
  .toggle-wrap > span { display: none; }

  #detail-panel.open { width: 100%; position: fixed; top:0; left:0; right:0; bottom:0; z-index:200; height:100dvh; border:none; }

  .toolbar-sep { display: none; }
  #search-input { max-width: 100%; }

  thead th:nth-child(5),
  td:nth-child(5),
  thead th:nth-child(6),
  td:nth-child(6) { display: none; }

  #main-body { height: calc(100dvh - 60px - 3px - 110px - 48px); }
}

@media (max-width: 480px) {
  #stats-bar { grid-template-columns: repeat(2,1fr); }
  #stats-bar .stat-card:last-child { grid-column: span 2; }
}

/* ── Tab pills ─────────────────────────────────────── */
.tab-pills { display: flex; gap: 4px; }
.tab-pill {
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  background: var(--bg2);
  color: var(--text2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .12s;
}
.tab-pill:hover { background: var(--bg3); color: var(--text); }
.tab-pill.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── Bot Panel ─────────────────────────────────────── */
.bot-card {
  background: var(--glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.bot-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.bot-title      { font-size: 15px; font-weight: 700; color: var(--text); }
.bot-card-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; }

.bot-config {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}
.config-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text2);
}
.config-val       { font-weight: 700; color: var(--text); }
.config-val.red   { color: var(--red); }
.config-val.green { color: var(--green); }

.bot-warning {
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11px;
  color: var(--amber);
  line-height: 1.5;
}

/* Positions */
.pos-empty { font-size: 12px; color: var(--text3); text-align: center; padding: 16px 0; }
.pos-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 12px;
}
.pos-header   { display: flex; justify-content: space-between; margin-bottom: 4px; }
.pos-sym      { font-weight: 700; font-size: 14px; color: var(--text); }
.pos-age      { font-size: 11px; color: var(--text3); }
.pos-detail   { color: var(--text2); margin-bottom: 2px; }
.pos-sl-tp    { display: flex; gap: 8px; margin: 6px 0; }
.sl-tag       { background: rgba(239,68,68,.12); color: var(--red); border: 1px solid rgba(239,68,68,.25); padding: 2px 8px; border-radius: 99px; font-size: 10px; font-weight: 600; }
.tp-tag       { background: rgba(16,185,129,.12); color: var(--green); border: 1px solid rgba(16,185,129,.25); padding: 2px 8px; border-radius: 99px; font-size: 10px; font-weight: 600; }
.pos-sell-btn { margin-top: 6px; padding: 4px 10px; font-size: 11px; }

/* Trailing TP */
.pos-tier-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  margin-bottom: 5px;
  background: rgba(100,116,139,.15);
  color: var(--text3);
  border: 1px solid rgba(100,116,139,.2);
}
.pos-tier-badge.tier-1 { background: rgba(16,185,129,.12); color: var(--green); border-color: rgba(16,185,129,.3); }
.pos-tier-badge.tier-2 { background: rgba(59,130,246,.12); color: var(--blue); border-color: rgba(59,130,246,.3); }
.pos-tier-badge.tier-3 { background: rgba(245,158,11,.12); color: var(--amber); border-color: rgba(245,158,11,.3); }

.pos-sl-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.trailing-badge {
  font-size: 10px;
  font-weight: 600;
  background: rgba(59,130,246,.12);
  color: var(--blue);
  border: 1px solid rgba(59,130,246,.25);
  padding: 1px 7px;
  border-radius: 99px;
}
.tp-milestones { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
.tp-milestone {
  font-size: 10px;
  color: var(--text3);
  background: var(--bg3);
  padding: 2px 7px;
  border-radius: 99px;
  cursor: default;
}
.tp-milestone.done { color: var(--green); background: rgba(16,185,129,.1); }

/* Balance */
.balance-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: 12px;
  color: var(--text2);
}
.balance-row:last-child { border-bottom: none; }
.balance-val { font-weight: 700; color: var(--text); }

/* Trade log */
.trade-log-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.log-item {
  font-size: 11px;
  color: var(--text2);
  padding: 5px 8px;
  background: var(--bg2);
  border-radius: 6px;
  line-height: 1.5;
}
.log-reason { display: block; color: var(--text3); font-size: 10px; }

/* ── Table Placeholder & Animations ────────────────────────────── */
.table-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text2);
  gap: 12px;
  animation: fade-in-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.placeholder-animation {
  position: relative;
  width: 60px;
  height: 60px;
  margin-bottom: 8px;
}
.placeholder-chart {
  width: 100%;
  height: 100%;
  color: var(--blue);
}
.placeholder-search {
  position: absolute;
  bottom: -4px;
  right: -8px;
  color: var(--green);
  background: var(--bg);
  border-radius: 50%;
  animation: scan-anim 2s infinite ease-in-out alternate;
  box-shadow: 0 0 0 4px var(--bg);
}

@keyframes scan-anim {
  0% { transform: translate(-24px, -24px) scale(0.9); }
  100% { transform: translate(4px, 4px) scale(1.1); }
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Splash Screen ───────────────────────────────────────────── */
#splash-screen {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease-out, visibility 0.5s;
}
.splash-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fade-in-up 0.8s ease-out;
}
.splash-logo {
  width: 80px; height: 80px;
  border-radius: 50%;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 174, 239, 0.2);
  animation: float-icon 3s ease-in-out infinite;
}
.splash-title {
  font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 6px;
}
.splash-subtitle {
  font-size: 13px; color: var(--text2); margin-bottom: 30px;
}
.splash-loader {
  width: 200px; height: 4px;
  background: var(--bg3);
  border-radius: 99px;
  overflow: hidden;
}
.splash-progress {
  width: 0%; height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  animation: load-progress 1.5s ease-in-out forwards;
}
@keyframes load-progress {
  0% { width: 0%; }
  100% { width: 100%; }
}
@keyframes float-icon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
