/* ================================================================
   DESIGN SYSTEM — CryptoCode
   Archivo compartido — importar en TODAS las páginas
   ================================================================ */

/* ── DESIGN TOKENS ────────────────────────────────────────────── */
:root {
  /* Fondos */
  --bg-primary:         #06060a;
  --bg-secondary:       rgba(15, 15, 24, 0.6);
  --bg-secondary-solid: #0f0f18;
  --bg-tertiary:        rgba(20, 20, 31, 0.5);
  --bg-tertiary-solid:  #14141f;

  /* Texto */
  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;

  /* Bordes */
  --border-color:       rgba(255, 255, 255, 0.06);
  --border-color-hover: rgba(255, 255, 255, 0.12);

  /* Acentos semánticos */
  --accent-blue:       #3b82f6;
  --accent-blue-hover: #60a5fa;
  --accent-green:      #06d6a0;
  --accent-red:        #ef4444;
  --accent-yellow:     #eab308;
  --accent-purple:     #8b5cf6;
  --accent-orange:     #f97316;

  /* Aliases — backward compat para portfolio.html */
  --border:        var(--border-color);
  --border-hover:  var(--border-color-hover);
  --accent:        var(--accent-blue);
  --accent-hover:  var(--accent-blue-hover);
  --green:         var(--accent-green);
  --red:           var(--accent-red);
  --orange:        var(--accent-orange);
  --purple:        var(--accent-purple);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-font-smoothing: antialiased;
}

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

/* ── SCROLLBAR ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ── NAVBAR ───────────────────────────────────────────────────── */
.glass-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(15, 15, 24, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* btn-ghost-nav y btn-ghost son idénticos — ambos nombres soportados */
.btn-ghost-nav,
.btn-ghost {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #d1d5db;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}
.btn-ghost-nav:hover,
.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.03);
  color: #e2e8f0;
}

/* Estado activo en el nav — aplicar manualmente por JS o atributo */
.btn-ghost-active {
  border-color: rgba(59, 130, 246, 0.4) !important;
  color: var(--accent-blue) !important;
  background: rgba(59, 130, 246, 0.06) !important;
}

/* Primary CTA para nav — mismo tamaño que btn-ghost-nav */
.btn-primary-nav {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}
.btn-primary-nav:hover {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.25);
  transform: translateY(-1px);
}

.btn-logout-nav {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  background: transparent;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
}
.btn-logout-nav:hover {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 6, 10, 0.95);
  backdrop-filter: blur(20px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}
.mobile-menu.active { display: flex; }

