/* 
 * Layout System - Portal do Cliente 2.0
 */

/* SPA Container */
#app-root {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-main);
}

/* Sidebar Esquerda */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    z-index: 100;
}

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

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.25rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
}

.nav-item .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.nav-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--primary-color);
}

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

/* Area Principal */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header Superior */
.topbar {
    height: var(--header-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 90;
}

.topbar-search {
    display: flex;
    align-items: center;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.5rem 1rem;
    width: 400px;
    gap: 0.5rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.topbar-search:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 123, 0, 0.1);
}

.topbar-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.topbar-search input::placeholder {
    color: var(--text-tertiary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Container de Conteúdo */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Tela de Login Layout */
.login-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-main);
}

.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.login-right {
    flex: 1;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #1e293b 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 4rem;
    position: relative;
    overflow: hidden;
}

/* Responsividade Básica */
@media (max-width: 1024px) {
    .sidebar { width: var(--sidebar-collapsed-width); }
    .sidebar .label { display: none; }
    .sidebar .logo-text { display: none; }
    .topbar-search { width: 250px; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
    }
    .sidebar.mobile-open {
        left: 0;
    }
    .topbar-search { display: none; } /* Search goes into mobile menu */
    .login-layout { flex-direction: column; }
    .login-right { display: none; }
}
