/* --- VARIABLES DE MODO OSCURO (PEGAR AL INICIO DEL ARCHIVO) --- */
:root {
  --bg-primary: #050810;
  --bg-secondary: #0a1024;
  --surface-solid: #0f172a;
  --surface: rgba(15, 23, 42, 0.6);
  --border: rgba(255, 255, 255, 0.08);
  --text: #cbd5e1;
  --text-bright: #f8fafc;
  --text-muted: #64748b;
  
  --accent-cyan: #00d4ff;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  
  --accent-cyan-soft: rgba(0, 212, 255, 0.1);
  --accent-cyan-glow: rgba(0, 212, 255, 0.2);
  
  --neo-out: 8px 8px 16px rgba(0, 0, 0, 0.4), -8px -8px 16px rgba(255, 255, 255, 0.02);
}
/* Dashboard Specific Styles */
.dash-layout { display: flex; height: 100vh; overflow: hidden; background: var(--bg-secondary); font-family: 'Inter', sans-serif; color: var(--text); }
.dash-sidebar { width: 260px; background: var(--surface-solid); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 24px; z-index: 10; }
.dash-logo { font-family: 'Roboto Mono', monospace; font-size: 1.5rem; font-weight: 700; color: var(--text-bright); margin-bottom: 40px; display: flex; align-items: center; gap: 12px; }
.dash-logo i { color: var(--accent-cyan); }
.dash-nav { display: flex; flex-direction: column; gap: 8px; position: relative; }
.dash-nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 8px; color: var(--text-muted); font-weight: 500; font-size: 0.9rem; transition: all 0.3s; cursor: pointer; position: relative; z-index: 2; border-left: 3px solid transparent; }
.dash-nav-item i { width: 20px; text-align: center; }
.dash-nav-item.active, .dash-nav-item:hover { color: var(--accent-cyan); }
.dash-main { flex: 1; display: flex; flex-direction: column; overflow-y: auto; position: relative; }
.dash-main::before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px); background-size: 40px 40px; z-index: 0; pointer-events: none; }
.dash-topbar { height: 70px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: rgba(10, 16, 36, 0.85); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.topbar-left { display: flex; align-items: center; gap: 20px; }
.page-title { font-family: 'Outfit', sans-serif; font-size: 1.25rem; font-weight: 600; color: var(--text-bright); }
.kyc-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; background: rgba(16, 185, 129, 0.1); color: #10B981; font-size: 0.7rem; font-weight: 700; border: 1px solid rgba(16, 185, 129, 0.2); text-transform: uppercase; letter-spacing: 0.5px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.wallet-btn { background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan)); color: #050810; border: none; padding: 8px 16px; border-radius: 6px; font-weight: 700; font-size: 0.8rem; display: flex; align-items: center; gap: 8px; cursor: pointer; box-shadow: 0 0 15px var(--accent-cyan-glow); transition: all 0.3s; position: relative; overflow: hidden; will-change: transform; -webkit-tap-highlight-color: transparent; }
.dash-content { padding: 32px; flex: 1; position: relative; z-index: 1; transition: opacity 0.3s ease; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 24px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: var(--neo-out); position: relative; overflow: hidden; }
.kpi-card::after { content: ''; position: absolute; top: 0; right: 0; width: 60px; height: 60px; background: radial-gradient(circle, var(--accent-cyan-soft) 0%, transparent 70%); border-radius: 50%; transform: translate(20px, -20px); }
.kpi-label { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; font-weight: 600; }
.kpi-value { font-family: 'Roboto Mono', monospace; font-size: 1.8rem; font-weight: 700; color: var(--text-bright); margin-bottom: 8px; }
.kpi-change { font-size: 0.8rem; font-weight: 500; display: flex; align-items: center; gap: 4px; }
.kpi-change.positive { color: #10B981; }
.chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 24px; }
@media (max-width: 1024px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: var(--neo-out); position: relative; }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.chart-title { font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 600; color: var(--text-bright); }
.chart-container { position: relative; height: 300px; width: 100%; }
.tx-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: var(--neo-out); overflow-x: auto; }
.tx-table { width: 100%; border-collapse: collapse; }
.tx-table th, .tx-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.tx-table th { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.tx-table td { color: var(--text); font-size: 0.85rem; font-family: 'Roboto Mono', monospace; }
.tx-table tr:last-child td { border-bottom: none; }
.tx-table tr:hover { background: rgba(255,255,255,0.02); }
.status-tag { padding: 4px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; font-family: 'Inter', sans-serif; }
.status-tag.success { background: rgba(16, 185, 129, 0.1); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.2); }
.status-tag.pending { background: rgba(245, 158, 11, 0.1); color: #F59E0B; border: 1px solid rgba(245, 158, 11, 0.2); }

/* FLASH Y NOTIFICACIONES */
.system-flash { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--accent-cyan); opacity: 0; pointer-events: none; z-index: 9999; animation: sys-flash 0.4s ease-out forwards; }
@keyframes sys-flash { 0% { opacity: 0.15; } 100% { opacity: 0; } }
.immersive-toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 10000; display: flex; flex-direction: column; gap: 12px; }
.immersive-toast { background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(20px); border: 1px solid var(--border); border-left: 3px solid var(--accent-cyan); padding: 16px 24px; border-radius: 8px; color: var(--text-bright); font-family: 'Roboto Mono', monospace; font-size: 0.8rem; box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 15px var(--accent-cyan-glow); transform: translateX(120%); animation: toast-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.immersive-toast.removing { animation: toast-out 0.3s ease-in forwards; }
@keyframes toast-in { to { transform: translateX(0); } }
@keyframes toast-out { to { transform: translateX(120%); opacity: 0; } }

/* SIDEBAR SLIDER */
.nav-slider { position: absolute; background: var(--accent-cyan-soft); border-radius: 8px; left: 0; top: 0; width: 100%; height: 44px; z-index: 1; transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); box-shadow: 0 0 20px rgba(0, 212, 255, 0.2); border-left: 3px solid var(--accent-cyan); }
.dash-nav-item:hover { color: var(--text-bright); background: transparent !important; }
.dash-nav-item.active { color: var(--accent-cyan) !important; background: transparent !important; font-weight: 700; }