.nav-link { position: relative; color: #94a3b8; transition: color 0.2s; }
.nav-link:hover { color: #e2e8f0; }
.no-underline, .no-underline:hover { text-decoration: none; }

/* ── NAVBAR LAYOUT ────────────────────────────────────────────── */
.nav-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: inherit;
}

.nav-logo-icon {
  width: 2rem; height: 2rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-logo-icon svg { width: 18px; height: 18px; color: #fff; }

.nav-logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.025em;
}

/* Desktop links — hidden mobile, flex desktop */
.nav-links {
  display: none;
  align-items: center;
  gap: 0.75rem;
}
/* Always-visible links (auth pages: login, register, etc.) */
.nav-links-always {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
/* Section links (landing — wider gap) */
.nav-section-links {
  display: none;
  align-items: center;
  gap: 1.3rem;
  font-size: 1rem;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-section-links { display: flex; }
  .nav-mobile-btn { display: none; }
}

.nav-mobile-btn {
  padding: 0.5rem;
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}
.nav-mobile-btn:hover { color: #fff; }
.nav-mobile-btn svg { width: 24px; height: 24px; }

.nav-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  padding: 0.5rem;
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}
.nav-close-btn:hover { color: #fff; }
.nav-close-btn svg { width: 24px; height: 24px; }

.nav-mobile-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 16rem;
}
.nav-mobile-links .btn-ghost-nav,
.nav-mobile-links .btn-ghost,
.nav-mobile-links .btn-logout-nav {
  padding: 0.75rem 1.5rem;
  text-align: center;
  display: block;
  width: 100%;
}

/* Landing mobile section links */
.nav-mobile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
.nav-mobile-section a {
  font-size: 1.25rem;
  font-weight: 500;
  color: #e5e7eb;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-mobile-section a:hover { color: #fff; }

/* ── BOTONES ──────────────────────────────────────────────────── */
.btn {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-tertiary-solid);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { border-color: var(--border-color-hover); background: rgba(255,255,255,0.04); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border-color: transparent;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}
.btn-primary:disabled { transform: none; box-shadow: none; }

.btn-danger  { color: var(--accent-red);   border-color: rgba(239,68,68,0.25); }
.btn-danger:hover  { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.4); }
.btn-success { color: var(--accent-green); border-color: rgba(6,214,160,0.25); }
.btn-success:hover { background: rgba(6,214,160,0.1); border-color: rgba(6,214,160,0.4); }

/* ── FORMULARIOS ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-tertiary-solid);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input:hover:not(:read-only):not(:disabled),
textarea:hover:not(:read-only),
select:hover { border-color: var(--border-color-hover); }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
input::placeholder, textarea::placeholder {
  color: var(--text-secondary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
}
input:read-only:not([type="checkbox"]):not([type="range"]):not([type="radio"]):not([type="color"]) { opacity: 0.5; cursor: not-allowed; }
input:read-only:not([type="checkbox"]):not([type="range"]):not([type="radio"]):not([type="color"]):focus { border-color: var(--border-color); box-shadow: none; }
textarea { resize: vertical; min-height: 60px; }

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  cursor: pointer;
  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='%2394a3b8' stroke-width='2' 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 10px center;
}
select:hover { border-color: var(--accent-blue); }
select option { background: var(--bg-secondary-solid); color: var(--text-primary); }

/* Select nativo estilizado (usado en createSearchableSelect) */
.native-select {
  padding: 8px 32px 8px 12px;
  background: var(--bg-tertiary-solid);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  width: 100%;
  line-height: 1.4;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  outline: none;
}
.native-select:hover { border-color: var(--border-color-hover); }
.native-select:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.native-select option { background: var(--bg-secondary-solid); color: var(--text-primary); }

/* ── SPINNER ──────────────────────────────────────────────────── */
.spinner,
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ────────────────────────────────────────────────────── */
#toastContainer,
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateX(100px);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  max-width: 380px;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-success { background: rgba(6, 214, 160, 0.9); color: #fff; }
.toast-error   { background: rgba(239, 68, 68, 0.9);  color: #fff; }
.toast-warning { background: rgba(234, 179, 8, 0.85);  color: #fff; }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── BADGE ────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}
.badge-active   { background: rgba(6,214,160,0.1);   color: var(--accent-green);  border: 1px solid rgba(6,214,160,0.2); }
.badge-inactive { background: rgba(148,163,184,0.08); color: var(--text-secondary); border: 1px solid var(--border-color); }
.badge-plan     { background: rgba(139,92,246,0.1);   color: var(--accent-purple); border: 1px solid rgba(139,92,246,0.2); }
.badge-admin    {
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(139,92,246,0.15));
  color: #a78bfa;
  border: 1px solid rgba(139,92,246,0.3);
}

/* ── MODAL ────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,6,10,0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
/* Soporte para .show (portfolio) y .active (testnet) */
.modal-overlay.show,
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-secondary-solid);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal h3 { margin-bottom: 20px; font-size: 16px; font-weight: 700; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px; }

/* ── TOGGLE SWITCH ────────────────────────────────────────────── */
.toggle { position: relative; width: 40px; height: 22px; display: inline-block; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-tertiary-solid);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  transition: 0.3s;
}
.toggle .slider::before {
  content: "";
  position: absolute;
  height: 16px; width: 16px;
  left: 2px; bottom: 2px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: 0.3s;
}
.toggle input:checked + .slider { background: var(--accent-blue); border-color: var(--accent-blue); }
.toggle input:checked + .slider::before { transform: translateX(18px); background: #fff; }

/* ── TABLAS (base) ────────────────────────────────────────────── */
.table-container { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-color); font-size: 13px; }
th { color: var(--text-secondary); font-size: 11px; text-transform: uppercase; font-weight: 600; letter-spacing: 0.05em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── PANELES ──────────────────────────────────────────────────── */
.panel {
  background: var(--bg-secondary);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  transition: border-color 0.2s;
}
.panel:hover { border-color: var(--border-color-hover); }
.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.panel-header h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.panel-body { padding: 20px; }

/* ── CARDS ────────────────────────────────────────────────────── */
.card {
  background: var(--bg-secondary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-color-hover); }

.glass-card {
  background: rgba(20, 20, 31, 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}
.glass-card:hover {
  border-color: rgba(59, 130, 246, 0.2);
  background: rgba(20, 20, 31, 0.7);
  transform: translateY(-2px);
}

/* ── GLASSMORPHISM UTILS ──────────────────────────────────────── */
.glass {
  background: rgba(15, 15, 24, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── SKELETON ─────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── FOOTER ───────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 12px;
  border-top: 1px solid var(--border-color);
  margin-top: 12px;
}

/* ── UTILIDADES ───────────────────────────────────────────────── */
.positive  { color: var(--accent-green); }
.negative  { color: var(--accent-red); }
.neutral   { color: var(--text-secondary); }
.symbol    { font-weight: 600; color: var(--accent-blue); }
.timestamp { font-size: 12px; color: var(--text-secondary); }
.placeholder { text-align: center; padding: 40px 20px; color: var(--text-secondary); font-size: 14px; }
.loading   { display: flex; justify-content: center; align-items: center; height: 100px; color: var(--text-secondary); }

.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #3b82f6 50%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── PILL BADGE ───────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 700;
}
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; }
.pill-green  { background: rgba(6,214,160,0.1);  color: var(--accent-green);  border: 1px solid rgba(6,214,160,0.2); }
.pill-green::before  { background: var(--accent-green); }
.pill-red    { background: rgba(239,68,68,0.1);  color: var(--accent-red);    border: 1px solid rgba(239,68,68,0.2); }
.pill-red::before    { background: var(--accent-red); }
.pill-yellow { background: rgba(234,179,8,0.1);  color: var(--accent-yellow); border: 1px solid rgba(234,179,8,0.2); }
.pill-yellow::before { background: var(--accent-yellow); box-shadow: 0 0 4px var(--accent-yellow); animation: pill-blink 1.5s infinite; }
.pill-blue   { background: rgba(59,130,246,0.1); color: var(--accent-blue);   border: 1px solid rgba(59,130,246,0.2); }
.pill-blue::before   { background: var(--accent-blue); }
.pill-gray   { background: rgba(148,163,184,0.08); color: var(--text-secondary); border: 1px solid var(--border-color); }
.pill-gray::before   { background: var(--text-secondary); }
@keyframes pill-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── METRIC CARD v2 ───────────────────────────────────────────── */
.metric-card-v2 {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.metric-card-v2:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.metric-card-v2 .accent-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px; border-radius: 16px 16px 0 0;
  opacity: 0; transition: opacity 0.25s ease;
}
.metric-card-v2:hover .accent-bar { opacity: 1; }
.metric-card-v2 .meta { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 10px; }
.metric-card-v2 .main-value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.metric-card-v2 .trend { display: flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 12px; font-weight: 600; }
.metric-card-v2 .trend .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.metric-card-v2 .sparkbar { display: flex; align-items: flex-end; gap: 2px; height: 28px; margin-top: 12px; }
.metric-card-v2 .sparkbar span { flex: 1; border-radius: 2px 2px 0 0; opacity: 0.6; transition: opacity 0.2s; min-width: 4px; }
.metric-card-v2:hover .sparkbar span { opacity: 1; }
.progress-wrap { background: rgba(255,255,255,0.06); border-radius: 100px; height: 6px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 100px; transition: width 1s ease; }

/* ── TABLE v2 (enhanced) ──────────────────────────────────────── */
.table-v2 { width: 100%; border-collapse: collapse; }
.table-v2 thead tr { background: rgba(6,6,10,0.6); border-bottom: 1px solid var(--border-color); }
.table-v2 th {
  padding: 11px 14px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary); white-space: nowrap;
  cursor: pointer; user-select: none; transition: color 0.15s;
}
.table-v2 th:hover { color: var(--text-primary); }
.table-v2 th .sort-icon { margin-left: 4px; opacity: 0.4; font-size: 10px; }
.table-v2 th.sorted { color: var(--accent-blue); }
.table-v2 th.sorted .sort-icon { opacity: 1; }
.table-v2 tbody tr { border-bottom: 1px solid var(--border-color); transition: background 0.12s; }
.table-v2 tbody tr:last-child { border-bottom: none; }
.table-v2 tbody tr:nth-child(even) { background: rgba(255,255,255,0.01); }
.table-v2 tbody tr:hover { background: rgba(59,130,246,0.04); }
.table-v2 td { padding: 12px 14px; font-size: 13px; }

/* ── ALERT v2 ─────────────────────────────────────────────────── */
.alert-v2 {
  display: flex; gap: 14px; padding: 16px 18px;
  border-radius: 14px; margin-bottom: 10px;
  border-left: 3px solid;
  backdrop-filter: blur(8px);
  transition: transform 0.2s;
}
.alert-v2:hover { transform: translateX(2px); }
.alert-v2.high   { background: rgba(239,68,68,0.06);  border-color: var(--accent-red); }
.alert-v2.medium { background: rgba(249,115,22,0.06); border-color: var(--accent-orange); }
.alert-v2.low    { background: rgba(59,130,246,0.06); border-color: var(--accent-blue); }
.alert-v2.healthy{ background: rgba(6,214,160,0.06);  border-color: var(--accent-green); }
.alert-v2 .al-icon  { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.alert-v2 .al-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.alert-v2 .al-msg   { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.alert-v2 .al-time  { font-size: 11px; color: var(--text-secondary); margin-top: 5px; opacity: 0.7; }
.alert-v2 .al-badge {
  margin-left: auto; flex-shrink: 0; align-self: flex-start;
  padding: 2px 8px; border-radius: 100px; font-size: 10px; font-weight: 700;
}
.alert-v2.high   .al-badge { background: rgba(239,68,68,0.15);   color: var(--accent-red); }
.alert-v2.medium .al-badge { background: rgba(249,115,22,0.15);  color: var(--accent-orange); }
.alert-v2.low    .al-badge { background: rgba(59,130,246,0.15);  color: var(--accent-blue); }

/* ── EMPTY STATE ──────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px;
  background: var(--bg-secondary);
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 16px;
}
.empty-state .es-icon {
  width: 64px; height: 64px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.empty-state .es-icon svg { width: 28px; height: 28px; color: var(--accent-blue); }
.empty-state h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.empty-state p  { font-size: 13px; color: var(--text-secondary); max-width: 300px; margin: 0 auto 20px; line-height: 1.6; }

/* ── SKELETON ROW ─────────────────────────────────────────────── */
.skeleton-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border-color); }
.skeleton-row:last-child { border-bottom: none; }
.sk { background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
.sk-avatar { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; }
.sk-line { height: 12px; }
.sk-sm   { height: 10px; }

/* ── BTN v2 ───────────────────────────────────────────────────── */
.btn-v2 {
  position: relative; overflow: hidden;
  padding: 9px 20px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none;
}
.btn-v2:active { transform: scale(0.97); }
.btn-v2-primary { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; box-shadow: 0 2px 12px rgba(59,130,246,0.25); }
.btn-v2-primary:hover { background: linear-gradient(135deg, #60a5fa, #3b82f6); box-shadow: 0 4px 20px rgba(59,130,246,0.35); transform: translateY(-1px); }
.btn-v2-ghost  { background: transparent; color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-v2-ghost:hover  { border-color: var(--border-color-hover); background: rgba(255,255,255,0.03); }
.btn-v2-danger { background: rgba(239,68,68,0.1); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.25); }
.btn-v2-danger:hover { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.4); }
.btn-v2-success { background: rgba(6,214,160,0.1); color: var(--accent-green); border: 1px solid rgba(6,214,160,0.25); }
.btn-v2-success:hover { background: rgba(6,214,160,0.18); border-color: rgba(6,214,160,0.4); }

/* ── UTILITIES ───────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── EMPTY STATE — inline variant (inside tables) ────────────── */
.empty-state--inline { border: none; background: none; padding: 28px 24px; }

/* ── SIDEBAR LAYOUT ─────────────────────────────────────────── */
:root {
  --sidebar-width: 260px;
  --sidebar-collapsed: 64px;
  --sidebar-bg: rgba(10, 10, 16, 0.85);
  --sidebar-bg-expanded: rgba(10, 10, 16, 0.92);
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-link-hover: rgba(255, 255, 255, 0.04);
  --sidebar-link-active-bg: rgba(59, 130, 246, 0.08);
  --sidebar-link-active-border: var(--accent-blue);
}

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-collapsed);
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--sidebar-border);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.25s ease,
              box-shadow 0.25s ease;
}

/* Expanded on hover — glass overlay, no page reflow */
.sidebar:hover {
  width: var(--sidebar-width);
  background: var(--sidebar-bg-expanded);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
}

/* Content offset — always collapsed width, sidebar overlays on expand */
body.has-sidebar #app-content {
  margin-left: var(--sidebar-collapsed);
  min-height: 100vh;
}

/* ── Hide text when collapsed, show on hover ── */
.sidebar .sidebar-logo-text,
.sidebar .sidebar-link span,
.sidebar .sidebar-section-label,
.sidebar .sidebar-user-info,
.sidebar .sidebar-logout span {
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.sidebar:hover .sidebar-logo-text,
.sidebar:hover .sidebar-link span,
.sidebar:hover .sidebar-section-label,
.sidebar:hover .sidebar-user-info,
.sidebar:hover .sidebar-logout span {
  opacity: 1;
  pointer-events: auto;
}

/* ── Sidebar sections — tighter padding when collapsed ── */
.sidebar-top    { padding: 16px 14px 12px; }
.sidebar-main   { flex: 1; padding: 4px 10px; overflow-y: auto; overflow-x: hidden; }
.sidebar-bottom { padding: 12px 14px 16px; }

/* ── Logo ── */
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 6px; margin-bottom: 16px;
  text-decoration: none; color: inherit;
}
.sidebar-logo-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo-icon svg { width: 16px; height: 16px; color: #fff; }
.sidebar-logo-text {
  font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -0.025em;
}

/* ── Section label ── */
.sidebar-section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(148, 163, 184, 0.5);
  padding: 12px 12px 6px;
  height: 30px; /* keep space even when hidden */
}

/* ── Links ── */
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  border: 1px solid transparent;
  margin-bottom: 2px;
}
.sidebar-link:hover {
  background: var(--sidebar-link-hover);
  color: var(--text-primary);
}
.sidebar-link-active {
  background: var(--sidebar-link-active-bg);
  color: var(--accent-blue);
  border-color: rgba(59, 130, 246, 0.15);
}
.sidebar-link svg {
  width: 18px; height: 18px; flex-shrink: 0;
}

