/* ═══════════════════════════════════════════════════════════════
   dashboard.css — Design tokens, reset y componentes base
   Tema oscuro trading: El Ladrón de los Mercados
   ═══════════════════════════════════════════════════════════════ */

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

/* ── CSS Variables ────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:          #080b10;
  --surface:     #0d1117;
  --surface-2:   #111820;
  --panel:       #131a23;
  --panel-2:     #1a2332;

  /* Borders */
  --border:      rgba(99, 140, 177, 0.12);
  --border-2:    rgba(99, 140, 177, 0.22);

  /* Text */
  --text:        #cdd9e5;
  --muted:       #6b7f91;
  --muted-2:     #8ba0b4;

  /* Accent (sky blue) */
  --accent:      #29b6f6;
  --accent-dim:  rgba(41, 182, 246, 0.25);
  --accent-glow: rgba(41, 182, 246, 0.08);

  /* Signals */
  --buy:         #26d97f;
  --buy-dim:     rgba(38, 217, 127, 0.20);
  --sell:        #ff4d6d;
  --sell-dim:    rgba(255, 77, 109, 0.20);
  --warn:        #ffd740;
  --gold:        #ffc840;

  /* Radii */
  --radius:      8px;
  --radius-lg:   12px;
  --radius-xl:   16px;

  /* Header */
  --header-h:    52px;
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

a { color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Header ───────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: rgba(8, 11, 16, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo-text {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  background: linear-gradient(90deg, var(--accent) 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-sep {
  flex: 1;
}

.header-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-2);
  color: var(--muted-2);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.header-chip:hover { color: var(--accent); border-color: var(--accent-dim); }

.update-badge {
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
  display: none;
}
@media (min-width: 480px) { .update-badge { display: block; } }

.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted-2);
  font-size: 1rem;
  transition: color 0.15s, background 0.15s;
}
.hamburger-btn:hover { color: var(--accent); background: var(--accent-dim); }

/* ── Nav Drawer ───────────────────────────────────────────────── */
.nav-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 201;
  width: 260px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.nav-drawer--open { transform: translateX(0); }

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.nav-drawer-close {
  background: transparent;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--muted-2);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: color 0.15s;
}
.nav-drawer-close:hover { color: var(--sell); }

.nav-drawer-links {
  display: flex;
  flex-direction: column;
  padding: 10px 8px;
  gap: 2px;
}
.nav-drawer-links a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted-2);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav-drawer-links a:hover,
.nav-drawer-links a.active { color: var(--accent); background: var(--accent-dim); }

/* ── Top Nav ──────────────────────────────────────────────────── */
.main-nav {
  display: flex;
  gap: 2px;
  padding: 8px 16px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: var(--header-h);
  z-index: 90;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-2);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
  transition: color 0.15s, background 0.15s;
}
.nav-tab:hover { color: var(--accent); background: var(--accent-glow); }
.nav-tab.active {
  color: var(--accent);
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
}

/* ── Main content ─────────────────────────────────────────────── */
.main-content {
  max-width: 1300px;
  margin: 0 auto;
  padding: 14px 16px 32px;
}

/* ── Empty state ──────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 16px;
  color: var(--muted);
}
.empty-icon { font-size: 2rem; }
.empty-text { font-size: 0.8rem; text-align: center; }

/* ── Stats panel title ────────────────────────────────────────── */
.stats-panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Week tabs ────────────────────────────────────────────────── */
.vi-cal-week-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.vi-cal-week-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--muted-2);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.vi-cal-week-tab:hover { color: var(--accent); border-color: var(--accent-dim); }
.vi-cal-week-tab.active { color: #080b10; background: var(--accent); border-color: var(--accent); }
.vi-cal-week-count {
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 0.65rem;
}
.vi-cal-week-tab.active .vi-cal-week-count { background: rgba(0,0,0,0.2); }

/* ── Keyframes ────────────────────────────────────────────────── */
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .vi-page-layout {
    grid-template-columns: 1fr !important;
  }
  .vi-sidebar {
    position: static !important;
    order: 10; /* sidebar debajo del contenido principal en móvil */
  }
}

/* ── Mobile Header ─────────────────────────────────────────────── */
/* Compactamos chips y header para que todo quepa en pantallas pequeñas
   sin ocultar nada: se ven el precio del oro, el link y el botón ☰  */
@media (max-width: 640px) {
  header { padding: 0 10px; gap: 5px; }
  .header-chip { padding: 3px 7px; font-size: 0.66rem; }
}
/* A partir de 520px ocultamos solo el texto del logo (queda el icono 📈)
   para ganar espacio; el drawer sigue mostrando el nombre completo */
@media (max-width: 520px) {
  header .logo-text { display: none; }
}
