/* Global Styles */

/* Layout */
.app-layout {
    display: flex;
    flex-direction: column;
    /* Cambiado a columna */
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-secondary);
}

.workspace-container {
    display: flex;
    flex: 1;
    /* Ocupa el resto del espacio */
    overflow: hidden;
    position: relative;
    padding-top: 1rem;
    /* Espacio entre stats y workspace */
}

/* Global Top Header */
.top-header-global {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    margin: 0;
    border-bottom: 1px solid var(--glass-border);
    border-radius: 0 0 0 0;
    /* Full width sin bordes redondeados */
    flex-shrink: 0;
    z-index: 20;
    background-color: var(--bg-primary);
    /* Asegurar fondo solido o glass */
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-brand .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-500);
}

.header-brand .divider-vertical {
    width: 1px;
    height: 24px;
    background-color: var(--glass-border);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Stats Bar Container (Piso 2) */
.stats-bar-container {
    padding: 1rem 1rem 0 1rem;
    flex-shrink: 0;
}

/* Sidebar (Piso 3 Left) */
.sidebar {
    width: 220px;
    display: flex;
    flex-direction: column;
    border-radius: 0 16px 0 0;
    /* Solo esquina superior derecha */
    border-right: 1px solid var(--glass-border);
    z-index: 10;
    transition: width 0.3s ease;
    margin-top: 0;
    /* Pegado arriba del workspace */
    height: 100%;
    background-color: var(--bg-primary);
    /* Diferenciar del fondo global */
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background-color: transparent;
}

.content-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* ... existing nav styles ... */
.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0.5rem;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-item .icon {
    font-size: 1.25rem;
    line-height: 1;
}

.nav-item:hover {
    background-color: var(--glass-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--primary-100);
    color: var(--primary-600);
    font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.user-profile-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.user-profile-mini .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-profile-mini .user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.user-profile-mini .name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-profile-mini .email {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#logoutBtn {
    flex-shrink: 0;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Soft Danger Button */
.btn-danger-soft {
    background-color: #fee2e2;
    /* Red-100 */
    color: #ef4444;
    /* Red-500 */
    border: 1px solid #fca5a5;
    /* Red-300 */
}

.btn-danger-soft:hover {
    background-color: #fecaca;
    /* Red-200 */
    color: #dc2626;
    /* Red-600 */
}