/* ── Divider ── */
.sidebar-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin-bottom: 12px;
}

/* ── User section ── */
.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s;
  color: inherit;
}
.sidebar-user:hover { background: var(--sidebar-link-hover); }

.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  overflow: hidden; flex-shrink: 0;
}
.sidebar-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.sidebar-avatar-initials {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(139,92,246,0.2));
  border: 1px solid rgba(59,130,246,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--accent-blue);
  text-transform: uppercase; flex-shrink: 0;
}
.sidebar-user-info {
  display: flex; flex-direction: column; min-width: 0;
}
.sidebar-user-name {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-plan {
  font-size: 11px; color: var(--text-secondary); text-transform: capitalize;
}

/* ── Logout ── */
.sidebar-logout {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 10px 12px; margin-top: 8px;
  border-radius: 10px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  background: none; border: 1px solid transparent;
  cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.sidebar-logout:hover {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.15);
}
.sidebar-logout svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Mobile trigger + backdrop ── */
.sidebar-mobile-trigger {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 50;
  padding: 10px;
  background: rgba(15, 15, 24, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}
.sidebar-mobile-trigger:hover { color: var(--text-primary); }
.sidebar-mobile-trigger svg { width: 20px; height: 20px; display: block; }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 49;
}

/* ── Mobile responsive — full-width slide-in (no collapse) ── */
@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-width) !important;
    transform: translateX(-100%);
    z-index: 100;
  }
  .sidebar:hover {
    box-shadow: none;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  /* All text visible on mobile (full sidebar) */
  .sidebar .sidebar-logo-text,
  .sidebar .sidebar-link span,
  .sidebar .sidebar-section-label,
  .sidebar .sidebar-user-info,
  .sidebar .sidebar-logout span {
    opacity: 1;
    pointer-events: auto;
  }
  body.has-sidebar #app-content {
    margin-left: 0;
    padding-top: 56px;
  }
  .sidebar-mobile-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .sidebar-backdrop {
    display: none;
  }
  body.sidebar-open .sidebar-backdrop {
    display: block;
  }
}

