* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', 'Segoe UI', Roboto, sans-serif;
  background: #0f1419;
  color: #d1d4dc;
  font-size: 13px;
}

/* ── Auth pages ── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card {
  background: #1a1f29; padding: 40px; border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5); text-align: center; max-width: 400px; width: 100%;
}
.auth-card h1 { margin: 0 0 8px; color: #2962ff; }
.auth-card .sub { color: #787b86; margin: 0 0 28px; }
.auth-card .warn { background: #2a2018; color: #ffa726; padding: 12px; border-radius: 6px; font-size: 13px; margin-bottom: 20px; }
.btn-primary {
  background: #2962ff; color: white; border: none;
  padding: 14px 28px; border-radius: 8px; font-size: 15px;
  cursor: pointer; width: 100%; font-weight: 600;
}
.btn-primary:hover { background: #1e4db8; }
.msg { margin-top: 16px; color: #ef5350; font-size: 14px; min-height: 20px; }

/* ── Dashboard header ── */
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px; background: #131722; border-bottom: 1px solid #2a2e39;
}
header h1 { margin: 0; font-size: 16px; color: #2962ff; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 14px; }
.muted { color: #787b86; font-size: 12px; }
.btn-ghost {
  color: #787b86; text-decoration: none; font-size: 12px;
  padding: 5px 10px; border: 1px solid #2a2e39; border-radius: 4px;
}
.btn-ghost:hover { color: #d1d4dc; border-color: #434651; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.live { background: #26a69a; box-shadow: 0 0 6px #26a69a; }
.dot.dead { background: #ef5350; }

main { padding: 16px; max-width: 1600px; margin: 0 auto; }

/* ── Cards ── */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.card { background: #131722; border: 1px solid #2a2e39; border-radius: 6px; padding: 12px 14px; transition: border-color 0.2s; }
.card h3 { margin: 0 0 10px; font-size: 13px; color: #b2b5be; font-weight: 600; letter-spacing: 0.3px; }
.card.active { border-color: #26a69a; box-shadow: 0 0 0 1px #26a69a33; }
.card .row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; border-bottom: 1px solid #1e222d; }
.card .row:last-child { border-bottom: none; }
.card .row span { color: #787b86; }
.card .row b { color: #d1d4dc; font-weight: 500; font-variant-numeric: tabular-nums; }
.card .row b.long  { color: #26a69a; }
.card .row b.short { color: #ef5350; }
.card .row.trigger { margin-top: 6px; padding-top: 8px; border-top: 1px solid #2a2e39; border-bottom: none; }
.card .row.trigger span { color: #bb86fc; font-weight: 500; }
.card .row.trigger b { color: #d1d4dc; font-size: 11px; font-variant-numeric: tabular-nums; }

/* ── Chart section (TradingView look) ── */
.chart-section {
  background: #131722; border: 1px solid #2a2e39; border-radius: 6px;
  padding: 0; margin-bottom: 16px; overflow: hidden;
}
.chart-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid #2a2e39;
  background: #1a1e29;
}
.legend {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  font-size: 12px; color: #787b86;
  font-variant-numeric: tabular-nums;
}
.legend .lg-sym { color: #d1d4dc; font-weight: 600; font-size: 13px; }
.legend .lg-v { color: #787b86; }
.legend .lg-v b { color: #d1d4dc; font-weight: 500; margin-left: 4px; }
.legend .lg-rsi { color: #bb86fc; margin-left: auto; }
.legend .lg-rsi b { color: #bb86fc; font-weight: 600; margin-left: 4px; }

.tf-selector { display: flex; gap: 2px; }
.tf {
  background: transparent; color: #787b86; border: none;
  padding: 5px 10px; border-radius: 3px; cursor: pointer; font-size: 12px;
  font-weight: 500;
}
.tf.active { background: #2962ff; color: white; }
.tf:hover:not(.active) { background: #2a2e39; color: #d1d4dc; }

#chart { height: 500px; }
.rsi-label {
  padding: 4px 12px; font-size: 11px; color: #787b86;
  border-top: 1px solid #2a2e39; background: #131722;
}
#rsi-chart { height: 140px; }

/* ── Trades ── */
.trades { background: #131722; border: 1px solid #2a2e39; border-radius: 6px; padding: 14px; }
.trades h2 { margin: 0 0 12px; font-size: 14px; color: #b2b5be; font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #1e222d; }
th { color: #787b86; font-weight: 500; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
td { font-variant-numeric: tabular-nums; }
td.win { color: #26a69a; font-weight: 600; }
td.loss { color: #ef5350; font-weight: 600; }

@media (max-width: 700px) {
  main { padding: 8px; }
  header { padding: 8px 12px; }
  header h1 { font-size: 14px; }
  .card { padding: 10px; }
  #chart { height: 360px; }
  #rsi-chart { height: 100px; }
  .legend .lg-v { font-size: 11px; }
  .legend { gap: 8px; }
}