/* ESTILOS PARA LAS NUEVAS VISTAS INMERSIVAS */
.rwa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; margin-bottom: 32px; }
.rwa-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: var(--neo-out); transition: all 0.3s; cursor: pointer; position: relative; overflow: hidden; }
.rwa-card:hover { border-color: var(--accent-cyan); transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.rwa-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.rwa-icon { width: 48px; height: 48px; background: var(--accent-cyan-soft); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: var(--accent-cyan); }
.rwa-apy { font-family: 'Roboto Mono', monospace; color: #10B981; font-weight: 700; font-size: 0.9rem; }
.rwa-title { font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 600; color: var(--text-bright); margin-bottom: 4px; }
.rwa-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 20px; }
.rwa-stats { display: flex; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 16px; }
.rwa-stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.rwa-stat-value { font-family: 'Roboto Mono', monospace; font-weight: 700; color: var(--text); margin-top: 4px; }

/* Panel de Compra Inmersivo */
.buy-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 32px; box-shadow: var(--neo-out); display: none; animation: fadeSlideUp 0.4s ease-out; }
.buy-panel.active { display: block; }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.input-group { margin-bottom: 24px; }
.input-group label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.immersive-input { width: 100%; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 8px; padding: 16px; color: var(--text-bright); font-family: 'Roboto Mono', monospace; font-size: 1.2rem; font-weight: 700; outline: none; transition: all 0.3s; box-sizing: border-box; }
.immersive-input:focus { border-color: var(--accent-cyan); box-shadow: 0 0 15px rgba(0, 212, 255, 0.15); }
.action-btn { width: 100%; padding: 16px; border: none; border-radius: 8px; font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.3s; display: flex; align-items: center; justify-content: center; gap: 10px; }
.action-btn.primary { background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan)); color: #050810; box-shadow: 0 0 20px var(--accent-cyan-glow); }
.action-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(0, 212, 255, 0.5); }
.action-btn.success-state { background: rgba(16, 185, 129, 0.2); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.4); pointer-events: none; }
.yield-claim-box { background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(59, 130, 246, 0.05)); border: 1px solid var(--border); border-radius: 12px; padding: 32px; text-align: center; margin-bottom: 24px; }
.yield-claim-amount { font-family: 'Roboto Mono', monospace; font-size: 3rem; font-weight: 700; color: var(--text-bright); margin: 16px 0; }
/* ======================================================================
   MAGIA INMERSIVA DE ALTA GAMA (AÑADIR AL FINAL DEL CSS)
   ====================================================================== */

/* Sistema de Páginas Ocultables (Para no destruir el HTML original) */
.page-view { display: none; animation: fadeInPage 0.4s ease-out; }
.page-view.active-page { display: block; }
@keyframes fadeInPage { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Flash de Sistema Inmersivo */
.system-flash { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--accent-cyan); opacity: 0; pointer-events: none; z-index: 9999; animation: sys-flash 0.4s ease-out forwards; }
@keyframes sys-flash { 0% { opacity: 0.15; } 100% { opacity: 0; } }

/* Notificaciones Flotantes Cyberpunk */
.immersive-toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 10000; display: flex; flex-direction: column; gap: 12px; }
.immersive-toast { background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(20px); border: 1px solid var(--border); border-left: 3px solid var(--accent-cyan); padding: 16px 24px; border-radius: 8px; color: var(--text-bright); font-family: 'Roboto Mono', monospace; font-size: 0.8rem; box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 15px var(--accent-cyan-glow); transform: translateX(120%); animation: toast-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.immersive-toast.removing { animation: toast-out 0.3s ease-in forwards; }
@keyframes toast-in { to { transform: translateX(0); } }
@keyframes toast-out { to { transform: translateX(120%); opacity: 0; } }

/* Slider Neón del Menú Lateral */
.nav-slider { position: absolute; background: var(--accent-cyan-soft); border-radius: 8px; left: 0; top: 0; width: 100%; height: 44px; z-index: 1; transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); box-shadow: 0 0 20px rgba(0, 212, 255, 0.2); border-left: 3px solid var(--accent-cyan); pointer-events: none; }
.dash-nav-item { position: relative; z-index: 2; border-left: 3px solid transparent !important; }
.dash-nav-item:hover { background: transparent !important; color: var(--text-bright) !important; }
.dash-nav-item.active { background: transparent !important; color: var(--accent-cyan) !important; font-weight: 700; }

