* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f6;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    z-index: 1001;
}

.logo { font-weight: bold; font-size: 1.2rem; }

.chat-toggle-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* Dropdown Navbar */
.dropdown { position: relative; display: inline-block; }
.dropbtn { background-color: #27ae60; color: white; padding: 10px 15px; border: none; cursor: pointer; border-radius: 4px; font-weight: bold; }
.dropdown-content { display: none; position: absolute; background-color: #ffffff; min-width: 200px; box-shadow: 0px 8px 16px rgba(0,0,0,0.2); z-index: 10; border-radius: 4px; }
.dropdown-content a { color: #333; padding: 12px 16px; text-decoration: none; display: block; }
.dropdown-content a:hover { background-color: #f1f1f1; color: #27ae60; }
.dropdown:hover .dropdown-content { display: block; }

/* Layout Principal */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* Painéis */
.editor-section {
    width: 50%; 
    min-width: 600px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: #f4f7f6;
}

.report-section {
    flex: 1; 
    min-width: 600px;
    background-color: white;
    padding: 20px;
    overflow-y: auto;
    border-left: 1px solid #ddd;
}

/* Barra Divisora (Resizer) */
.resizer {
    width: 8px;
    cursor: col-resize;
    background-color: #ddd;
    transition: background-color 0.2s;
    z-index: 5;
}

.resizer:hover {
    background-color: #27ae60;
}

/* Elementos internos */
.filter-container { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; background: #fff; padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #ddd; }
.field { display: flex; flex-direction: column; }
.field label { font-size: 0.85rem; font-weight: bold; margin-bottom: 5px; color: #555; }
select, textarea { padding: 10px; border-radius: 5px; border: 1px solid #ccc; font-size: 0.9rem; outline: none; }
textarea { flex: 1; min-height: 200px; resize: none; }

.file-input-custom {
    padding: 8px;
    border: 1px dashed #ccc;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}

/* Header do Relatório (Título + Botões) */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #27ae60;
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.report-header h2 { margin: 0; border: none; padding: 0; }
.save-actions { display: flex; gap: 10px; align-items: center; }
.btn-save { background-color: #2980b9; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; transition: background-color 0.2s; }
.btn-save:hover { background-color: #3498db; }
.btn-save:disabled { background-color: #bdc3c7; cursor: not-allowed; }

/* Chat Sidebar */
.chat-sidebar {
    position: absolute;
    right: -400px;
    top: 0;
    width: 380px;
    height: 100%;
    background: white;
    box-shadow: -2px 0 15px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
    z-index: 1000;
}
.chat-sidebar.active { right: 0; }
.chat-header { background: #2c3e50; color: white; padding: 15px; display: flex; justify-content: space-between; align-items: center; }
.chat-header button { background: none; border: none; color: white; cursor: pointer; font-size: 1.2rem; }
.chat-messages { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: #fdfdfd; }
.message { padding: 10px 12px; border-radius: 8px; font-size: 0.9rem; max-width: 85%; line-height: 1.4; }
.message.ai { background: #ecf0f1; align-self: flex-start; color: #2c3e50; }
.message.user { background: #27ae60; align-self: flex-end; color: white; }
.chat-input-area { padding: 15px; border-top: 1px solid #ddd; display: flex; gap: 10px; }
#chatInput { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 4px; }
#sendChatMsg { background: #27ae60; color: white; border: none; padding: 0 15px; border-radius: 4px; cursor: pointer; font-weight: bold; }

/* Estilos da Busca no Drive */
.drive-search-wrapper {
    position: relative;
    display: inline-block;
}
#searchDriveInput {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    width: 250px;
    outline: none;
}
#searchDriveInput:focus {
    border-color: #27ae60;
}
.drive-dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 100%;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    z-index: 1002;
    max-height: 250px;
    overflow-y: auto;
    border-radius: 4px;
    top: 100%;
    left: 0;
    margin-top: 5px;
    border: 1px solid #ddd;
}
.drive-dropdown-content.show {
    display: block;
}
.drive-dropdown-item {
    color: #333;
    padding: 10px 12px;
    text-decoration: none;
    display: block;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid #eee;
}
.drive-dropdown-item:last-child {
    border-bottom: none;
}
.drive-dropdown-item:hover {
    background-color: #f4f7f6;
    color: #27ae60;
    font-weight: bold;
}

/* NOVO: Estilos de Salvar Arquivo */
.file-name-input {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
    width: 180px;
}
.file-name-input:focus {
    border-color: #27ae60;
}
.btn-confirm {
    background-color: #27ae60;
}
.btn-confirm:hover {
    background-color: #219653;
}
.btn-cancel {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}
.btn-cancel:hover {
    background-color: #c0392b;
}
.btn-cancel:disabled { 
    background-color: #bdc3c7; 
    cursor: not-allowed; 
}