/* DASHBOARD LAYOUT */
.dash-layout {
  display: grid;
  grid-template-columns: 300px 1fr 280px;
  gap: 20px;
  padding: 88px 24px 24px;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

/* PANELS */
.panel {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* PORTFOLIO PANEL */
.panel-portfolio {
  position: sticky;
  top: 88px;
}

.total-value-block {
  background: var(--bg-alt);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius);
  padding: 20px;
}

.tv-label {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.tv-amount {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.tv-pnl {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pnl-badge {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}

.pnl-badge.positive {
  background: rgba(0, 230, 118, 0.15);
  color: var(--green);
}

.pnl-badge.negative {
  background: rgba(255, 77, 106, 0.15);
  color: var(--red);
}

.tv-pct {
  font-family: var(--font-head);
  font-size: 13px;
  color: var(--text-dim);
}

.portfolio-stats {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ps-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.ps-row:last-child { border-bottom: none; }

.ps-key {
  font-size: 13px;
  color: var(--text-dim);
}

.ps-val {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.ps-val.lime { color: var(--lime); }

.positions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pos-count {
  font-family: var(--font-head);
  font-size: 11px;
  color: var(--text-dim);
  background: var(--lime-glow);
  color: var(--lime);
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid rgba(180,255,0,0.15);
}

.positions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pos-card {
  background: var(--bg-alt);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s;
}

.pos-card:hover { border-color: rgba(180,255,0,0.15); }

.pos-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.pos-icon.btc { background: rgba(180,255,0,0.1); color: var(--lime); }
.pos-icon.eth { background: rgba(138, 43, 226, 0.15); color: #9B6DFF; }
.pos-icon.sol { background: rgba(153, 69, 255, 0.1); color: #B48FFF; }
.pos-icon.meme { background: rgba(255,77,106,0.1); color: var(--red); }
.pos-icon.alt { background: rgba(255,184,0,0.1); color: var(--yellow); }

.pos-info { flex: 1; min-width: 0; }
.pos-pair {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.pos-size {
  font-size: 11px;
  color: var(--text-dim);
}

.pos-return {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.pos-return.positive { color: var(--green); }
.pos-return.negative { color: var(--red); }

/* FEED PANEL */
.panel-feed {
  min-height: 600px;
}

.feed-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.feed-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}

.feed-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 500;
  color: var(--lime);
  padding: 4px 12px;
  border: 1px solid rgba(180,255,0,0.2);
  border-radius: 100px;
  background: var(--lime-glow);
}

.feed-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-2) transparent;
}

.feed-scroll::-webkit-scrollbar { width: 4px; }
.feed-scroll::-webkit-scrollbar-track { background: transparent; }
.feed-scroll::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 2px; }

.feed-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-alt);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 13px;
  animation: feed-slide-in 0.3s ease-out;
  transition: border-color 0.2s;
}

.feed-entry:hover { border-color: rgba(180,255,0,0.1); }
.feed-entry.new { border-color: rgba(180,255,0,0.2); background: rgba(180,255,0,0.03); }

@keyframes feed-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fe-timestamp {
  color: var(--text-muted);
  font-size: 11px;
  min-width: 60px;
}

.fe-signal {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  min-width: 52px;
  text-align: center;
}

.fe-signal.buy { background: rgba(0,230,118,0.15); color: var(--green); }
.fe-signal.sell { background: rgba(255,77,106,0.15); color: var(--red); }
.fe-signal.hold { background: rgba(255,184,0,0.1); color: var(--yellow); }

.fe-pair { color: var(--text); font-weight: 600; flex: 1; }
.fe-price { color: var(--text-dim); }
.fe-confidence {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--lime-glow);
  color: var(--lime);
  border: 1px solid rgba(180,255,0,0.1);
}

.fe-reason {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-weight: 400;
  flex: 0 0 auto;
}

/* SETTINGS PANEL */
.panel-settings {
  position: sticky;
  top: 88px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.setting-group:last-child { border-bottom: none; padding-bottom: 0; }

.sg-label {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.risk-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.risk-btn {
  background: var(--bg-alt);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.risk-btn:hover { border-color: rgba(180,255,0,0.2); color: var(--text); }

.risk-btn.active {
  background: var(--lime-dim);
  border-color: rgba(180,255,0,0.3);
  color: var(--lime);
}

.risk-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  padding: 8px 12px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  border-left: 2px solid rgba(180,255,0,0.3);
}

.mode-toggle {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.04);
}

.mt-label {
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mt-badge {
  font-family: var(--font-head);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--lime-glow);
  color: var(--lime);
  border: 1px solid rgba(180,255,0,0.15);
}

.mt-badge.live {
  background: rgba(255,77,106,0.1);
  color: var(--red);
  border-color: rgba(255,77,106,0.15);
}

/* Toggle switch */
.toggle-switch { position: relative; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-label {
  display: block;
  width: 40px;
  height: 22px;
  background: var(--surface-2);
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}
.toggle-label::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.2s;
}
.toggle-switch input:checked + .toggle-label { background: var(--lime-dim); border: 1px solid rgba(180,255,0,0.3); }
.toggle-switch input:checked + .toggle-label::after {
  left: 21px;
  background: var(--lime);
}

.mode-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 6px 0;
}

.dash-stats {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ds-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}

.ds-row:last-child { border-bottom: none; }
.ds-row span:first-child { color: var(--text-dim); }
.ds-row span:last-child {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--text);
}

.ds-row span:last-child.lime { color: var(--lime); }

.ai-model-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.04);
}

.model-name {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.model-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--green);
}

/* RESPONSIVE */
@media (max-width: 1100px) {
  .dash-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
  }
  .panel-portfolio { grid-column: 1; grid-row: 1; }
  .panel-settings { grid-column: 2; grid-row: 1; }
  .panel-feed { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 700px) {
  .dash-layout {
    grid-template-columns: 1fr;
    padding: 80px 16px 16px;
  }
  .panel-portfolio, .panel-settings, .panel-feed {
    grid-column: 1;
  }
  .panel-portfolio { grid-row: 1; }
  .panel-feed { grid-row: 2; }
  .panel-settings { grid-row: 3; }
}

/* Scrollbar for feed */
.feed-scroll::-webkit-scrollbar { width: 3px; }
.feed-scroll::-webkit-scrollbar-track { background: transparent; }
.feed-scroll::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 2px; }