@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #0b0e11;
  --bg-secondary: #1e2329;
  --bg-card: #2b3139;
  --bg-hover: #363c45;
  --text-primary: #eaecef;
  --text-secondary: #848e9c;
  --text-muted: #5e6673;
  --accent-green: #0ecb81;
  --accent-green-bg: rgba(14, 203, 129, 0.1);
  --accent-red: #f6465d;
  --accent-red-bg: rgba(246, 70, 93, 0.1);
  --accent-yellow: #f0b90b;
  --accent-yellow-bg: rgba(240, 185, 11, 0.1);
  --accent-blue: #1e90ff;
  --accent-blue-bg: rgba(30, 144, 255, 0.1);
  --border: #2b3139;
  --chart-grid: rgba(43, 49, 57, 0.5);   /* rejilla de gráficos (oscuro, valor original) */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* Modo claro: azules y blancos (nada de grises lavados). Solo reescribe las
   variables, el resto de la app las usa. */
body.light {
  --bg-primary: #eaf1fc;      /* fondo blanco-azulado */
  --bg-secondary: #ffffff;    /* tarjetas blancas puras */
  --bg-card: #e6eefb;         /* pistas de barras / fondos suaves, azul claro */
  --bg-hover: #d8e5fb;
  --text-primary: #0b1c3f;    /* navy oscuro */
  --text-secondary: #45587d;  /* azul-gris */
  --text-muted: #8b9bbb;
  --border: #d6e2f5;          /* borde azulado */
  --chart-grid: #dbe4f4;      /* rejilla de gráficos (claro) */
  --shadow: 0 4px 18px rgba(24, 78, 168, 0.10);
}

/* En claro: cabecera con el degradado azul del botón CryptoTrace, y el logo
   "Mi Cartera" + ese botón en blanco para que contrasten sobre el azul. */
body.light .header {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-bottom: none;
}
body.light .header-brand .logo {
  background: none;
  -webkit-text-fill-color: #ffffff;
  color: #ffffff;
}
body.light .header-brand .subtitle {
  color: rgba(255, 255, 255, 0.82);
}
body.light #app-link {
  background: #ffffff;
  color: #3b82f6;
}
/* Solo el pill de CryptoTrace va en blanco. Los demás se tratan como iconos
   sobre el azul: fondo transparente e icono blanco (hover translúcido). El
   importe (USD) queda como pill translúcido con borde sutil. */
body.light .header .refresh-btn {
  background: transparent;
  border-color: transparent;
  color: #ffffff;
}
body.light .header .refresh-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
body.light .header .currency-switch {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.55);
  color: #ffffff;
}
body.light .header .currency-switch__code {
  color: #ffffff;
}

/* Hover de fila de tabla: en oscuro es gris; en claro, azul suave. */
body.light tbody tr[data-token]:hover {
  background: rgba(30, 144, 255, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── HEADER ── */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-brand .logo {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-yellow), #f7931a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-brand .subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── App-switch pill → CryptoTrace ── */
#app-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.45);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#app-link svg { display: block; }
#app-link .al-arrow { opacity: 0.85; }

#app-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(79, 70, 229, 0.6);
}

@media (max-width: 600px) {
  #app-link span,
  #app-link .al-arrow { display: none; }
  #app-link { padding: 8px 10px; gap: 0; }

  /* La fila de acciones baja bajo el título, alineada a la izquierda y con un
     pelín más de aire entre botones. */
  .header-actions {
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
    width: 100%;
  }
}

/* Tira de estado de precios: bajo el hero, justo encima de las pestañas. */
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.currency-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.1s ease;
}

.currency-switch:hover {
  border-color: var(--accent-yellow);
  background: var(--bg-hover);
}

.currency-switch:active {
  transform: scale(0.97);
}

.currency-switch:focus-visible {
  outline: none;
  border-color: var(--accent-yellow);
  box-shadow: 0 0 0 3px var(--accent-yellow-bg);
}

.currency-switch__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-yellow), #f7931a);
  color: #0b0e11;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.currency-switch__code {
  min-width: 30px;
  text-align: left;
}

