:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --sidebar-bg: #1a1a1a;
    --sidebar-width-collapsed: 60px;
    --sidebar-width-expanded: 240px;
    --text-light: #ecf0f1;
    --bg-light: #f4f6f9;
    --transition-speed: 0.3s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-light);
    height: 100vh;
    overflow: hidden;
}

/* --- Auth Overlay (Pantalla de Login) --- */
.auth-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(44, 62, 80, 0.95); /* Fondo oscuro semitransparente */
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.auth-card h2 { margin-bottom: 1rem; color: var(--primary-color); }
.auth-card p { margin-bottom: 2rem; color: #666; }

/* Utilidad para ocultar elementos */
.hidden { display: none !important; }

/* --- Layout Principal --- */
.app-container {
    display: flex;
    height: 100vh;
    transition: filter 0.3s;
}

.blur-content {
    filter: blur(5px);
    pointer-events: none;
}

/* --- Sidebar (Barra Lateral) --- */
.sidebar {
    background-color: var(--sidebar-bg);
    color: var(--text-light);
    width: var(--sidebar-width-expanded);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed) ease;
    white-space: nowrap;
    overflow: hidden;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 100;
}

.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

.sidebar-header {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-area {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    padding-left: 8px;
}

.logo-text { 
    transition: opacity 0.2s; 
    font-weight: 500; 
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    min-width: 30px;
    outline: none;
}

.sidebar.collapsed .logo-text { opacity: 0; pointer-events: none; }

/* Menu Items */
.menu-items {
    list-style: none;
    flex-grow: 1;
    margin-top: 20px;
    padding: 0;
}

.menu-items li a {
    display: flex;
    align-items: center;
    padding: 15px 18px;
    color: #bbb;
    text-decoration: none;
    transition: all 0.2s;
    height: 50px;
    border-left: 4px solid transparent;
}

.menu-items li a:hover {
    background-color: rgba(255,255,255,0.05);
    color: white;
}

.menu-items li a.active {
    background-color: rgba(52, 152, 219, 0.15); /* Tinte azul */
    color: white;
    border-left-color: var(--accent-color);
}

.menu-items li a i {
    min-width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.link-text {
    margin-left: 15px;
    opacity: 1;
    transition: opacity 0.2s;
}

.sidebar.collapsed .link-text {
    opacity: 0;
    pointer-events: none;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(0,0,0,0.2);
}

.user-info { display: flex; align-items: center; overflow: hidden; }
.user-info img { width: 32px; height: 32px; border-radius: 50%; margin-right: 10px; border: 2px solid rgba(255,255,255,0.2); }
#logout-btn { background: none; border: none; color: #e74c3c; cursor: pointer; font-size: 1.1rem; padding: 5px; transition: transform 0.2s; }
#logout-btn:hover { transform: scale(1.1); }

/* --- Content Area (Frames) --- */
.content-area {
    flex-grow: 1;
    background-color: #fff;
    position: relative;
    display: flex;
    flex-direction: column;
}

.app-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.placeholder-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ccc;
}
.placeholder-content i { font-size: 5rem; margin-bottom: 20px; display: block; color: #e0e0e0;}
.placeholder-content h3 { font-weight: 300; color: #7f8c8d; }

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar { position: absolute; height: 100%; }
    .sidebar.collapsed { width: 0; } /* Ocultar completamente en móvil */
    .app-container { margin-left: 0; }
}