/* Tarjetas de Tokens RWA */
.rwa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; margin-bottom: 32px; }
.rwa-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: var(--neo-out); transition: all 0.3s; cursor: pointer; }
.rwa-card:hover { border-color: var(--accent-cyan); transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.rwa-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.rwa-icon { width: 48px; height: 48px; background: var(--accent-cyan-soft); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: var(--accent-cyan); }
.rwa-apy { font-family: 'Roboto Mono', monospace; color: #10B981; font-weight: 700; font-size: 0.9rem; }
.rwa-title { font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 600; color: var(--text-bright); margin-bottom: 4px; }
.rwa-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 20px; }
.rwa-stats { display: flex; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 16px; }
.rwa-stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.rwa-stat-value { font-family: 'Roboto Mono', monospace; font-weight: 700; color: var(--text); margin-top: 4px; }

/* Panel de Compra Inmersivo */
.buy-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 32px; box-shadow: var(--neo-out); display: none; animation: fadeSlideUp 0.4s ease-out; }
.buy-panel.active { display: block; }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.input-group { margin-bottom: 24px; }
.input-group label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.immersive-input { width: 100%; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 8px; padding: 16px; color: var(--text-bright); font-family: 'Roboto Mono', monospace; font-size: 1.2rem; font-weight: 700; outline: none; transition: all 0.3s; box-sizing: border-box; }
.immersive-input:focus { border-color: var(--accent-cyan); box-shadow: 0 0 15px rgba(0, 212, 255, 0.15); }
.action-btn { width: 100%; padding: 16px; border: none; border-radius: 8px; font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.3s; display: flex; align-items: center; justify-content: center; gap: 10px; }
.action-btn.primary { background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan)); color: #050810; box-shadow: 0 0 20px var(--accent-cyan-glow); }
.action-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(0, 212, 255, 0.5); }
.action-btn.success-state { background: rgba(16, 185, 129, 0.2); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.4); pointer-events: none; }
.yield-claim-box { background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(59, 130, 246, 0.05)); border: 1px solid var(--border); border-radius: 12px; padding: 32px; text-align: center; margin-bottom: 24px; }
.yield-claim-amount { font-family: 'Roboto Mono', monospace; font-size: 3rem; font-weight: 700; color: var(--text-bright); margin: 16px 0; }
/* ======================================================================
   MODO RESPONSIVE INMERSIVO (AÑADIR AL FINAL DEL CSS)
   ====================================================================== */

/* Fondo borroso que aparece detrás del menú al abrirse en móvil */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Botón hamburguesa inyectado por JS (Estilos base por si falla JS) */
#mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-bright);
  font-size: 1.2rem;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 12px;
  transition: all 0.3s;
}
#mobile-menu-btn:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }

/* --- PANTALLAS PEQUEÑAS (Tablets y Móviles) --- */
@media (max-width: 768px) {
  #mobile-menu-btn { display: flex; align-items: center; justify-content: center; }

  .dash-sidebar {
    position: fixed;
    left: -280px; /* Lo escondemos fuera de la pantalla */
    top: 0;
    bottom: 0;
    z-index: 10;
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
  }

  .dash-sidebar.mobile-open {
    left: 0; /* Lo deslizamos dentro */
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  .dash-topbar { padding: 0 16px; }
  
  .dash-content { padding: 16px; } /* Menos margen en los bordes */

  .kpi-grid { grid-template-columns: 1fr; } /* Las tarjetas KPI se apilan */
  .kpi-value { font-size: 1.4rem; } /* Texto más pequeño para que quepa */

  .chart-grid { grid-template-columns: 1fr; }
  .chart-container { height: 220px; } /* Gráficos más pequeños */

  .rwa-grid { grid-template-columns: 1fr; } /* Tokens se apilan */

  /* La tabla se vuelve horizontal para no destrozar el diseño */
  .tx-table-wrap { padding: 16px; }
  .tx-table { min-width: 600px; }

  /* Notificaciones flotantes se adaptan a los bordes */
  .immersive-toast-container { left: 16px; right: 16px; bottom: 16px; }
  .immersive-toast { font-size: 0.7rem; padding: 12px 16px; }
  
  .yield-claim-amount { font-size: 2.2rem; }
}

/* --- PANTALLAS MUY PEQUEÑAS (iPhones SE, Android pequeños) --- */
@media (max-width: 400px) {
  .kyc-badge { display: none; } /* Ocultamos el badge para dar espacio al título */
  .page-title { font-size: 1rem; }
  .wallet-btn { padding: 6px 10px; font-size: 0.7rem; }
  .wallet-btn span { display: none; } /* Oculta el texto largo del wallet, deja solo el icono */
}
