:root {
    --primary-blue: #2563EB; /* Azul Asovolaro */
    --light-bg: #F8FAFC;     /* Gris muy claro para fondos */
    --border-color: #E2E8F0; /* Color de bordes sutiles */
    --sidebar-w: 260px;      /* Ancho del menú lateral */
    --header-h: 70px;        /* Alto del header */
    --text-main: #1E293B;
    --text-muted: #64748B;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background-color: #fff;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- HEADER --- */
.main-header {
    height: var(--header-h);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between; /* Separa Logo - Buscador - Link */
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1.5rem;
}

.logo-area {
    min-width: 140px;
    display: flex;
    align-items: center;
}
.brand-text h1 { color: var(--primary-blue); font-size: 1.2rem; margin: 0; line-height: 1.2; }
.brand-text .subtitle { color: var(--primary-blue); font-weight: 600; font-size: 0.8rem; }

/* ESTILOS DEL BUSCADOR CENTRAL */
.header-search-container {
    flex: 1; /* Ocupa todo el espacio central disponible */
    display: flex;
    justify-content: center; /* Centra la barra en el medio */
}

.search-bar-wrapper {
    width: 100%;
    max-width: 600px; /* Ancho máximo para que no se vea gigante */
    display: flex;
    align-items: center;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px; /* Bordes redondeados */
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
}

/* Efecto al hacer clic en el buscador */
.search-bar-wrapper:focus-within {
    background-color: #fff;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    color: #94A3B8;
    margin-right: 0.8rem;
    flex-shrink: 0;
}

.search-bar-wrapper input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-main);
}
.search-bar-wrapper input::placeholder { color: #94A3B8; }

.header-actions {
    min-width: 140px;
    text-align: right;
}
.back-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-w);
    background: #fff;
    border-right: 1px solid var(--border-color);
    padding: 2rem 1rem;
    /* Fijo para que no se mueva al scrollear el contenido */
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    left: 0;
    overflow-y: auto;
}

.nav-category {
    text-transform: uppercase;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.5rem;
    margin-top: 1.5rem;
    padding-left: 0.5rem;
    letter-spacing: 0.05em;
}
.nav-category:first-child { margin-top: 0; }

.nav-item {
    display: block;
    padding: 0.6rem 0.8rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    margin-bottom: 2px;
}

.nav-item:hover {
    background-color: var(--light-bg);
    color: var(--primary-blue);
}

.nav-item.active {
    background-color: #EFF6FF; /* Fondo azul muy muy suave */
    color: var(--primary-blue);
    font-weight: 600;
}

/* --- CONTENIDO PRINCIPAL --- */
.content-area {
    margin-left: var(--sidebar-w); /* Deja espacio para el sidebar fijo */
    padding: 3rem 4rem;
    width: calc(100% - var(--sidebar-w));
}

#documentViewer h1 { font-size: 2rem; margin-bottom: 1.5rem; color: #0F172A; }
#documentViewer h2 { font-size: 1.5rem; margin: 2rem 0 1rem 0; color: #1E293B; }
#documentViewer p { line-height: 1.7; color: #334155; margin-bottom: 1rem; }
#documentViewer ul { margin-left: 1.5rem; margin-bottom: 1rem; color: #334155; }
#documentViewer li { margin-bottom: 0.5rem; }

/* Animación suave al cargar contenido */
.fade-in { animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn {
    from { opacity: 0.5; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive básico */
@media (max-width: 768px) {
    .sidebar { display: none; } /* En móvil ocultamos sidebar por ahora */
    .content-area { margin-left: 0; width: 100%; padding: 2rem; }
    .header-search-container { display: none; } /* En móvil simplificamos */
}