.last-update {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  padding: 0;
  cursor: pointer;
  transition: color .15s, border-color .15s, transform .3s;
}

.btn-refresh:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.btn-refresh:active {
  transform: rotate(180deg);
}

/* ── PORTFOLIO HERO ── */
.hero {
  padding: 32px 0 24px;
}

.hero-value {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.hero-pnl {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-pnl .badge {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

/* ── CARDS GRID ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
  position: relative;
}

.card:hover {
  border-color: var(--bg-hover);
}

.card-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-value {
  font-size: 24px;
  font-weight: 700;
}

.card-value-suffix {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 6px;
  letter-spacing: 0;
}

.card-head-c {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.card-title {
  width: 100%;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.card[data-glow="green"] .card-title { color: var(--accent-green); }
.card[data-glow="yellow"] .card-title { color: var(--accent-yellow); }
.card[data-glow="blue"] .card-title { color: var(--accent-blue); }
.card[data-glow="purple"] .card-title { color: #cd9eff; }

.card-edit {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
  z-index: 1;
}
.card-edit:hover { color: var(--text-primary); background: var(--bg-hover); }

.card-coins {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.card-coins img,
.card-coins .token-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  box-sizing: border-box;
  display: block;
  opacity: 1;
}

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

/* ── REPARTO DEL MES ── */
.reparto-wrap { padding: 4px 2px 2px; }
.strat-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
  gap: 10px;
  margin-bottom: 6px;
}
.strat-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
/* Cada estrategia con su color (gradiente de riesgo): verde → amarillo → rojo. */
.strat-block[data-strat="conservadora"] .strat-name { color: var(--accent-green); }
.strat-block[data-strat="moderada"]     .strat-name { color: var(--accent-yellow); }
.strat-block[data-strat="agresiva"]     .strat-name { color: var(--accent-red); }

.strat-block[data-strat="conservadora"].active {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 1px var(--accent-green), 0 0 20px rgba(14, 203, 129, 0.15);
}
.strat-block[data-strat="moderada"].active {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 0 1px var(--accent-yellow), 0 0 20px rgba(240, 185, 11, 0.15);
}
.strat-block[data-strat="agresiva"].active {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 1px var(--accent-red), 0 0 20px rgba(246, 70, 93, 0.15);
}
.strat-sum {
  list-style: none;
  cursor: pointer;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.strat-sum::-webkit-details-marker { display: none; }
.strat-sum::marker { content: ''; }
.strat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.strat-head-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.strat-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.strat-block[open] .strat-chevron { transform: rotate(180deg); }
.strat-name {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.strat-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-card);
}
.strat-bar .seg { height: 100%; }
.seg-refugio { background: var(--accent-blue); }
.seg-core { background: var(--accent-green); }
.seg-sat { background: var(--accent-yellow); }
.strat-legend { font-size: 12px; font-weight: 700; }
.lg-refugio { color: var(--accent-blue); }
.lg-core { color: var(--accent-green); }
.lg-sat { color: var(--accent-yellow); }
.reparto-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 14px;
  line-height: 1.5;
}
.reparto-list {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}
.reparto-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.reparto-row.idle { opacity: 0.6; }
.reparto-coin { display: inline-flex; flex-shrink: 0; }
.reparto-coin img,
.reparto-coin .token-icon { width: 24px; height: 24px; border-radius: 50%; }
.reparto-mid { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.reparto-name { font-weight: 600; font-size: 14px; }
.reparto-prog-wrap { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.reparto-prog-bar { height: 100%; border-radius: 2px; transition: width 0.4s ease; }
.reparto-amt { font-weight: 800; font-size: 15px; letter-spacing: -0.3px; flex-shrink: 0; }
.reparto-row.idle .reparto-amt { font-weight: 500; font-size: 13px; color: var(--text-muted); }

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

.card-icon.green { background: var(--accent-green-bg); }
.card-icon.red { background: var(--accent-red-bg); }
.card-icon.yellow { background: var(--accent-yellow-bg); }
.card-icon.blue { background: var(--accent-blue-bg); }

/* ── SECTION ── */
.section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

/* ── TABLES ── */
.table-wrapper {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.2s;
}

thead th:hover {
  color: var(--text-primary);
}

thead th.text-right,
tbody td.text-right {
  text-align: right;
}

tbody tr {
  border-bottom: 1px solid rgba(43, 49, 57, 0.5);
  transition: background 0.15s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--bg-hover);
}

tbody td {
  padding: 14px 16px;
  font-size: 14px;
  white-space: nowrap;
}

/* ── TOKEN CELL ── */
.token-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.token-icon.btc { background: #f7931a22; color: #f7931a; }
.token-icon.eth { background: #627eea22; color: #627eea; }
.token-icon.atom { background: #6f739022; color: #8c94a8; }
.token-icon.tia { background: #cd9eff22; color: #cd9eff; }
.token-icon.pi { background: #0ecb8122; color: #0ecb81; }
.token-icon.atone { background: #1e90ff22; color: #1e90ff; }
.token-icon.mode { background: #f0b90b22; color: #f0b90b; }
.token-icon.sol  { background: #9945ff22; color: #9945ff; }

.token-icon img {
  border-radius: 50%;
  object-fit: cover;
}
.token-icon.usdc { background: #2775ca22; color: #2775ca; }

.token-name {
  font-weight: 600;
}

.token-symbol {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── P&L COLORS ── */
.positive { color: var(--accent-green); }
.negative { color: var(--accent-red); }
.neutral { color: var(--text-secondary); }

/* ── PROGRESS BAR ── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: visible;
  margin-top: 8px;
  position: relative;
}
.card-bar-mark {
  position: absolute;
  top: -4px; bottom: -4px;
  width: 3px;
  background: rgba(255,255,255,0.55);
  border-radius: 2px;
  transform: translateX(-50%);
  pointer-events: none;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
  max-width: 100%;
  overflow: hidden;
}

.progress-fill.green { background: var(--accent-green); }
.progress-fill.yellow { background: var(--accent-yellow); }
.progress-fill.red { background: var(--accent-red); }
.progress-fill.blue { background: var(--accent-blue); }

/* ── ALLOCATION GRID ── */
.allocation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .allocation-grid {
    grid-template-columns: 1fr;
  }
}

.chart-container {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-container canvas {
  max-width: 280px;
  max-height: 280px;
}

.allocation-list {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
}

.allocation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(43, 49, 57, 0.5);
}

.allocation-item:last-child {
  border-bottom: none;
}

.allocation-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.allocation-pct {
  font-weight: 700;
  font-size: 14px;
}

/* ── WARNING BANNER ── */
.portfolio-health { margin-bottom: 20px; }
.health-wrap { display: flex; flex-direction: column; gap: 10px; }
.health-row { display: flex; flex-direction: column; gap: 6px; }
.health-row-head { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.health-label-name { font-weight: 600; color: var(--text-secondary); min-width: 72px; }
.health-label-pct { font-weight: 700; }
.health-label-target { color: var(--text-muted); font-size: 12px; }
.health-bar-wrap { position: relative; }
.health-bar { height: 8px; border-radius: 6px; background: var(--border); overflow: visible; position: relative; }
.health-seg { height: 100%; border-radius: 6px; transition: width 0.5s ease; max-width: 100%; }
.health-mark {
  position: absolute; top: -5px; bottom: -5px;
  width: 2px; background: var(--text-secondary);
  border-radius: 1px; transform: translateX(-50%);
  pointer-events: none; opacity: 0.7;
}

.warning-banner {
  background: var(--accent-yellow-bg);
  border: 1px solid rgba(240, 185, 11, 0.3);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--accent-yellow);
  font-weight: 500;
}

/* ── STAKING CARDS ── */
.staking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.staking-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
}

.staking-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.staking-card-header .token-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.staking-apr {
  background: var(--accent-green-bg);
  color: var(--accent-green);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.staking-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.staking-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.staking-stat-value {
  font-size: 16px;
  font-weight: 600;
  margin-top: 2px;
}

.staking-stat-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── CUSTODY BAR ── */
.custody-bar {
  display: flex;
  height: 32px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 12px 0;
}

.custody-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #0b0e11;
  transition: flex 0.6s ease;
}

.custody-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.custody-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  color: var(--text-secondary);
}

.custody-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 4px;
}

.custody-legend-text {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.custody-legend-name {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.1px;
}

.custody-legend-purpose {
  font-size: 11.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  margin-top: 40px;
}

.footer .container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent-green);
}

.footer-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

.footer p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.footer .disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
  max-width: 600px;
  margin: 0;
  line-height: 1.5;
}

/* ── LOADING ── */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-muted);
  border-top-color: var(--accent-yellow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── LIVE DOT ── */
.live-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

.live-dot.offline {
  background: var(--accent-red);
}

.live-dot.stale {
  background: var(--accent-yellow);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .hero-value {
    font-size: 30px;
  }

  .cards-grid {
    grid-template-columns: 1fr 1fr;
  }

  .card-value {
    font-size: 18px;
  }

  thead th, tbody td {
    padding: 10px 12px;
    font-size: 12px;
  }

  .token-icon {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }

  .staking-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-card);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-hover);
}

/* ── TOOLTIP ── */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  border: 1px solid var(--border);
  z-index: 10;
}

.tooltip:hover::after {
  opacity: 1;
}

/* ── COLLAPSIBLE ── */
.collapsible-section {
  border: none;
}

.collapsible-header {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  user-select: none;
}

.collapsible-header::-webkit-details-marker {
  display: none;
}

.collapsible-header::marker {
  display: none;
  content: '';
}

.chevron {
  transition: transform 0.25s ease;
  opacity: 0.5;
}

.collapsible-section[open] .chevron {
  transform: rotate(180deg);
}

.collapsible-header:hover .chevron {
  opacity: 1;
}

/* ── REFRESH BUTTON ── */
.refresh-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.refresh-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

/* ── SECTION NAV ── */
.section-nav {
  display: flex;
  gap: 4px;
  padding: 8px 0;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.2s;
  text-decoration: none !important;
  background: transparent;
}

.nav-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--accent-yellow);
  color: #0b0e11;
  font-weight: 700;
}

/* ── COSMOS BAR IN CARD ── */
.cosmos-bar-wrap {
  margin-top: 10px;
}

.cosmos-bar-wrap .progress-bar {
  margin-top: 0;
  margin-bottom: 6px;
}

.cosmos-label {
  font-size: 12px;
  font-weight: 600;
}

/* ── DCA CARD ── */
.card-dca {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dca-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.dca-month {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.dca-edit {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.dca-edit:hover { color: var(--text-primary); background: var(--bg-hover); }

.dca-amount {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.dca-invested {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.dca-target {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.dca-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.dca-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent-blue);
  transition: width 0.6s ease;
}

.dca-fill.complete {
  background: var(--accent-green);
}

.dca-footer {
  font-size: 12px;
}

/* ── EVOLUTION CHART ── */
.chart-wrapper {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  height: 280px;
}

/* ── SEARCH INPUT ── */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  transition: border-color 0.2s;
}

.search-wrap:focus-within {
  border-color: var(--accent-yellow);
}

.search-wrap svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.tx-search {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  padding: 7px 0;
  width: 140px;
  outline: none;
  font-family: inherit;
}

.tx-search::placeholder {
  color: var(--text-muted);
}

/* ── SCROLL OFFSET ── */
section[id^="sec-"],
details[id^="sec-"] {
  scroll-margin-top: 80px;
}

/* ── TOKEN DETAIL MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

/* ── MODAL HERO ── */
.modal-hero {
  padding: 28px 28px 20px;
  background: linear-gradient(180deg, rgba(43, 49, 57, 0.4) 0%, transparent 100%);
  border-radius: 16px 16px 0 0;
}

.modal-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-token-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-token-name {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.modal-token-symbol {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-close {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-hero-price {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}

.modal-price {
  font-size: 32px;
  font-weight: 800;
}

.modal-change-badge {
  font-size: 14px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 8px;
}

.modal-change-badge.positive {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.modal-change-badge.negative {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}

.modal-chart-area {
  width: 100%;
  height: 80px;
  margin-top: 4px;
}

.modal-chart-area canvas {
  display: block;
}

/* ── MODAL BODY ── */
.modal-body {
  padding: 8px 28px 32px;
}

/* ── MODAL SECTIONS ── */
.modal-section {
  margin-bottom: 28px;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

/* ── MODAL STAT CARDS ── */
.modal-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-stat-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(43, 49, 57, 0.6);
}

.modal-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.modal-stat-big {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.modal-stat-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── BUY-IN BAR ── */
.modal-buy-bar {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid rgba(43, 49, 57, 0.6);
}

.modal-buy-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.modal-buy-bar-track {
  width: 100%;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.modal-buy-bar-marker {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 10px;
  background: var(--text-secondary);
  border-radius: 1px;
}

.modal-buy-bar-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.modal-buy-bar-fill.positive {
  background: var(--accent-green);
}

.modal-buy-bar-fill.negative {
  background: var(--accent-red);
}

.modal-buy-bar-result {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  margin-top: 10px;
}

/* ── STAKING NOTE ── */
.modal-staking-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--accent-yellow-bg);
  border-radius: 8px;
  border-left: 3px solid var(--accent-yellow);
}

/* ── TAG SELECTOR (categoría de cada moneda) ── */
.modal-tag-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag-btn {
  flex: 1;
  min-width: 90px;
  padding: 9px 12px;
  border: 1px solid rgba(234, 236, 239, 0.12);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tag-btn:hover {
  border-color: rgba(234, 236, 239, 0.35);
  color: var(--text);
}
.tag-btn.active.tag-portfolio {
  background: var(--accent-blue-bg);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}
.tag-btn.active.tag-staking {
  background: var(--accent-yellow-bg);
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
}
.tag-btn.active.tag-airdrop {
  background: var(--accent-green-bg);
  border-color: var(--accent-green);
  color: var(--accent-green);
}
.modal-tag-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.hide-btn {
  margin-top: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(234, 236, 239, 0.12);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.hide-btn:hover {
  border-color: rgba(234, 236, 239, 0.35);
  color: var(--text);
}
.hidden-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(234, 236, 239, 0.1);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
}
.link-btn {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}
.link-btn:hover {
  text-decoration: underline;
}

/* ── SYNC (gist) ── */
.sync-input {
  width: 100%;
  margin: 6px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
}
.sync-input:focus { outline: none; border-color: var(--accent-blue); }
.sync-status { font-size: 12px; min-height: 16px; margin: 4px 0 12px; color: var(--text-muted); }
.sync-status.ok { color: var(--accent-green); }
.sync-status.error { color: var(--accent-red, #f6465d); }
.sync-status.working { color: var(--accent-yellow); }
.sync-actions { display: flex; gap: 10px; }
.sync-actions button { flex: 1; }
#sync-btn.sync-on { color: var(--accent-green); }

/* ── SELECTOR DE FORMATO (export/import) ── */
.format-choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.format-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid rgba(234, 236, 239, 0.12);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.format-btn:hover {
  border-color: var(--accent-green);
  background: var(--accent-green-bg);
}
.format-btn-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.format-btn-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* ── EMPTY STATE (secciones sin monedas) ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 16px;
  border: 1px dashed rgba(234, 236, 239, 0.18);
  border-radius: 12px;
}

/* ── MODAL TX LIST ── */
.modal-tx-list {
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid rgba(43, 49, 57, 0.6);
}

.modal-tx-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(43, 49, 57, 0.4);
}

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

.modal-tx-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-tx-date {
  font-size: 12px;
  color: var(--text-muted);
}

.modal-tx-qty {
  font-size: 14px;
  font-weight: 600;
}

.modal-tx-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.modal-tx-price {
  font-size: 12px;
  color: var(--text-secondary);
}

.modal-tx-total {
  font-size: 14px;
  font-weight: 700;
}

.bucket-list { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; }
.bucket-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-radius: 10px; background: var(--bg-card); }
.bucket-row-left { display: flex; align-items: center; gap: 12px; }
.bucket-row-info { display: flex; flex-direction: column; gap: 2px; }
.bucket-row-name { font-size: 15px; font-weight: 600; }
.bucket-row-sym { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.bucket-row-sub { font-size: 12px; color: var(--text-muted); }
.bucket-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 120px; }
.bucket-row-val { font-size: 15px; font-weight: 700; }
.bucket-row-pnl { font-size: 12px; }
.bucket-bar-fill { height: 3px; border-radius: 2px; min-width: 2px; max-width: 120px; }

@media (max-width: 480px) {
  .bucket-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .bucket-row-right { align-items: flex-start; min-width: unset; width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
  .bucket-row-pnl { font-size: 11px; }
}

.modal-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 480px) {
  .modal {
    width: 96%;
    max-height: 92vh;
    border-radius: 14px;
  }

  .modal-hero {
    padding: 20px 20px 16px;
  }

  .modal-body {
    padding: 4px 20px 24px;
  }

  .modal-grid-3 {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .modal-grid-2 {
    grid-template-columns: 1fr;
  }

  .modal-price {
    font-size: 26px;
  }

  .modal-token-name {
    font-size: 18px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PREMIUM EFFECTS
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. SKELETON LOADING ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(43, 49, 57, 0.5);
}

.skeleton-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
}

.skeleton-line.w60 { width: 60px; }
.skeleton-line.w80 { width: 80px; }
.skeleton-line.w100 { width: 100px; }
.skeleton-line.w120 { width: 120px; }

.skeleton-card {
  padding: 20px;
}

.skeleton-card .skeleton-line.h20 {
  height: 20px;
  width: 60%;
  margin-bottom: 10px;
}

.skeleton-card .skeleton-line.h32 {
  height: 32px;
  width: 40%;
  margin-bottom: 8px;
}

.skeleton-card .skeleton-line.h14 {
  height: 14px;
  width: 80%;
}

/* ── 2. GLASSMORPHISM HEADER ── */
.header {
  background: rgba(11, 14, 17, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(43, 49, 57, 0.5);
}

/* ── 3. HOVER GLOW ON CARDS ── */
.card {
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  position: relative;
}

.card[data-glow]:hover {
  transform: translateY(-3px);
}

.card[data-glow="green"]:hover {
  box-shadow: 0 0 24px rgba(14, 203, 129, 0.15), 0 4px 16px rgba(0,0,0,0.3);
  border-color: rgba(14, 203, 129, 0.3);
}

.card[data-glow="yellow"]:hover {
  box-shadow: 0 0 24px rgba(240, 185, 11, 0.15), 0 4px 16px rgba(0,0,0,0.3);
  border-color: rgba(240, 185, 11, 0.3);
}

.card[data-glow="blue"]:hover {
  box-shadow: 0 0 24px rgba(30, 144, 255, 0.15), 0 4px 16px rgba(0,0,0,0.3);
  border-color: rgba(30, 144, 255, 0.3);
}

.card[data-glow="purple"]:hover {
  box-shadow: 0 0 24px rgba(205, 158, 255, 0.15), 0 4px 16px rgba(0,0,0,0.3);
  border-color: rgba(205, 158, 255, 0.3);
}

.card[data-glow="red"]:hover {
  box-shadow: 0 0 24px rgba(246, 70, 93, 0.15), 0 4px 16px rgba(0,0,0,0.3);
  border-color: rgba(246, 70, 93, 0.3);
}

/* ── 4. ANIMATED GRADIENT HERO ── */
.hero-value {
  background: linear-gradient(135deg, #f7931a, #f0b90b, #0ecb81, #1e90ff, #cd9eff, #f7931a);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── 5. MODAL SPRING ANIMATION ── */
.modal {
  transform: translateY(30px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

/* ── 6. FADE IN UP ANIMATION ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

/* ── 7. SPARKLINE IN TABLE ── */
.sparkline-cell {
  width: 80px;
  height: 32px;
  flex-shrink: 0;
}

.sparkline-cell canvas {
  width: 80px;
  height: 32px;
}

/* ── 8. CARD VALUE ANIMATION ── */
.card-value {
  transition: color 0.3s;
}

/* ── NAV LINK GLOW ON ACTIVE ── */
.nav-link.active {
  box-shadow: 0 0 12px rgba(240, 185, 11, 0.25);
}

/* ── REFRESH BTN GLOW ── */
.refresh-btn:hover {
  box-shadow: 0 0 12px rgba(240, 185, 11, 0.2);
}

/* ── TABLE ROW HOVER GLOW ── */
tbody tr[data-token]:hover {
  background: rgba(43, 49, 57, 0.6);
  box-shadow: inset 0 0 0 1px rgba(240, 185, 11, 0.15);
}

/* ── PROGRESS BAR GLOW ── */
.progress-fill.green {
  box-shadow: 0 0 8px rgba(14, 203, 129, 0.4);
}

.progress-fill.yellow {
  box-shadow: 0 0 8px rgba(240, 185, 11, 0.4);
}

.progress-fill.red {
  box-shadow: 0 0 8px rgba(246, 70, 93, 0.4);
}

/* ── FAB: añadir movimiento ── */
.fab {
  position: fixed;
  right: 22px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--accent-green);
  color: #0b0e11;
  border: none;
  box-shadow: 0 8px 24px rgba(14, 203, 129, .5);
  cursor: pointer;
  z-index: 150;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(14, 203, 129, .65); }
.fab svg { display: block; }
main.container { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }

/* ── Modal: formulario añadir ── */
.add-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 6px; }
.add-modal-head h3 { font-size: 19px; font-weight: 700; }
.add-form { padding: 8px 24px 24px; }
.add-form > label, .add-field label {
  display: block; font-size: 11px; color: var(--text-muted); font-weight: 700;
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em;
}
.coin-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.coin-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary);
  padding: 6px 13px 6px 7px; border-radius: 999px; font-weight: 600; font-size: 14px;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.coin-chip img, .coin-chip .token-icon { border-radius: 50%; }
.coin-chip.active { background: var(--accent-yellow); color: #0b0e11; border-color: var(--accent-yellow); }
.coin-chip:hover:not(.active) { color: var(--text-primary); border-color: var(--bg-hover); }
.add-row { display: flex; gap: 14px; margin-bottom: 18px; }
.add-field { flex: 1; min-width: 0; }
.add-select {
  width: 100%; box-sizing: border-box; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); padding: 10px 34px 10px 12px; font-size: 15px;
  font-family: inherit; color-scheme: dark; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b93a1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.add-select:focus { outline: none; border-color: var(--accent-yellow); }
/* Al abrir, cada opción con su color de acción. */
.add-select option { color: var(--text-primary); font-weight: 600; }
.add-select option[value="Compra"] { color: var(--accent-green); }
.add-select option[value="Venta"] { color: var(--accent-red); }
.add-select option[value="Recompensa"] { color: var(--accent-blue); }
/* Cerrado: el nombre elegido conserva su color (borde sigue neutro). */
.add-select.sel-compra { color: var(--accent-green); }
.add-select.sel-venta { color: var(--accent-red); }
.add-select.sel-recompensa { color: var(--accent-blue); }
.add-field input {
  width: 100%; box-sizing: border-box; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); padding: 10px 12px; font-size: 15px;
  font-family: inherit; color-scheme: dark;
}
.add-field input:focus { outline: none; border-color: var(--accent-yellow); }
.add-derived { font-size: 13px; color: var(--text-secondary); min-height: 18px; margin-bottom: 4px; }
.add-error { color: var(--accent-red); font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.add-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* En vertical/móvil: apila TIPO y FECHA (e importe/cantidad) para que el selector
   de tipo respire y "Recompensa" no salga cortado. */
@media (max-width: 560px) {
  .add-row { flex-direction: column; gap: 14px; }
}
.add-cancel, .add-submit { padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit; border: 1px solid var(--border); }
.add-cancel { background: var(--bg-card); color: var(--text-secondary); }
.add-submit { background: var(--accent-green); color: #0b0e11; border-color: var(--accent-green); }
.add-price-live { font-size: 12px; color: var(--accent-yellow); margin: -8px 0 16px; font-weight: 600; }
.tx-actions { white-space: nowrap; }
.tx-btn { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; margin-left: 6px; transition: all .15s; }
.tx-btn svg { display: block; }
.tx-edit:hover { color: var(--accent-yellow); border-color: var(--accent-yellow); }
.tx-del:hover { color: var(--accent-red); border-color: var(--accent-red); }