@media (min-width: 769px) {
  .sidebar-mobile-trigger { display: none !important; }
  .sidebar-backdrop { display: none !important; }
}

/* ── MARKET CONDITIONS ── */
.market-conditions {
  background: var(--bg-secondary); backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px; padding: 20px 24px; margin-bottom: 24px;
}
.market-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.market-header h2 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; letter-spacing: -0.01em; }
.market-condition-badge {
  font-size: 13px; padding: 6px 16px; border-radius: 100px; font-weight: 600;
  backdrop-filter: blur(4px);
}
.market-condition-badge.bullish { background: rgba(6,214,160,0.12); color: var(--accent-green); border: 1px solid rgba(6,214,160,0.25); }
.market-condition-badge.bearish { background: rgba(239,68,68,0.12); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.25); }
.market-condition-badge.neutral { background: rgba(234,179,8,0.12); color: var(--accent-yellow); border: 1px solid rgba(234,179,8,0.25); }
.market-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.market-grid .metric-card-v2 .trend { margin-top: 4px; }
.majors-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-color); }
.majors-row .metric-card-v2 .meta { display: flex; align-items: center; gap: 8px; }
.majors-row .metric-card-v2 .coin-icon { width: 22px; height: 22px; border-radius: 50%; }
.majors-row .metric-card-v2 .coin-indicators { font-size: 11px; color: var(--text-secondary); margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.majors-row .metric-card-v2 .coin-indicators .ind-tag { padding: 1px 6px; border-radius: 4px; white-space: nowrap; font-weight: 500; }
.majors-row .metric-card-v2 .coin-indicators .ind-bullish { color: var(--accent-green); background: rgba(6, 214, 160, 0.12); }
.majors-row .metric-card-v2 .coin-indicators .ind-bearish { color: var(--accent-red); background: rgba(239, 68, 68, 0.12); }
.majors-row .metric-card-v2 .coin-indicators .ind-neutral { color: var(--text-secondary); background: rgba(148, 163, 184, 0.1); }
.coin-name { color: var(--text-secondary); font-size: 11px; font-weight: normal; margin-left: 3px; }
.top-movers { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-color); }
.movers-section h3 { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.mover-item { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.mover-symbol { color: var(--accent-blue); }
.ml-bar { display: flex; gap: 3px; height: 6px; border-radius: 3px; overflow: hidden; margin-top: 10px; }
.ml-bar div { transition: flex 0.5s; border-radius: 3px; }
.ml-bar-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-secondary); margin-top: 4px; }

