/* RESET E VARIÁVEIS */
:root {
    --gelb-yellow: #fbc02d;
    --gelb-dark: #0d1117;
    --header-height: 80px;
    --chat-width: 380px;
}

* { box-sizing: border-box; }

body, html { 
    height: 100%; 
    margin: 0; 
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
    background-color: #f4f7f6;
    overflow: hidden; 
}

/* LOGIN PAGE */
.login-page {
    background-color: var(--gelb-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo-img { width: 180px; margin-bottom: 15px; }
.login-title { color: #333; font-weight: 700; margin-bottom: 25px; }
.custom-input { height: 45px; border-radius: 8px; margin-bottom: 10px; }
.btn-primary-gelb { 
    background-color: var(--gelb-yellow); 
    border: none; font-weight: 700; height: 45px; border-radius: 8px;
}
.btn-primary-gelb:hover { background-color: #f9a825; }

/* HEADER HORIZONTAL */
.main-header {
    height: var(--header-height);
    background-color: var(--gelb-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.header-left { width: 180px; display: flex; align-items: center; }
.logo-img { height: 45px; width: auto; filter: brightness(1.2); }

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding: 0 15px;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 12px;
}

.nav-item-link {
    display: block;
    padding: 8px 14px;
    background-color: var(--gelb-yellow);
    color: #000 !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: 0.2s;
}

.nav-item-link:hover, .nav-item-link.active {
    background-color: #fff;
    transform: translateY(-2px);
}

.header-right {
    width: 180px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
}

.user-name { color: #ccc; font-size: 0.85rem; white-space: nowrap; }
.btn-logout { color: #ff5252; font-size: 1.4rem; text-decoration: none; line-height: 1; }

/* CONTEÚDO */
#main-content {
    position: absolute;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
}

#content-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- GELB AI CHAT WIDGET --- */
.gelb-ai-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--gelb-yellow);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2000;
    transition: transform 0.3s;
}

.gelb-ai-toggle:hover { transform: scale(1.1); }
.gelb-ai-toggle i { font-size: 1.8rem; color: #000; }

.gelb-ai-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: var(--chat-width);
    height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid #eee;
}

.gelb-ai-container.open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.ai-header {
    background: var(--gelb-dark);
    color: #fff;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-header h5 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.ai-close { cursor: pointer; font-size: 1.2rem; }

.ai-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.user {
    align-self: flex-end;
    background: var(--gelb-yellow);
    color: #000;
    border-bottom-right-radius: 2px;
}

.message.ai {
    align-self: flex-start;
    background: #e9ecef;
    color: #333;
    border-bottom-left-radius: 2px;
    border: 1px solid #dee2e6;
}

.message.loading {
    align-self: flex-start;
    background: transparent;
    color: #888;
    font-style: italic;
    padding: 0;
}

.ai-input-area {
    padding: 10px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
}

.ai-input-area input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    outline: none;
}

.ai-input-area button {
    background: var(--gelb-dark);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}