/* dashboard.css — full-featured trading dashboard (v2) */

.dashboard-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
}

/* ──────────────────────────────────────────────────────────── NAV */
.dash-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.dash-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.dash-brand-pulse {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.dash-nav-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(0, 229, 160, 0.25);
  border-radius: 4px;
  padding: 3px 10px;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

.dash-sim-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dash-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.dash-home-link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.dash-home-link:hover { color: var(--text-primary); }

/* ──────────────────────────────────────────────────────────── STATS BAR */
.dash-stats-bar {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 12px;
  max-width: 1400px;
  margin: 20px auto 0;
  padding: 0 24px;
}

.dash-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  transition: border-color 0.3s;
}

.dash-stat-highlight {
  border-color: rgba(0, 229, 160, 0.2);
  background: linear-gradient(135deg, rgba(0, 229, 160, 0.05) 0%, var(--bg-card) 60%);
}

.dash-stat-card:hover { border-color: rgba(0, 229, 160, 0.3); }

.dash-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.dash-stat-value {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.dash-stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dash-stat-value.positive { color: var(--green); }
.dash-stat-value.negative { color: var(--red); }

@keyframes balancePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06); color: var(--accent); }
  100% { transform: scale(1); }
}
.balance-pop { animation: balancePop 0.5s ease; }

/* ──────────────────────────────────────────────────────────── DEPOSIT STRIP */
.dash-deposit-strip {
  max-width: 1400px;
  margin: 14px auto 0;
  padding: 0 24px;
}

.dash-deposit-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.deposit-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.deposit-input-row {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}

.deposit-currency {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.deposit-input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-right: none;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}
.deposit-input:focus { border-color: rgba(0, 229, 160, 0.4); }
.deposit-input::-webkit-inner-spin-button,
.deposit-input::-webkit-outer-spin-button { opacity: 0; }

.deposit-btn {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 9px 18px;
  color: #0a0a0f;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
  line-height: 1.4;
}
.deposit-btn:hover  { background: var(--accent-dim); }
.deposit-btn:active { transform: scale(0.98); }
.deposit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.deposit-flash {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  min-width: 160px;
  opacity: 0;
  transition: opacity 0.3s;
}
.deposit-flash.show { opacity: 1; }

/* ──────────────────────────────────────────────────────────── DEPOSIT PRESETS */
.deposit-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.deposit-preset {
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}
.deposit-preset:hover {
  border-color: rgba(0, 229, 160, 0.4);
  color: var(--accent);
  background: var(--accent-glow);
}
.deposit-preset:active { transform: scale(0.96); }

/* ──────────────────────────────────────────────────────────── P&L SPARKLINE */
.pnl-spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
  margin-top: 8px;
  overflow: hidden;
}

.pnl-spark-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-width: 2px;
  transition: height 0.4s ease;
}

/* ──────────────────────────────────────────────────────────── ALLOCATION BAR */
.alloc-bar-wrap {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
}

