/* Tradewind Dashboard — adapted from dashboard-mockup.html */
:root {
  --bg: #0b0e14;
  --panel: #141925;
  --panel2: #1b2230;
  --line: #262e3f;
  --txt: #e6ebf4;
  --muted: #8a97ad;
  --green: #3ad29f;
  --red: #ff6b6b;
  --gold: #e8b04b;
  --accent: #5b8cff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  padding: 0 0 48px;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Stale banner */
#stale-banner {
  background: rgba(255, 107, 107, .12);
  border-bottom: 1px solid rgba(255, 107, 107, .35);
  color: #ffaaaa;
  padding: 10px 20px;
  font-size: 13px;
  text-align: center;
}
#stale-banner[hidden] { display: none !important; }

/* Auth gate */
#auth-gate[hidden] { display: none !important; }
#dashboard[hidden] { display: none !important; }

.auth-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 16px;
}
.auth-wrap p { color: var(--muted); margin: 0; }

.btn-signin {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-signin:hover { opacity: .85; }

/* Header */
header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 0 18px;
  flex-wrap: wrap;
}

.logo { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.logo span { color: var(--accent); }

.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(232, 176, 75, .16);
  color: var(--gold);
  border: 1px solid rgba(232, 176, 75, .35);
}

.mode-select-wrap select {
  background: var(--panel2);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.asof { margin-left: auto; color: var(--muted); font-size: 13px; }

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
  vertical-align: middle;
}

/* Summary strip */
.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.card .k {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 7px;
}
.card .v { font-size: 23px; font-weight: 680; letter-spacing: -.01em; }
.v.sm { font-size: 19px; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* Main grid */
.grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }

@media (max-width: 840px) {
  .strip { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
}

/* Section panels */
.section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}
.section h2 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}

/* Chart */
.chartwrap { position: relative; }
.chartmeta { position: absolute; top: 0; right: 0; text-align: right; }
.chartmeta .big { font-size: 20px; font-weight: 680; }

#equity-chart svg { display: block; width: 100%; height: auto; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 0 10px 9px;
  border-bottom: 1px solid var(--line);
}
td { padding: 11px 10px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tk { font-weight: 650; }

.tag {
  display: inline-block;
  font-size: 11px;
  color: var(--muted);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  margin-right: 4px;
}

.side { font-weight: 700; font-size: 12px; letter-spacing: .04em; }
.scrollx { overflow-x: auto; }

/* Trades */
.trade {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.trade:last-child { border-bottom: none; }
.trade .when { color: var(--muted); font-size: 12px; min-width: 78px; }
.trade .body { flex: 1; }
.trade .head { font-size: 14px; margin-bottom: 2px; }
.trade .why { color: var(--muted); font-size: 12.5px; font-style: italic; }

/* Watchlist & status */
.wl { list-style: none; margin: 0; padding: 0; }
.wl li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.wl li:last-child { border-bottom: none; }
.wl .chg { font-variant-numeric: tabular-nums; }

.note {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

/* Empty / error states */
.empty-row td, .empty-msg {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}
.empty-row { text-align: center; }
.error-notice {
  background: rgba(255, 107, 107, .08);
  border: 1px solid rgba(255, 107, 107, .25);
  color: #ff9999;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* Footer */
footer {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}
footer b { color: var(--txt); font-weight: 600; }
