@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* --- :ROOT VARIABLES (Paleta CNSC) --- */
:root {
    --primary-font: 'Poppins', sans-serif;
    --primary-blue: #0054A6;
    --secondary-blue: #00AEEF;
    --background-color: #f4f7fa; /* Fundo geral cinza claro */
    --card-background: #ffffff;   /* Fundo de todos os 'cartões' */
    --text-color: #343a40;       /* Cor de texto principal (escuro) */
    --text-color-light: #6c757d; /* Cor de texto secundária (cinza) */
    --border-color: #dee2e6;     /* Cor de borda padrão */
    --white: #ffffff;
    --border-radius: 8px;

    /* Status Colors */
    --status-pending: #fd7e14;
    --status-review: #ffc107;
    --status-approved: #28a745;
    --status-rejected: #dc3545;
}

/* --- RESET & GLOBAL STYLES --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--primary-font); background-color: var(--background-color); color: var(--text-color); line-height: 1.6; font-size: 16px; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: #212529; font-weight: 600; }
a { color: var(--primary-blue); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--secondary-blue); text-decoration: none; }

/* --- LAYOUT & CONTAINERS --- */
.container {
    transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out;
}
.card-form, .info-card, .chat-card, .table-container, .chart-container, .kb-article-view, .catalog-detail-header { 
    background-color: var(--card-background); 
    border-radius: var(--border-radius); 
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.card-form { padding: 25px; }

/* --- COMMON COMPONENTS --- */
.btn, .btn-primary, .btn-secondary, .btn-danger, .btn-approve, .btn-reject { padding: 10px 20px; border: 1px solid transparent; border-radius: 5px; font-weight: 500; font-size: 0.9rem; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; transition: all 0.2s ease; }
.btn-primary { background-color: var(--primary-blue); color: var(--white); }
.btn-primary:hover { background-color: #004182; }
.btn-secondary { background-color: #6c757d; color: var(--white); }
.btn-secondary:hover { background-color: #5a6268; }
.btn-danger { background-color: var(--status-rejected); color: var(--white); }
.btn-danger:hover { background-color: #c82333; }
.btn-small { padding: 5px 12px; font-size: 0.8rem; }
.btn-remove-item { background: var(--status-rejected); color: white; border: none; border-radius: 50%; width: 25px; height: 25px; cursor: pointer; font-weight: bold; margin-left: 10px; }

.form-group { margin-bottom: 20px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.9rem; color: var(--text-color); }
.form-group-inline { display: flex; gap: 20px; align-items: center; }
.form-group-inline .form-group { flex-grow: 1; margin-bottom: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"], select, textarea { 
    width: 100%; padding: 12px; background-color: #fdfdff; border: 1px solid var(--border-color); border-radius: 5px; color: var(--text-color); font-family: var(--primary-font); font-size: 1rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary-blue); box-shadow: 0 0 0 3px rgba(0, 84, 166, 0.1); outline: none; }
textarea { resize: vertical; }

.table-container { box-shadow: none; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border-color); vertical-align: middle; white-space: nowrap; }
thead th { background-color: #f8f9fa; color: var(--text-color); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background-color 0.2s ease; }
tbody tr:hover { background-color: #f1f3f5; }

.status-badge { padding: 5px 12px; border-radius: 15px; font-size: 0.75rem; font-weight: 600; color: var(--white); text-transform: capitalize; }
.priority-urgent { font-weight: bold; color: var(--status-rejected) !important; }

/* --- HEADER & NAVIGATION --- */
.main-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding: 15px 25px; }
.header-logo-title { display: flex; align-items: center; gap: 15px; }
.header-logo { display: block; height: 40px; width: auto; }
.header-buttons { display: flex; align-items: center; gap: 10px; }
.nav-link { font-weight: 500; font-size: 0.9rem; color: var(--text-color); padding: 8px 12px; border-radius: 5px; transition: background-color 0.2s ease, color 0.2s ease; }
.nav-link:hover { background-color: #e9ecef; color: var(--primary-blue); }

.nav-dropdown { position: relative; }
.dropdown-toggle { font-weight: 500; font-size: 0.9rem; color: var(--text-color); background: none; border: none; cursor: pointer; padding: 8px 12px; border-radius: 5px; transition: background-color 0.2s ease; }
.dropdown-toggle:hover { background-color: #e9ecef; }
.dropdown-menu { display: none; position: absolute; top: 110%; right: 0; background-color: var(--card-background); min-width: 220px; border-radius: var(--border-radius); box-shadow: 0 8px 16px rgba(0,0,0,0.1); z-index: 1001; border: 1px solid var(--border-color); }
.dropdown-item { color: var(--text-color); padding: 12px 18px; display: block; font-size: 0.9rem; }
.dropdown-item:hover { background-color: var(--primary-blue); color: var(--white); }

/* --- PAGE-SPECIFIC & MODULE STYLES --- */

/* --- Login Page --- */
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.login-card { background-color: var(--card-background); padding: 40px; border-radius: var(--border-radius); text-align: center; max-width: 400px; box-shadow: 0 8px 30px rgba(0,0,0,0.1); }
.google-btn { background-color: #4285F4; color: white; display: flex; align-items: center; justify-content: center; gap: 15px; }
.google-btn:hover { background-color: #357ae8; }

/* --- Dashboard & Tabs --- */
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { padding: 25px; }
.stat-card h3 { color: var(--text-color-light); font-size: 1rem; font-weight: 500; margin-bottom: 8px; }
.stat-card .stat-number { font-size: 2.2rem; font-weight: 700; color: var(--primary-blue); }
.stat-card.urgent .stat-number { color: var(--status-rejected); }
.stat-card.approved .stat-number { color: var(--status-approved); }
.stat-card.today .stat-number { color: var(--secondary-blue); }
.tab-container { margin-top: 30px; }
.tab-buttons { display: flex; border-bottom: 2px solid var(--border-color); margin-bottom: 0; }
.tab-button { background-color: transparent; border: none; border-bottom: 3px solid transparent; padding: 12px 20px; cursor: pointer; color: var(--text-color-light); font-weight: 500; font-size: 1rem; margin-bottom: -2px; }
.tab-button.active { color: var(--primary-blue); border-bottom-color: var(--primary-blue); }
.tab-content { display: none; background-color: var(--card-background); border: 1px solid var(--border-color); border-top: none; border-radius: 0 0 var(--border-radius) var(--border-radius); }
.tab-content.active { display: block; animation: fadeIn 0.5s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Modal (Nova Solicitação) --- */
.modal-overlay { background-color: rgba(0,0,0,0.5); }
.modal-container { background-color: var(--card-background); }
.modal-header { border-bottom: 1px solid var(--border-color); }
.modal-close { color: var(--text-color-light); }
.request-type-btn { background-color: #f8f9fa; color: var(--text-color); border: 1px solid var(--border-color); }
.request-type-btn:hover { border-color: var(--primary-blue); background-color: #e7f3ff; }

/* --- Modal (Nova Solicitação & Rejeição) --- */
.modal-overlay {
    display: none; /* Comea escondido */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    
    /* As duas linhas mais importantes para o efeito: */
    opacity: 0; /* Comea transparente */
    transition: opacity 0.3s ease; /* Animao suave de 0.3 segundos */
}
/* A classe 'active' que o JavaScript adiciona torna o modal visível */
.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 700px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    /*max-height: 200vh;*/
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h2 { font-size: 1.2rem; margin: 0; }

.modal-close {
    font-size: 2em;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    color: var(--text-color-light);
    background: none;
    border: none;
}
.modal-close:hover { color: var(--text-color); }
.modal-body { padding: 25px; overflow-y: auto; }
/* ... (resto dos estilos do modal) ... */

/* Animação de entrada */
.modal-overlay.active {
    display: flex;
    opacity: 1;
}
.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.modal-close {
    font-size: 2em;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    color: var(--text-color-light);
    background: none;
    border: none;
}
.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 25px;
    overflow-y: auto; /* Adiciona scroll se o conteúdo for muito grande */
}

.modal-step { display: none; }
.modal-step.active { display: block; animation: fadeIn 0.5s; }

.request-type-selection { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.request-type-btn {
    background-color: #f8f9fa;
    padding: 20px;
    border: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-color);
    cursor: pointer;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.request-type-btn:hover {
    border-color: var(--primary-blue);
    background-color: #e7f3ff;
    color: var(--primary-blue);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

.input-file { display: none; }
.btn-attach { background-color: #e9ecef; border: 1px solid var(--border-color); color: var(--text-color); }
.btn-attach:hover { background-color: #dee2e6; }
 
.message-bubble { padding: 10px 15px; border-radius: 15px; }
.admin-message { margin-left: auto; justify-content: flex-end; }
.admin-message .message-bubble { background-color: var(--primary-blue); color: var(--white); border-radius: 15px 15px 0 15px; }
.user-message { margin-right: auto; }
.user-message .message-bubble { background-color: #e9ecef; border-radius: 15px 15px 15px 0; }
.message-author { font-weight: 600; font-size: 0.9em; margin-bottom: 5px; }
.message-timestamp { font-size: 0.75em; color: var(--text-color-light); display: block; text-align: right; margin-top: 5px; }
.no-messages { color: var(--text-color-light); }
.chat-reply-box textarea { min-height: 80px; }
.reply-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

/* --- Kanban Board --- */
.kanban-container {
    max-width: 100%; /* Ocupa a largura total para ter mais espaço */
    padding: 0 20px;
}

.kanban-board {
    display: flex;
    gap: 20px;
    overflow-x: auto; /* Permite scroll horizontal */
    padding: 10px 0 20px 0;
    min-height: 75vh;
}

.kanban-column {
    min-width: 320px;
    max-width: 320px;
    background-color: #f1f3f5; /* Fundo cinza claro para as colunas */
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    padding: 15px;
    font-weight: 600;
    color: var(--text-color);
    border-top: 4px solid; /* A cor virá do PHP */
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    background-color: var(--card-background);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-task-count {
    background-color: #e9ecef;
    color: var(--text-color-light);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.kanban-cards {
    padding: 10px;
    flex-grow: 1;
    overflow-y: auto;
}

.kanban-card {
    background-color: var(--card-background);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: grab;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}
.kanban-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.kanban-card:active {
    cursor: grabbing;
}

.kanban-card-header a {
    font-weight: 600;
    color: var(--text-color);
}

.kanban-card-body {
    padding: 10px 0;
    font-size: 0.9rem;
    color: var(--text-color-light);
}

.kanban-card-body p {
    margin-bottom: 5px;
}

.kanban-card-deadline {
    font-weight: 600;
}

.kanban-card-footer {
    padding-top: 10px;
    border-top: 1px solid #f1f3f5;
}

.priority-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    color: var(--text-color-light);
}

.priority-tag.urgent {
    background-color: #fff0f1;
    color: var(--status-rejected);
}

/* Alertas Visuais */
.kanban-card.urgent {
    border-left: 4px solid var(--status-rejected);
}
.kanban-card.deadline-alert .kanban-card-deadline {
    color: var(--status-pending);
}

/* --- Catálogo de Produções --- */
.catalog-grid {
    display: grid;
    /* Cria colunas responsivas: elas terão no mínimo 280px e no máximo 1fr (fração do espaço) */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.catalog-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.catalog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.catalog-card-thumbnail {
    height: 160px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
    color: var(--white);
}

.catalog-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    z-index: 0;
}

.catalog-card-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 500;
    z-index: 1;
}

.catalog-card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.catalog-card-body h3 {
    margin: 0 0 10px 0;
    color: var(--primary-blue);
    font-size: 1.1em;
    line-height: 1.3;
}

.catalog-card-body p {
    margin: 0;
    font-size: 0.9em;
    color: var(--text-color-light);
    flex-grow: 1;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limita a descrição a 2 linhas */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-card-tags {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-item {
    background-color: #e9ecef;
    color: var(--text-color-light);
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 0.75em;
    text-transform: lowercase;
}
/* --- ESTILOS DA PÁGINA DE DETALHES DO CATÁLOGO --- */
.catalog-detail-header {
    display: flex;
    gap: 25px;
    align-items: center;
    padding: 25px;
    background-color: var(--light-blue);
    border-radius: 8px;
    margin-bottom: 30px;
}
.catalog-detail-thumb {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.catalog-detail-info h1 {
    margin: 0 0 10px 0;
    /*color: var(--white);*/
}
.catalog-detail-info p {
    margin: 0 0 15px 0;
    color: var(--text-color-light);
}
.tags-container { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background-color: var(--medium-blue); padding: 4px 10px; border-radius: 15px; font-size: 0.8em; }

.server-path-link {
    color: var(--bright-blue);
    text-decoration: none;
    font-family: monospace;
    font-size: 0.9em;
}
.server-path-link:hover { text-decoration: underline; }

/* --- LAYOUT DE COLUNAS - PÁGINA DE DETALHES DO CATÁLOGO --- */
.catalog-layout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Coluna da esquerda 2x maior que a da direita */
    gap: 30px; /* Espaço entre as colunas */
    align-items: flex-start; /* Alinha o topo das colunas */
}

.catalog-main-column {
    display: flex;
    flex-direction: column;
    gap: 30px; /* Espaço entre o box do título e a tabela de produções */
}

/* Garante que o layout se torne uma única coluna em telas menores */
@media (max-width: 992px) {
    .catalog-layout-grid {
        grid-template-columns: 1fr; /* Uma única coluna */
    }
}
/* Separadores e subtítulos no Info Card */
hr.detail-separator { border: 0; border-top: 1px solid var(--medium-blue); margin: 15px 0; }
h4.detail-subtitle { margin-top: 15px; margin-bottom: 10px; color: var(--text-color-light); }
.description-content.sub-section { padding: 10px; background-color: rgba(0,0,0,0.2); border-radius: 4px; }
/* --- Log de Auditoria & Paginação --- */
.log-action { background-color: #e9ecef; color: var(--text-color); }
.pagination a { background-color: var(--card-background); border: 1px solid var(--border-color); }
.pagination a:hover { background-color: #e9ecef; }
.pagination a.active { background-color: var(--primary-blue); color: var(--white); border-color: var(--primary-blue); }

/* --- Notificações (In-App) --- */
.header-notifications { position: relative; }
.notification-bell {
    font-size: 1.2rem;
    cursor: pointer;
    position: relative;
    color: var(--text-color);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}
.notification-bell:hover {
    background-color: #e9ecef;
}
.bell-icon {
    line-height: 1;
}
.notification-count {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--status-rejected);
    color: white;
    border-radius: 50%;
    padding: 1px 5px;
    font-size: 0.7em;
    font-weight: bold;
    border: 2px solid var(--card-background);
}
.notification-panel {
    display: none;
    position: absolute;
    top: 120%;
    right: 0;
    width: 380px;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1001;
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.notification-header {
    padding: 12px 15px;
    font-weight: 600;
    background-color: #f8f9fa;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}
#notificationList { max-height: 400px; overflow-y: auto; }
.notification-item { padding: 12px 15px; border-bottom: 1px solid var(--border-color); display: block; text-decoration: none; }
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background-color: #e9ecef; }
.notification-item.unread { background-color: #e7f3ff; }
.notification-item strong { color: var(--primary-blue); display: block; margin-bottom: 4px; font-size: 0.9rem; }
.notification-item span { font-size: 0.85rem; color: var(--text-color-light); }
.no-notifications { padding: 20px; text-align: center; color: var(--text-color-light); }

/* --- Base de Conhecimento (KB) --- */
.kb-category li a { background-color: var(--card-background); border: 1px solid var(--border-color); }
.kb-category li a:hover { background-color: #f8f9fa; border-color: var(--primary-blue); }
/* --- ESTILOS REFINADOS - DETALHES DA SOLICITAÇÃO --- */
.info-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.info-card-header h3 {
    margin: 0;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Duas colunas */
    gap: 20px 30px; /* Espaçamento vertical e horizontal */
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-color-light);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.info-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
}

.info-item-full-width {
    grid-column: 1 / -1; /* Ocupa a largura total */
}


/* --- LAYOUT DE GRELHA PARA PÁGINAS DE DETALHES --- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); /* Responsivo */
    gap: 30px;
    align-items: flex-start;
}

/* --- CABEÇALHO DE AÇÕES (Botão Voltar e Aprovar/Rejeitar) --- */
.detail-actions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.back-link {
    font-weight: 500;
    color: var(--text-color-light);
}
.back-link:hover {
    color: var(--text-color);
}

/* --- TÍTULO DA PÁGINA COM CONTEXTO --- */
.page-title-context {
    color: var(--text-color-light);
    font-weight: 400;
    font-size: 0.8em;
}

/* --- ESTILOS REFINADOS - DETALHES DA SOLICITAÇÃO --- */
.info-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.info-card-header h3 { margin: 0; }
.info-card { padding: 25px; }
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px 30px;
}
.info-item { display: flex; flex-direction: column; }
.info-label { font-size: 0.85rem; color: var(--text-color-light); margin-bottom: 4px; text-transform: uppercase; }
.info-value { font-size: 1rem; font-weight: 500; color: var(--text-color); }
.info-item-full-width { grid-column: 1 / -1; }
.description-content { background-color: #f8ffa1; border: 1px solid var(--border-color); padding: 15px; border-radius: 5px; white-space: pre-wrap; word-wrap: break-word; margin-top: 5px; }

/* Chat Card */
.chat-card { display: flex; flex-direction: column; padding: 25px; }
.chat-history { flex-grow: 1; background-color: #f8f9fa; border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 15px; margin-bottom: 15px; overflow-y: auto; max-height: 500px; min-height: 300px; }
.chat-message { display: flex; margin-bottom: 15px; max-width: 90%; }
.chat-img { width: 150px;}
.message-bubble { padding: 10px 15px; border-radius: 15px; }
.admin-message { margin-left: auto; justify-content: flex-end; }
.admin-message .message-bubble { background-color: var(--primary-blue); color: var(--white); border-radius: 15px 15px 0 15px; }
.user-message { margin-right: auto; }
.user-message .message-bubble { background-color: #e9ecef; border-radius: 15px 15px 15px 0; }
.message-author { font-weight: 600; font-size: 0.9em; margin-bottom: 5px; }
.message-timestamp { font-size: 0.75em; color: var(--text-color-light); display: block; text-align: right; margin-top: 5px; }
.no-messages { color: var(--text-color-light); }
.chat-reply-box textarea { min-height: 80px; }
.reply-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
/* --- ESTILOS PARA O FORMULÁRIO DE FILTROS --- */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}
.filter-form .form-group {
    flex-grow: 1;
    margin-bottom: 0;
}
.filter-form .form-actions {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}
/* --- Relatórios (Charts) --- */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Duas colunas de tamanho igual */
    gap: 30px; /* Espaço entre os gráficos */
}

.chart-container {
    background-color: var(--card-background);
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Para telas menores (como tablets e telemóveis), os gráficos ficam um debaixo do outro */
@media (max-width: 992px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}
/* --- Estilo para o Indicador de Candidato a Bolsa --- */
.bolsa-tag {
    display: inline-block;
    background-color: var(--status-review); /* Amarelo */
    color: var(--white);
    font-weight: bold;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    text-align: center;
    line-height: 22px;
    font-size: 0.8em;
    margin-left: 8px;
    cursor: help;
}
/* --- ESTILOS DA TABELA DE LEADS (CRM) --- */
.lead-main-info {
    display: flex;
    align-items: center;
    gap: 8px; /* Espaço entre o nome e o selo de bolsa */
    font-weight: 500;
    color: var(--text-color);
}

.lead-sub-info {
    color: var(--text-color-light);
    font-size: 0.9em;
}

.lead-contact-info span {
    display: block; /* Coloca o e-mail debaixo do telefone */
    font-size: 0.9em;
}

.lead-contact-info span:first-child {
    font-weight: 500;
    color: var(--text-color);
}

.lead-contact-info span:last-child {
    color: var(--text-color-light);
}
/* --- Tabelas --- */
.table-container {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow-x: auto; /* Permite o scroll horizontal */
    max-height: 710vh; /* Define uma altura máxima para o scroll vertical */
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap; /* Impede a quebra de linha nas células */
}

thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--text-color-light);
    font-size: 0.9em;
    text-transform: uppercase;
    /* --- CONGELAR CABEÇALHO --- */
    position: -webkit-sticky; /* Para Safari */
    position: sticky;
    top: 0;
    z-index: 2;
}

tbody tr:hover {
    background-color: #f1f3f5;
}

/* --- LÓGICA PARA CONGELAR A COLUNA DE AÇÕES --- */
.sticky-col {
    position: -webkit-sticky; /* Para Safari */
    position: sticky;
    right: 0;
    background-color: var(--card-background);
    z-index: 1;
    /* Adiciona uma pequena sombra para indicar sobreposição */
    box-shadow: -2px 0 8px rgba(0,0,0,0.08);
}

/* Garante que o fundo do cabeçalho da coluna congelada seja o correto */
thead th.sticky-col {
    background-color: #f8f9fa;
    z-index: 3;
}

/* Garante que o fundo da célula congelada mude no hover da linha */
tbody tr:hover .sticky-col {
    background-color: #f1f3f5;
}
/* --- Rodapé --- */
.main-footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: var(--text-color-light);
    font-size: 0.85em;
}
.main-footer p {
    margin: 4px 0;
}
/* --- Estilos para a Ferramenta de Upgrade --- */
.release-notes {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}
.release-notes h4 {
    margin-top: 0;
}
.release-notes ul {
    margin-bottom: 0;
    padding-left: 20px;
}
.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
}
.progress-bar {
    width: 0%;
    height: 30px;
    line-height: 30px;
    text-align: center;
    color: var(--white);
    background-color: var(--primary-blue);
    border-radius: var(--border-radius);
    transition: width 0.4s ease;
}
.log-container {
    background-color: #212529;
    color: #f8f9fa;
    padding: 15px;
    border-radius: var(--border-radius);
    height: 300px;
    overflow-y: auto;
    font-family: monospace;
}
.log-container pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}


/* ============================= */
/* RESPONSIVIDADE DO SISTEMA     */
/* ============================= */

/* Telas grandes (desktops acima de 1200px) */
@media (min-width: 1200px) {
    body { font-size: 16px; }
    .container { padding: 0 40px; }
}

/* Laptops e tablets (entre 992px e 1199px) */
@media (max-width: 1199px) {
    .main-header { flex-wrap: wrap; gap: 15px; }
    .header-logo-title { flex: 1; }
    .header-buttons { flex-wrap: wrap; }
    .catalog-detail-header { flex-direction: column; text-align: center; }
}

/* Tablets mdios (768px at 991px) */
@media (max-width: 991px) {
    body { font-size: 15px; }
    .container { padding: 0 15px; }

    /* Grid Dashboard e Catlogo */
    .dashboard-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .catalog-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

    /* Layout de detalhes vira coluna */
    .catalog-layout-grid { grid-template-columns: 1fr; }

    /* Header compactado */
    .main-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* Celulares grandes (576px at 767px) */
@media (max-width: 767px) {
    body { font-size: 14px; }
    .container { padding: 0 10px; }

    /* Forms em coluna */
    .form-group-inline { flex-direction: column; gap: 10px; }

    /* Tabs viram scroll horizontal */
    .tab-buttons { overflow-x: auto; }
    .tab-button { flex: 0 0 auto; }

    /* Cards e Kanban */
    .kanban-board { flex-direction: column; overflow-x: hidden; }
    .kanban-column { max-width: 100%; width: 100%; }

    /* Chat mais compacto */
    .chat-history { max-height: 400px; }
}

/* Celulares pequenos (at 575px) */
@media (max-width: 575px) {
    body { font-size: 13px; }
    .container { padding: 0 5px; }

    /* Header em pilha */
    .main-header { padding: 10px; }
    .header-logo { height: 30px; }

    /* Tabelas com rolagem horizontal */
    table { font-size: 0.85rem; }
    th, td { padding: 0.5rem; }

    /* Catalog Cards menores */
    .catalog-card-thumbnail { height: 120px; }
    .catalog-card-body h3 { font-size: 1rem; }
    .catalog-card-body p { font-size: 0.85rem; }

    /* Botes menores */
    .btn, .btn-primary, .btn-secondary, .btn-danger {
        padding: 8px 15px;
        font-size: 0.8rem;
    }
}


/* ============================================= */
/* ========= NOVA SIDEBAR E HEADER BAR ========= */
/* ============================================= */

/* --- A Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px; /* Comea escondida fora da tela */
    width: 260px;
    height: 100%;
    background-color: #212529; /* Cor de fundo escura */
    color: #f8f9fa;
    padding: 20px 0;
    z-index: 1050;
    transition: left 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}
.sidebar.open {
    left: 0; /* Mostra a sidebar */
}
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid #495057;
}
.sidebar-logo {
    height: 35px;
}
.sidebar-title {
    color: var(--white);
    font-size: 1.2rem;
    margin: 0;
}
.sidebar-nav {
    overflow-y: auto;
    flex-grow: 1;
    margin-top: 15px;
}
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav .nav-category {
    padding: 10px 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #adb5bd;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sidebar-nav .nav-item {
    display: block;
    padding: 12px 20px;
    color: #dee2e6;
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: background-color 0.2s ease, border-left-color 0.2s ease;
}
.sidebar-nav .nav-item:hover {
    background-color: #343a40;
    color: var(--white);
    border-left-color: var(--secondary-blue);
}

/* --- A Barra de Header Superior --- */
.main-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background-color: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-toggle-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}
.page-title-header {
    font-size: 1.5rem;
    margin: 0;
}
.unidade-label {
    font-weight: normal; 
    color: var(--text-color-light);
}
.nav-link-static {
    padding: 8px 12px;
    font-weight: 500;
    color: var(--text-color);
}

/* --- Ajustes para o contedo principal conviver com a sidebar --- */
/* (Opcional, mas recomendado para melhor visual) */
@media (min-width: 992px) {
    body.sidebar-open .container {
        /* ...empurra o container para a direita... */
        margin-left: 260px; 
        /* ...e ajusta a sua largura para preencher o espao restante. */
        width: calc(100% - 260px);
    }
}