.alloc-bar-labels {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.alloc-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.alloc-label-btc { color: #f7931a; }
.alloc-label-eth { color: #627eea; }
.alloc-label-sol { color: #9945ff; }
.alloc-label-bnb { color: #f3ba2f; }
.alloc-label-xrp { color: #00acc1; }

.alloc-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  gap: 1px;
  background: var(--bg-elevated);
}

.alloc-seg {
  border-radius: 3px;
  transition: width 0.6s ease;
}
.alloc-seg-btc { background: #f7931a; }
.alloc-seg-eth { background: #627eea; }
.alloc-seg-sol { background: #9945ff; }
.alloc-seg-bnb { background: #f3ba2f; }
.alloc-seg-xrp { background: #00acc1; }

/* ──────────────────────────────────────────────────────────── MAIN GRID */
.dash-main {
  max-width: 1400px;
  margin: 14px auto 0;
  padding: 0 24px 28px;
  display: grid;
  grid-template-columns: 260px 340px 1fr;
  gap: 12px;
  flex: 1;
  align-items: start;
}

.dash-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dash-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.dash-panel-title {
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: -0.01em;
}

/* ──────────────────────────────────────────────────────────── PRICE LIST */
.price-updated {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.price-list { display: flex; flex-direction: column; }

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(34, 34, 51, 0.6);
  transition: background 0.2s;
}
.price-row:last-child { border-bottom: none; }
.price-row:hover { background: var(--bg-elevated); }
.price-row.flash-up   { background: rgba(0, 229, 160, 0.07); }
.price-row.flash-down { background: rgba(255, 68, 102, 0.07); }

.price-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.price-coin-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.price-coin-btc { background: rgba(247,147,26,0.15); color: #f7931a; }
.price-coin-eth { background: rgba(98,126,234,0.15); color: #627eea; }
.price-coin-sol { background: rgba(153,69,255,0.15); color: #9945ff; }
.price-coin-bnb { background: rgba(243,186,47,0.15); color: #f3ba2f; }
.price-coin-xrp { background: rgba(0,172,193,0.15);  color: #00acc1; }

.price-coin-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.price-coin-ticker {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.price-row-right { text-align: right; }

.price-row-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.price-row-change {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  margin-top: 2px;
}
.price-row-change.up   { color: var(--green); }
.price-row-change.down { color: var(--red); }

.price-mini-chart {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chart-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.chart-bar-row {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
}

.chart-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  transition: height 0.4s ease;
}

/* ──────────────────────────────────────────────────────────── BOT PANEL */
.bot-status-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(0,229,160,0.3);
  transition: all 0.3s;
}
.bot-status-badge.analyzing {
  background: rgba(255,187,51,0.12);
  color: var(--amber);
  border-color: rgba(255,187,51,0.3);
}
.bot-status-badge.executing {
  background: rgba(0,229,160,0.2);
  border-color: var(--accent);
  animation: badgePulse 0.5s ease;
}
@keyframes badgePulse {
  0%   { box-shadow: 0 0 0 0 rgba(0,229,160,0.5); }
  100% { box-shadow: 0 0 0 8px rgba(0,229,160,0); }
}

.bot-panel {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.bot-thinking {
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  min-height: 66px;
}

.bot-scan-line {
  position: absolute;
  top: 0; left: -60%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,229,160,0.08), transparent);
  animation: scanLine 2.4s linear infinite;
}
@keyframes scanLine {
  0%   { left: -60%; }
  100% { left: 140%; }
}

.bot-status-text {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.bot-dots {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  position: relative;
  z-index: 1;
}

.bot-dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  animation: dotBounce 1.4s ease-in-out infinite;
  opacity: 0.4;
}
.bot-dot:nth-child(2) { animation-delay: 0.2s; }
.bot-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.3; }
  40%            { transform: scale(1.1); opacity: 1; }
}

.bot-last-action { display: flex; flex-direction: column; gap: 3px; }

.bot-action-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bot-action-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ──────────────────────────────────────────────────────────── RISK SELECTOR */
.risk-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.risk-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.risk-pills { display: flex; gap: 6px; }

.risk-pill {
  flex: 1;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  text-align: center;
}
.risk-pill:hover { border-color: rgba(0,229,160,0.3); color: var(--text-primary); }
.risk-pill.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.risk-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
  min-height: 1rem;
}

/* ──────────────────────────────────────────────────────────── HOLDINGS */
.holdings-section { display: flex; flex-direction: column; }

.holdings-header {
  padding: 10px 16px 6px;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.holding-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid rgba(34,34,51,0.6);
  transition: background 0.2s;
}
.holding-row:hover { background: var(--bg-elevated); }

.holding-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.holding-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.holding-icon-btc { background: rgba(247,147,26,0.15); color: #f7931a; }
.holding-icon-eth { background: rgba(98,126,234,0.15); color: #627eea; }
.holding-icon-sol { background: rgba(153,69,255,0.15); color: #9945ff; }
.holding-icon-bnb { background: rgba(243,186,47,0.15); color: #f3ba2f; }
.holding-icon-xrp { background: rgba(0,172,193,0.15);  color: #00acc1; }

.holding-name {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-primary);
}

.holding-qty {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
}

.holding-right { text-align: right; }

.holding-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.holding-pct {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
}

/* ──────────────────────────────────────────────────────────── TRADE FEED */
.trade-count-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 3px 10px;
  border-radius: 100px;
}

.trade-feed {
  flex: 1;
  overflow-y: auto;
  max-height: 640px;
}

.trade-feed-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.trade-feed-header {
  display: grid;
  grid-template-columns: 52px 48px 82px 1fr 70px 64px;
  gap: 6px;
  padding: 7px 16px;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 2;
}

.trade-row {
  display: grid;
  grid-template-columns: 52px 48px 82px 1fr 70px 64px;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(34,34,51,0.5);
  transition: background 0.15s;
  animation: fadeSlide 0.3s ease;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.trade-row:hover { background: var(--bg-elevated); }

.trade-time {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
}

.trade-side {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
}

.trade-side.buy  { background: rgba(0,229,160,0.1); color: var(--green); }
.trade-side.sell { background: rgba(255,68,102,0.1); color: var(--red); }

.trade-pair {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-primary);
  font-weight: 500;
}

.trade-price {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.trade-amount {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.trade-pnl {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  text-align: right;
}
.trade-pnl.pos { color: var(--green); }
.trade-pnl.neg { color: var(--red); }

/* ──────────────────────────────────────────────────────────── FOOTER */
.dash-footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ──────────────────────────────────────────────────────────── RESPONSIVE */
@media (max-width: 1100px) {
  .dash-main {
    grid-template-columns: 240px 1fr;
    grid-template-rows: auto auto;
  }
  .dash-panel-center {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .dash-stats-bar { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash-main { grid-template-columns: 1fr; }
  .dash-panel-center { grid-column: 1; }
  .dash-sim-note { display: none; }
  .trade-feed { max-height: 400px; }
  .trade-feed-header,
  .trade-row { grid-template-columns: 48px 44px 76px 1fr 60px; }
  .trade-row .trade-amount { display: none; }
}

@media (max-width: 480px) {
  .dash-nav-inner { padding: 0 14px; }
  .dash-stats-bar,
  .dash-deposit-strip,
  .dash-main { padding-left: 14px; padding-right: 14px; }
  .dash-stat-value { font-size: 1.3rem; }
}