@media (max-width: 768px) {
  .majors-row { grid-template-columns: 1fr; }
  .top-movers { grid-template-columns: 1fr; }
}

/* ============================================
   OAuth buttons (login, register, profile)
   ============================================ */
.oauth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 16px; color: var(--text-muted); font-size: 12px;
}
.oauth-divider::before, .oauth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border-color);
}
.oauth-buttons {
  display: flex; flex-direction: column; gap: 10px;
}
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500;
  text-decoration: none; transition: opacity 0.2s, transform 0.1s;
  cursor: pointer; border: 1px solid var(--border-color);
}
.oauth-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.oauth-btn:active { transform: translateY(0); }
.oauth-google { background: #fff; color: #3c4043; }
.oauth-github { background: #24292e; color: #fff; }
.oauth-facebook { background: #1877F2; color: #fff; }
.oauth-providers-list { display: flex; flex-direction: column; gap: 8px; }
.oauth-provider-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-color);
}
.oauth-provider-info { display: flex; align-items: center; gap: 12px; }
.oauth-provider-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.oauth-provider-icon.google { background: #fff; }
.oauth-provider-icon.github { background: #24292e; }
.oauth-provider-icon.facebook { background: #1877F2; }
.oauth-provider-name { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.oauth-provider-email { font-size: 12px; color: var(--text-secondary); }
.oauth-provider-action .pill { cursor: default; }
