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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  /*  FIX: Transparente para mostrar el degradado animado de themes.css */
  background: transparent; 
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: var(--letter-spacing-base);
  overflow-x: hidden; /* Evita scroll horizontal por animaciones */
}

/* ===== APP LAYOUT ===== */
#app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: transparent;
}

/* ===== SIDEBAR (Efecto Vidrio) ===== */
.sidebar {
  background: rgba(15, 23, 42, 0.92); /* Base oscura casi opaca */
  backdrop-filter: blur(12px); /* Efecto borroso detrás */
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-inverse);
  display: flex; flex-direction: column; padding: var(--space-4);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.1); /* Borde sutil */
  z-index: 20;
}

/* ... Resto del Sidebar igual ... */
.sidebar-header { padding-bottom: var(--space-6); border-bottom: 1px solid rgba(255,255,255,0.15); margin-bottom: var(--space-4); }
.sidebar-header h1 { font-size: var(--text-xl); font-weight: 800; margin-bottom: var(--space-1); letter-spacing: -0.02em; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.sidebar-header .version { font-size: var(--text-xs); opacity: 0.7; }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: var(--space-2); }

.nav-item {
  background: transparent; border: none; color: rgba(255,255,255,0.85);
  padding: var(--space-3) var(--space-4); text-align: left; border-radius: var(--radius);
  cursor: pointer; font-size: var(--text-sm); font-weight: 500;
  transition: all var(--transition-fast);
}
.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,0.15);
  color: white;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.sidebar-footer { padding-top: var(--space-4); border-top: 1px solid rgba(255,255,255,0.15); display: flex; flex-direction: column; gap: var(--space-3); }
.user-session { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.btn-sm { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; padding: var(--space-2) var(--space-3); border-radius: var(--radius); font-size: var(--text-xs); cursor: pointer; transition: all var(--transition-fast); }
.btn-sm:hover { background: rgba(255,255,255,0.25); box-shadow: 0 2px 6px rgba(0,0,0,0.2); }

/* ===== MAIN CONTENT (Transparente) ===== */
.main-content {
  display: flex; flex-direction: column;
  background: transparent; /*  Transparente */
  min-height: 100vh;
  position: relative; z-index: 1;
}

/* TOPBAR con Glassmorphism */
.topbar {
  background: rgba(255, 255, 255, 0.75); /* Blanco semi-transparente */
  backdrop-filter: blur(16px); /* Desenfoca lo que pasa por debajo */
  -webkit-backdrop-filter: blur(16px);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 10;
  transition: background 0.3s ease;
}
html.theme-dark .topbar {
  background: rgba(15, 23, 42, 0.8); /* Oscuro semi-transparente */
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.page-title { font-size: var(--text-xl); font-weight: 700; color: var(--brand-primary); letter-spacing: -0.01em; }
.topbar-actions { display: flex; gap: var(--space-2); }

.view-container {
  flex: 1; padding: var(--space-6); overflow-y: auto;
  /* Sombra interna suave para dar profundidad al contenido sobre el fondo */
  box-shadow: inset 0 10px 20px -10px rgba(0,0,0,0.05);
}

/* ... Resto (Responsive) igual ... */
@media (max-width: 768px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -240px; transition: left var(--transition-normal); z-index: 100; background: var(--brand-primary); }
  .sidebar.open { left: 0; }
  .topbar { padding: var(--space-3) var(--space-4); }
  .view-container { padding: var(--space-4); }
}
.topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  /* ... el resto se mantiene igual ... */
}

html.theme-dark .topbar {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}