/* ============================================================
   MEF — Dashboard (RobinHood Chain / ETH)
   Reutiliza las variables y el header de styles.css
   ============================================================ */

.dash {
  padding: clamp(1.5rem, 3vw, 3rem) clamp(1.2rem, 4vw, 4rem) 4rem;
  max-width: 1500px;
  margin-inline: auto;
}

/* --- Encabezado --- */
.dash-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem 1.4rem;
  margin-bottom: 1.6rem;
}
.dash-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  color: var(--pink);                /* acento violeta */
  line-height: 1;
  border-bottom: 4px solid var(--pink);
  padding-bottom: 0.15em;
  letter-spacing: 0.01em;
}
.chain-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--cream);
  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(124, 58, 237, 0.45);
  padding: 0.45em 0.9em;
  border-radius: 999px;
}
.chain-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
  animation: live-pulse 2s ease-in-out infinite;
}

/* --- Panel base --- */
.panel {
  position: relative;
  background: linear-gradient(160deg, #26221d, #1e1b16);
  border: 1px solid rgba(232, 213, 176, 0.09);
  border-radius: 18px;
  padding: clamp(1.1rem, 2vw, 1.6rem);
  overflow: hidden;
}
.panel-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  color: var(--cream);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

/* --- Barra de métricas --- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: linear-gradient(160deg, #26221d, #1e1b16);
  border: 1px solid rgba(232, 213, 176, 0.09);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 1.4rem;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.3rem 1rem;
  text-align: center;
}
.stat-label {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  color: var(--cream);
  opacity: 0.85;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--white);
}
.stat-wallet {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(79, 111, 150, 0.18);
  border: 1px solid rgba(232, 213, 176, 0.12);
  border-radius: 8px;
  padding: 0.4em 0.7em;
  font-size: 1.05rem;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.copy-btn {
  background: none; border: none; cursor: pointer;
  color: var(--cream);
  display: grid; place-items: center;
  padding: 2px;
  transition: color 0.15s ease, transform 0.15s ease;
}
.copy-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.copy-btn:hover { color: var(--teal); transform: scale(1.12); }
.copy-btn.copied { color: var(--teal); }

.pnl-badge {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0d2b26;
  background: var(--teal);
  border-radius: 8px;
  padding: 0.1em 0.55em;
  line-height: 1.25;
}
.pnl-badge.negative { background: #ff5c5c; color: #2b0d0d; }

/* --- Grid de gráficos --- */
.dash-grid {
  display: grid;
  grid-template-columns: 1.9fr 1fr;
  gap: 1.4rem;
  margin-bottom: 1.4rem;
}

/* Watermark de la chica detrás del historial */
.panel-watermark {
  position: absolute;
  left: 2%;
  bottom: 0;
  height: 92%;
  width: auto;
  object-fit: contain;
  opacity: 0.14;
  pointer-events: none;
  z-index: 1;
  filter: grayscale(0.2);
  -webkit-mask-image: linear-gradient(90deg, #000 30%, transparent 78%);
          mask-image: linear-gradient(90deg, #000 30%, transparent 78%);
}
.chart-wrap { position: relative; z-index: 2; }
.chart-wrap svg { width: 100%; height: auto; display: block; }

/* Tooltip del gráfico */
.chart-tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: #14110d;
  border: 1px solid rgba(47, 214, 192, 0.5);
  border-radius: 8px;
  padding: 0.5em 0.7em;
  font-size: 0.8rem;
  color: var(--white);
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -120%);
}
.chart-tooltip b { color: var(--teal); }

/* --- Donut --- */
.donut-wrap { position: relative; z-index: 2; display: grid; place-items: center; padding: 0.5rem 0 1rem; }
.donut-wrap svg { width: min(100%, 220px); height: auto; }
.donut-center-val { font-size: 0.95rem; font-weight: 600; fill: var(--white); }
.donut-center-lbl { font-size: 0.42rem; letter-spacing: 0.12em; fill: var(--cream); text-transform: uppercase; }

.donut-legend {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: relative;
  z-index: 2;
}
.donut-legend li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--cream);
}
.donut-legend .dot { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.donut-legend .lg-sym { font-weight: 600; color: var(--white); }
.donut-legend .lg-pct { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--white); }

/* --- Fila de desglose --- */
.breakdown-row {
  position: relative;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.4rem;
  align-items: end;
}
.dash-girl {
  align-self: end;
  width: 100%;
  max-width: 320px;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  user-select: none;
}

/* --- Tabla --- */
.table-scroll { overflow-x: auto; position: relative; z-index: 2; }
.token-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.token-table thead th {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  color: #4a4038;
  text-align: left;
  padding: 0.8em 1em;
  background: var(--cream-soft);
  position: sticky; top: 0;
}
.token-table thead th:first-child { border-radius: 10px 0 0 10px; }
.token-table thead th:last-child { border-radius: 0 10px 10px 0; }
.token-table th.num, .token-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.caret { opacity: 0.5; font-size: 0.7em; }

.token-table tbody td {
  padding: 0.95em 1em;
  border-bottom: 1px solid rgba(232, 213, 176, 0.08);
  color: var(--white);
}
.token-table tbody tr:hover td { background: rgba(124, 58, 237, 0.08); }
.tok-cell { display: flex; align-items: center; gap: 0.6rem; }
.tok-dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.tok-sym { font-weight: 600; }
.tok-name { color: var(--cream); opacity: 0.7; font-size: 0.78rem; }
.profit-pos { color: var(--teal); font-weight: 600; }
.profit-neg { color: #ff6b6b; font-weight: 600; }

.site-nav a.is-active { color: var(--teal); }

/* --- Responsive --- */
@media (max-width: 1000px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .breakdown-row { grid-template-columns: 1fr; }
  .dash-girl { max-width: 200px; justify-self: start; }
}
@media (max-width: 560px) {
  .stats-bar { grid-template-columns: 1fr; }
}
