/* === DASHBOARD === */
.dash-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 4vw 6rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* === HEADER === */
.dash-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}

.dash-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  margin: 0.25rem 0 0.5rem;
}

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

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 229, 160, 0.1);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--accent);
}

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

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.epoch-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
}

.epoch-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.epoch-val {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* === COVERAGE PANEL === */
.coverage-panel {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 0 60px rgba(0, 229, 160, 0.04);
}

.coverage-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.cov-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.cov-pct {
  font-family: 'Syne', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}

.cov-sub {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.coverage-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.donut-wrap {
  position: relative;
  width: 180px;
  height: 180px;
}

.donut-chart {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-track {
  stroke: var(--surface-2);
}

.donut-fill {
  stroke: var(--accent);
  stroke-dasharray: 0 515;
  stroke-linecap: round;
  transition: stroke-dasharray 1.2s cubic-bezier(0.4, 0, 0.2, 1),
              stroke 0.4s ease;
  filter: drop-shadow(0 0 10px rgba(0, 229, 160, 0.4));
}

.donut-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.accent { background: var(--accent); }
.legend-dot.red { background: var(--down); }

.legend-key { color: var(--text-muted); flex: 1; }
.legend-val { font-family: 'DM Mono', monospace; font-weight: 600; color: var(--text); }

/* === BUFFER PANEL === */
.buffer-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

.buffer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.buffer-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.buffer-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.buffer-bar-track {
  position: relative;
  height: 10px;
  background: var(--surface-2);
  border-radius: 5px;
  overflow: visible;
  margin-bottom: 0.75rem;
}

.buffer-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 5px;
  box-shadow: 0 0 12px rgba(0, 229, 160, 0.35);
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 2px;
}

.buffer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.buffer-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.buffer-pct {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
}

/* === METRICS ROW === */
.metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

.metric-card-header {
  margin-bottom: 1.25rem;
}

.metric-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Twin blocks (Reserves vs Liabilities) */
.metric-twin {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.twin-block {
  flex: 1;
  padding: 0.5rem 0;
}

.twin-sep {
  width: 1px;
  background: var(--border);
  margin: 0 1.5rem;
  align-self: stretch;
}

.twin-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.twin-val {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.35rem;
}

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

.twin-block.reserve .twin-val { color: var(--accent); }

/* PnL row */
.pnl-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.pnl-side {
  flex: 1;
}

.pnl-dir-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.pnl-val {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--down);
}

.pnl-val.up { color: var(--accent); }

.pnl-vs {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.net-exposure-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.net-exp-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.net-exp-val {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.net-exp-dir {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.net-exp-dir.long {
  background: rgba(0, 229, 160, 0.12);
  color: var(--accent);
}

.net-exp-dir.short {
  background: rgba(255, 77, 109, 0.1);
  color: var(--down);
}

/* === MARKETS PANEL === */
.markets-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

.markets-header {
  margin-bottom: 1rem;
}

.markets-table {
  width: 100%;
}

.markets-thead {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 0.8fr 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}

.markets-thead span {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.markets-body {
  display: flex;
  flex-direction: column;
}

.market-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 0.8fr 1fr;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 6px;
  transition: background 0.15s;
  align-items: center;
}

.market-row:hover {
  background: var(--surface-2);
}

.market-row + .market-row {
  border-top: 1px solid var(--border);
}

.mr-symbol {
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
}

.mr-longs, .mr-shorts, .mr-net {
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.mr-spread {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
}

.mr-cov {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
}

.up { color: var(--up); }
.down { color: var(--down); }
.accent { color: var(--accent); }
.warn { color: #FFB340; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .dash-wrap { padding: 1.5rem 4vw 4rem; }
  .coverage-panel { grid-template-columns: 1fr; padding: 1.5rem; }
  .coverage-right { flex-direction: row; justify-content: flex-start; }
  .donut-wrap { width: 140px; height: 140px; }
  .metrics-row { grid-template-columns: 1fr; }
  .markets-thead, .market-row { grid-template-columns: 1fr 1fr 1fr; }
  .markets-thead span:nth-child(5),
  .markets-thead span:nth-child(6),
  .market-row .mr-spread,
  .market-row .mr-cov { display: none; }
}

@media (max-width: 480px) {
  .dash-header { flex-direction: column; align-items: flex-start; }
  .cov-pct { font-size: 2.75rem; }
  .coverage-right { gap: 1rem; }
}