:root {
    --purple: #8338ec;
    --background: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #e9ecef;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background);
    margin: 0;
    color: var(--text-primary);
}

/* --- HEADER (COM LOGO DE TEXTO E CENTRALIZAÇÃO) --- */
.main-header { background-color: #1d2327; border-bottom: 1px solid #2a343a; padding: 0 40px; }
.header-content { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    min-height: 70px; 
    max-width: 1400px; 
    margin: 0 auto; 
    flex-wrap: wrap; 
}
.header-left, .header-right { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    flex-shrink: 0; 
    flex-basis: auto; 
}
.header-right { justify-content: flex-end; }
.logo { height: 40px; } /* Mantido para o admin.php */

/* Estilo para o novo logo em texto */
.logo-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.7em; /* Aumentado */
    font-weight: 700; /* Negrito */
    color: #ffffff !important; /* Cor branca (com !important para forçar) */
    text-decoration: none !important; /* Remove sublinhado */
    margin-right: 15px;
    white-space: nowrap;
}

.main-nav { 
    display: flex; 
    gap: 8px; 
    align-items: center; 
    justify-content: center; 
    flex-grow: 1; 
    min-width: 0; 
}
.nav-link { text-decoration: none; color: #bdc3c7; font-weight: 500; padding: 8px 12px; border-radius: 8px; transition: all 0.2s ease-in-out; white-space: nowrap; }
.nav-link:hover { background-color: rgba(255, 255, 255, 0.1); color: #ffffff; }
.nav-link.active { background-color: var(--purple); color: #fff; }
.btn-operator, .btn-logout { text-decoration: none; color: #fff; padding: 10px 18px; border-radius: 8px; font-weight: 500; transition: background-color 0.2s ease-in-out; white-space: nowrap; }
.btn-operator { background-color: var(--purple); }
.btn-operator:hover { background-color: #6d20d3; }
.btn-logout { background-color: rgba(255, 255, 255, 0.15); font-size: 0.9em; }
.btn-logout:hover { background-color: rgba(255, 255, 255, 0.25); }

/* --- ESTILOS DO MENU DROPDOWN --- */
.dropdown { position: relative; display: inline-block; }
.dropdown .nav-link { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.dropdown .nav-link i.fa-caret-down { font-size: 0.8em; transition: transform 0.2s ease; }
.dropdown:hover .nav-link i.fa-caret-down { transform: rotate(180deg); }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background-color: #1d2327; border: 1px solid #2a343a; border-top: none; min-width: 200px; box-shadow: 0 8px 16px rgba(0,0,0,0.3); z-index: 1001; border-radius: 0 0 8px 8px; padding: 5px 0; }
.dropdown-menu a { color: #bdc3c7; padding: 10px 16px; text-decoration: none; display: block; white-space: nowrap; font-size: 0.9em; transition: all 0.2s ease; }
.dropdown-menu a:hover { background-color: #2c3e50; color: #ffffff; }
.dropdown:hover .dropdown-menu { display: block; }

/* --- LAYOUT PRINCIPAL E CARDS --- */
.container { display: flex; gap: 30px; padding: 30px 40px; max-width: 1400px; margin: 0 auto; }
.main-content { flex: 2; display: flex; flex-direction: column; gap: 30px; }
.sidebar { flex: 1; display: flex; flex-direction: column; gap: 30px; }
.card, .card-large { background-color: var(--card-bg); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.card h3, .card-large h2, .posts-section h2 { margin-top: 0; font-weight: 600; }
.empty-message { color: var(--text-secondary); font-size: 0.9em; }

/* --- WIDGETS DA HOME --- */
.list-item { display: flex; align-items: center; gap: 15px; background-color: #f8f9fa; padding: 12px; border-radius: 10px; margin-bottom: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.list-item div { display: flex; flex-direction: column; }
.list-item strong { font-weight: 500; font-size: 0.95em; }
.list-item span { font-size: 0.85em; color: var(--text-secondary); }
.widget-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.widget-header h3 { margin: 0; }
.btn-new-event { background-color: var(--purple); color: white; padding: 5px 12px; border-radius: 6px; text-decoration: none; font-size: 0.85em; font-weight: 500; transition: background-color 0.2s ease; }
.btn-new-event:hover { background-color: #6d20d3; }

/* --- WIDGET 2-COLUMN GRID (Aniversariantes) --- */
.widget-grid-2col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.widget-grid-2col .list-item { flex-direction: column; align-items: center; text-align: center; padding: 15px 10px; margin-bottom: 0; }
.widget-grid-2col .list-item .avatar { margin-bottom: 8px; }
.widget-grid-2col .list-item strong { font-size: 0.9em; }
.widget-grid-2col .list-item span { font-size: 0.8em; }

/* --- SEÇÃO DE POSTS (HOME E NOTICIAS) --- */
.posts-section { background-color: var(--card-bg); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.posts-grid { display: flex; flex-direction: column; gap: 20px; }
.post-card { display: flex; gap: 20px; background-color: #f8f9fa; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; position: relative; padding: 15px; }
.post-card-image { width: 220px; height: 140px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.post-card-content { padding: 0; display: flex; flex-direction: column; flex-grow: 1; }
.post-card-content h3 { margin-top: 0; font-size: 1.1em; }
.post-card-content h3 a { text-decoration: none; color: var(--text-primary); }
.post-card-content p { font-size: 0.9em; color: var(--text-secondary); flex-grow: 1; margin-bottom: 10px; }
.read-more { text-decoration: none; color: var(--purple); font-weight: 500; font-size: 0.9em; margin-top: auto; }
.post-card-actions { position: absolute; top: 10px; right: 10px; z-index: 2; display: flex; gap: 5px; }
.btn-action { text-decoration: none; padding: 4px 10px; border-radius: 6px; font-size: 0.85em; border: none; cursor: pointer; }
.btn-action.edit { background-color: #e9ecef; color: var(--text-primary); }
.btn-action.delete { background-color: #f8d7da; color: #721c24; }
.btn-action.small { padding: 3px 8px; font-size: 0.75em; }
.btn-action.pin { background-color: #e6f7ff; color: #0056b3; }
.btn-action.pin:hover { background-color: #cce7ff; }
.post-card.pinned { background-color: #fffbef; border: 1px solid #ffeeba; }
.pin-icon { position: absolute; top: -10px; left: -10px; background-color: var(--purple); color: white; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.9em; box-shadow: 0 2px 5px rgba(0,0,0,0.2); transform: rotate(-15deg); }

/* --- PÁGINA DE POST COMPLETO --- */
.full-post-container { width: 100%; max-width: 800px; margin: 0 auto; background-color: var(--card-bg); padding: 30px 40px; border-radius: 16px; box-shadow: var(--shadow); }
.full-post-image { width: 100%; height: auto; max-height: 400px; object-fit: cover; border-radius: 12px; margin-bottom: 25px; }
.full-post-content { line-height: 1.7; font-size: 1.05em; }
.full-post-content img { max-width: 100%; height: auto; border-radius: 8px; }
.post-meta { font-size: 0.85em; color: var(--text-secondary); border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-bottom: 15px; }

/* --- DIRETÓRIO DE COLABORADORES --- */
.directory-container { width: 100%; }
.directory-header { margin-bottom: 30px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.directory-header h1 { margin: 0; }
.filter-controls { display: flex; gap: 20px; flex-wrap: wrap; }
.search-bar input, .department-filter select { padding: 12px 15px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 1em; font-family: 'Poppins', sans-serif; height: 48px; box-sizing: border-box; }
.search-bar input { width: 300px; }
.department-filter select { width: 250px; cursor: pointer; }
.directory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 25px; }
.user-card { background-color: var(--card-bg); border-radius: 16px; padding: 25px; box-shadow: var(--shadow); text-align: center; transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: default; }
.user-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
.user-avatar { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin-bottom: 15px; border: 3px solid var(--border-color); }
.user-name { margin: 0 0 5px 0; font-size: 1.2em; font-weight: 600; color: var(--text-primary); }
.user-role { margin: 0 0 15px 0; font-size: 0.95em; color: var(--text-secondary); }

/* --- PÁGINA DE CONTEÚDO (Instituição, Área do Colaborador) --- */
.content-page-container { width: 100%; max-width: 900px; margin: 0 auto; background-color: var(--card-bg); border-radius: 16px; padding: 30px 40px; box-shadow: var(--shadow); }
.content-page-container h1 { margin-top: 0; font-size: 2em; font-weight: 600; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; margin-bottom: 20px; }
.text-content p { font-size: 1.05em; line-height: 1.8; color: var(--text-secondary); margin-bottom: 1.5em; }
.handbook-container { width: 100%; max-width: 900px; margin: 0 auto; }
.handbook-header { text-align: center; margin-bottom: 30px; }
.handbook-header h1 { font-size: 2.5em; font-weight: 600; margin-bottom: 10px; }
.handbook-header p { font-size: 1.1em; color: var(--text-secondary); }
.handbook-nav { display: flex; justify-content: center; gap: 10px; flex-wrap: nowrap; margin-bottom: 40px; overflow-x: auto; }
.handbook-nav a { text-decoration: none; background-color: var(--card-bg); color: var(--purple); padding: 8px 15px; border-radius: 50px; font-weight: 500; box-shadow: 0 2px 8px rgba(0,0,0,0.07); transition: all 0.2s ease; display: flex; align-items: center; gap: 6px; font-size: 0.9em; white-space: nowrap; }
.handbook-nav a:hover { background-color: var(--purple); color: white; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.handbook-section { margin-bottom: 30px; }
.handbook-section h2 { display: flex; align-items: center; gap: 12px; font-size: 1.8em; color: var(--text-primary); border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 20px; }
.handbook-section h2 i { color: var(--purple); }
.handbook-section p, .handbook-section ul { font-size: 1.05em; line-height: 1.8; color: var(--text-secondary); }
.handbook-section ul { padding-left: 30px; }

/* --- PÁGINA DE DEPARTAMENTOS --- */
.container-departamentos { max-width: 1200px; width: 100%; margin: auto; text-align: center; }
.container-departamentos h1 { color: #2c3e50; margin-bottom: 1rem; font-size: 2.5rem; }
.container-departamentos .subtitle { color: #7f8c8d; font-size: 1.1rem; margin-bottom: 3rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.search-wrapper { margin-bottom: 3rem; }
#searchInput { width: 100%; max-width: 500px; padding: 15px 25px; border: 2px solid #F0F0F0; border-radius: 50px; font-size: 1rem; transition: all 0.3s ease; box-sizing: border-box; background-color: #F8F8F8; color: #4a4a4a; }
#searchInput::placeholder { color: #4a4a4a; opacity: 0.8; }
#searchInput:focus { outline: none; border-color: #DEDEDE; box-shadow: 0 0 10px rgba(52, 152, 219, 0.2); }
.departamentos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2rem; text-align: left; }
.departamento-card { background-color: #F8F8F8; border-radius: 15px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07); overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform 0.3s ease, box-shadow 0.3s ease; cursor: default; }
.departamento-card:hover { transform: translateY(-10px); box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12); }
.card-icon { background-color: #3498db; padding: 2rem; text-align: center; }
.card-icon i { font-size: 3.5rem; color: #ffffff; }
.card-content { padding: 1.5rem; flex-grow: 1; }
.card-content h3 { margin: 0 0 0.5rem 0; color: #2c3e50; font-size: 1.4rem; }
.card-content p { font-size: 0.95rem; line-height: 1.5; color: #7f8c8d; margin: 0; }
#noResultsMessage { display: none; font-size: 1.2rem; color: #7f8c8d; text-align: center; grid-column: 1 / -1; padding: 2rem; }

/* --- PÁGINA DE FERRAMENTAS --- */
.tools-page-container { width: 100%; }
.tools-header { margin-bottom: 40px; }
.tools-header h1 { font-size: 2.5em; margin: 0 0 10px 0; font-weight: 600; }
.tools-header p { font-size: 1.1em; color: var(--text-secondary); margin: 0; }
.tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; margin-bottom: 40px; }
.tool-card { background-color: var(--card-bg); border-radius: 16px; padding: 25px; box-shadow: var(--shadow); text-align: center; text-decoration: none; color: var(--text-primary); display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.tool-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
.tool-icon { width: 70px; height: 70px; border-radius: 50%; margin: 0 auto 20px auto; display: flex; align-items: center; justify-content: center; }
.tool-icon i { font-size: 2.2em; color: white; }
.tool-card h3 { margin: 0 0 10px 0; font-size: 1.3em; }
.tool-card p { margin: 0 0 25px 0; color: var(--text-secondary); line-height: 1.5; }
.btn-access { color: white; padding: 12px 20px; border-radius: 8px; font-weight: 500; text-decoration: none; }
/* Define a cor azul como padrão para TODOS os cartões de ferramentas */
.tool-card .tool-icon, 
.tool-card .btn-access {
    background-color: #3498db; /* Cor azul */
}

/* --- PÁGINA DE CHAMADOS --- */
.chamados-page-container { width: 100%; max-width: 800px; margin: 40px auto; background-color: var(--card-bg); border-radius: 16px; padding: 40px; box-shadow: var(--shadow); text-align: center; }
.chamados-page-container h1 { margin-top: 0; font-size: 2.5em; font-weight: 600; }
.chamados-subtitle { font-size: 1.1em; color: var(--text-secondary); margin-bottom: 40px; }
.btn-chamado { display: inline-block; background-color: var(--purple); color: white; text-decoration: none; font-size: 1.2em; font-weight: 600; padding: 20px 40px; border-radius: 12px; transition: all 0.3s ease; }
.btn-chamado i { margin-right: 10px; }
.btn-chamado:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(131, 56, 236, 0.3); }
.chamados-future { margin-top: 40px; color: var(--text-secondary); font-style: italic; }

/* --- FORMULÁRIOS GERAIS --- */
.form-container .form-group { margin-bottom: 20px; }
.form-container label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-primary); }
.form-container input, .form-container select, .form-container textarea { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
.form-container textarea { resize: vertical; }
.btn-publish { background-color: var(--purple); color: white; padding: 12px 20px; border: none; border-radius: 8px; cursor: pointer; font-size: 1em; font-weight: 500; width: 100%; transition: background-color 0.2s ease-in-out; }
.btn-publish:hover { background-color: #6d20d3; }
.success-message { color: #155724; background-color: #d4edda; border: 1px solid #c3e6cb; padding: 10px; border-radius: 8px; margin-bottom: 20px; }
.error-message { color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb; padding: 10px; border-radius: 8px; margin-bottom: 20px; }

/* --- ESTILOS PARA IFRAMES --- */
.iframe-container { width: 100%; overflow: hidden; display: block; box-sizing: border-box; }
.iframe-container iframe { width: 100%; border: none; display: block; box-sizing: border-box; }
.aulas-iframe-container iframe { /* A altura é definida via JavaScript */ }
.event-iframe-container iframe {
    height: 550px; /* Altura do calendário ClickUp */
    background-color: #f9f9ff;
}

/* --- ESTILOS DO WIDGET DE EVENTOS (MANUAL) --- */
.event-list-visual { display: flex; flex-direction: column; gap: 15px; }
.event-item-visual { display: flex; align-items: center; gap: 15px; background-color: #f8f9fa; padding: 12px; border-radius: 10px; }
.event-visual-date { flex-shrink: 0; width: 45px; height: 45px; border-radius: 8px; background-color: var(--purple); color: white; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 600; }
.event-visual-date .dia { font-size: 1.2em; line-height: 1; }
.event-visual-date .mes { font-size: 0.8em; text-transform: uppercase; line-height: 1; }
.event-details { flex-grow: 1; display: flex; flex-direction: column; text-align: left; }
.event-details strong { font-weight: 500; }
.event-details span { font-size: 0.85em; color: var(--text-secondary); }
.event-actions { display: flex; gap: 5px; flex-shrink: 0; }
.event-list-item { display: flex; justify-content: space-between; align-items: center; background-color: #f8f9fa; padding: 12px; border-radius: 10px; }

/* --- ESTILOS DO CHAT DE IA (REMOVIDOS) --- */

/* --- RESPONSIVIDADE --- */
@media (max-width: 1200px) { .tools-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 992px) { 
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
    .main-nav { justify-content: flex-start; } 
    .header-left { flex-grow: 1; } 
}
@media (max-width: 768px) {
    .container { flex-direction: column; padding: 20px; }
    .main-header { padding: 0 20px; }
    .post-card { flex-direction: column; }
    .post-card-image { width: 100%; height: 180px; }
    .quick-links-container { flex-direction: column; gap: 25px; }
    .main-nav { display: none; } /* Esconde o menu principal em celulares */
    .filter-controls { flex-direction: column; width: 100%; }
    .search-bar input, .department-filter select { width: 100%; }
    .directory-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 576px) { .tools-grid { grid-template-columns: 1fr; } }