:root {
  /* Paleta "Deep Space" - Profesional y Moderna */
  --bg-app: #09090b;          /* Casi negro, muy elegante */
  --bg-sidebar: #0f1014;      /* Ligeramente más claro */
  --bg-card: #18181b;         /* Para elementos flotantes */
  
  --border-subtle: rgba(255, 255, 255, 0.08); /* Bordes casi invisibles */
  --border-active: rgba(255, 255, 255, 0.15);
  
  --text-main: #ededef;       /* Blanco roto (no cansa la vista) */
  --text-muted: #a1a1aa;      /* Gris plata */
  
  --accent-glow: rgba(56, 189, 248, 0.15); /* Resplandor azul */
  --accent-color: #38bdf8;    /* Azul Cian tecnológico */
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; outline: none; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased; /* Texto nítido en Mac/iOS */
}

/* --- LAYOUT PRINCIPAL --- */
.main-container {
  display: grid;
  grid-template-columns: 280px 1fr; /* Sidebar fija, contenido flexible */
  height: 100vh;
}

/* --- SIDEBAR (PANEL IZQUIERDO) --- */
.sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
}

.brand {
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Si tienes logo, se verá genial. Si no, el texto lo sostiene */
.logo-img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }

.brand-text h1 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--text-main);
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.nav-section h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #52525b; /* Gris oscuro para títulos secundarios */
  margin-bottom: 16px;
  padding-left: 8px;
}

.doc-list { list-style: none; padding: 0; margin: 0; }

.doc-item {
  display: block;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.doc-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.doc-item.active {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  font-weight: 500;
}

/* Pequeño indicador azul en el item activo */
.doc-item.active::before {
  content: "•";
  color: var(--accent-color);
  margin-right: 8px;
}

/* --- VISOR (DERECHA) --- */
.viewer-section {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--bg-app);
  position: relative;
}

/* Header Flotante con Glassmorphism */
.viewer-header {
  padding: 24px 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 9, 11, 0.8); /* Transparencia */
  backdrop-filter: blur(12px);     /* Efecto borroso detrás */
  z-index: 10;
}

.info-text h2 {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 8px 0;
  letter-spacing: -0.01em;
}

.info-text p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 600px;
  line-height: 1.5;
}

/* Botones Premium */
.info-actions { display: flex; gap: 12px; }

.btn {
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
}

.btn-primary {
  background: var(--text-main);
  color: var(--bg-app);
}
.btn-primary:hover {
  background: white;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  background: transparent;
}
.btn-secondary:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

/* --- IFRAME (DOCUMENTO) --- */
.iframe-wrapper {
  flex: 1;
  padding: 30px 40px;
  overflow: hidden;
}

.iframe-container {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.7); /* Sombra profunda */
  background: #1a1a1a; /* Fondo mientras carga */
  border: 1px solid var(--border-subtle);
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* --- FOOTER --- */
.footer {
  position: absolute;
  bottom: 0;
  right: 0;
  padding: 10px 40px;
  font-size: 0.7rem;
  color: #3f3f46;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 900px) {
  .main-container { grid-template-columns: 1fr; overflow-y: auto; display: block; }
  .sidebar { padding: 20px; border-bottom: 1px solid var(--border-subtle); }
  .viewer-header { flex-direction: column; align-items: flex-start; gap: 20px; padding: 20px; }
  .iframe-wrapper { height: 600px; padding: 20px; }
}