/* /app/static/css/style.css */

/*body { background-color: red !important; }*/

/* --- Variáveis Globais e Estilos Base --- */

/* Adicionado para garantir um cálculo de tamanho consistente */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --cor-primaria: #1c264f;
    --cor-secundaria: #fcf3ff;
    --cor-terciaria: #FFFFFF;
    --cor-sucesso: #28a745;
    --cor-perigo: #dc3545;
    --cor-aviso: #ffc107;
    --cor-info: #0dcaf0;
    --cor-cinza-escuro: #6c757d;
    --cor-cinza-claro-menu: #a9b4d4;
    --cor-texto: #333;
    --cor-texto-claro: #f1f1f1;
    --cor-borda: #dee2e6;
    --cor-fundo-login-esquerda: #1E3A8A;
    --altura-cabecalho: 60px;
    --largura-menu: 250px;
    --raio-borda-padrao: 8px;
    --raio-borda-botao: 50px;
    --altura-padrao-input: 30px;
}

html, body {
    height: 100%; /* Garante que eles ocupem a tela toda */
    width: 100%;
    overflow: hidden; /* IMPEDE a rolagem no corpo da página (horizontal e vertical) */
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: var(--cor-secundaria);
    color: var(--cor-texto);
}


/* --- NOVO: Estilos para o Dropdown de Perfil --- */
.user-profile-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cor-texto);
    font-size: 1rem;
    font-weight: 600;
    padding: 5px 10px;
}

.user-profile-btn i {
    font-size: 1.5rem;
    color: var(--cor-primaria);
}

.dropdown-content.profile-dropdown {
    background-color: var(--cor-terciaria);
    border: 1px solid var(--cor-borda);
    padding-top: 5px;
    padding-bottom: 5px;
}

.profile-dropdown a, .profile-dropdown .dropdown-header {
    padding: 8px 20px;
}

.profile-dropdown .dropdown-header {
    border-bottom: 1px solid var(--cor-borda);
    margin-bottom: 5px;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
}

.profile-dropdown .dropdown-header strong {
    font-size: 1em;
}

.profile-dropdown .dropdown-header small {
    font-size: 0.8em;
    color: var(--cor-cinza-escuro);
}
/* --- FIM DOS NOVOS ESTILOS DE PERFIL --- */

/* --- DESIGN PARA TELA DE LOGIN --- */
.login-page-container {
    display: grid;
    grid-template-columns: 6.5fr 3.5fr;
    height: 100vh;
    width: 100%;
}

/* --- DESIGN PARA TELA DE LOGIN --- */
.login-page-container {
    display: grid;
    grid-template-columns: 6.5fr 3.5fr;
    height: 100vh;
    width: 100%;
}

/* === INÍCIO DAS ALTERAÇÕES NO LOGIN === */
.login-left-panel {
    position: relative; /* Necessário para o overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    color: white;
    /* Imagem de fundo */
    background-image: url('../images/imagem_lado_esqued_pg_login.jpg');
    background-size: cover;
    background-position: center center;
}

.login-left-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(28, 38, 79, 0.55); /* Overlay azul escuro semi-transparente */
    z-index: 1;
}

.branding-content {
    position: relative; /* Para ficar acima do overlay */
    z-index: 2;
    max-width: 450px;
    text-align: left;
}
/* === FIM DAS ALTERAÇÕES NO LOGIN === */


.branding-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.branding-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
}
.branding-content .saiba-mais-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    margin-top: 2rem;
    display: inline-block;
}

.login-right-panel {
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-form-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

/* === ALTERAÇÃO: ESTILO PARA A IMAGEM DO LOGO === */
.login-logo-img {
    display: block;
    max-width: 250px; /* Defina a largura máxima do seu logo */
    height: auto;
    margin: 0 auto 1.5rem auto; /* Centraliza o logo */
}

.login-form-wrapper h2 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 0.5rem;
}
.login-form-wrapper .form-subtitle {
    text-align: center;
    color: var(--cor-cinza-escuro);
    margin-bottom: 2rem;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group .form-label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}
.login-form-wrapper .form-control {
    height: 48px;
    border-radius: 4px;
}
.password-wrapper { position: relative; }
.password-wrapper i { position: absolute; top: 50%; right: 15px; transform: translateY(-50%); cursor: pointer; color: #aaa; }
.options-group { display: flex; justify-content: space-between; align-items: center; font-size: 0.9em; margin: 1rem 0; }
.remember-me { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.forgot-password { color: var(--cor-primaria); text-decoration: none; font-weight: 600; }
.btn-login {
    width: 100%;
    background-color: var(--cor-fundo-login-esquerda);
    color: white;
    height: 48px;
    border-radius: 4px;
    font-size: 1rem;
}
.register-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9em;
}
.register-link a { color: var(--cor-primaria); font-weight: 600; text-decoration: none; }
.help-link {
    display: block;
    margin-top: 2rem;
    text-align: center;
    color: var(--cor-sucesso);
    text-decoration: none;
    font-weight: 600;
}

/* --- Layout Principal (Grid) DA APLICAÇÃO LOGADA --- */
.grid-container {
    display: grid;
    grid-template-columns: var(--largura-menu) 1fr;
    grid-template-rows: var(--altura-cabecalho) 1fr;
    grid-template-areas: "sidebar header" "sidebar content";
    height: 100vh;
    transition: grid-template-columns 0.3s ease-in-out;
}

.header {
    grid-area: header;
    background-color: var(--cor-terciaria);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 30px;
    z-index: 10;
}

.user-info { display: flex; align-items: center; gap: 10px; }
.user-info i { margin-right: 10px; font-size: 1.5rem; color: var(--cor-primaria); }
.user-info a { color: var(--cor-texto); text-decoration: none; margin-left: 20px; font-size: 1.2rem; transition: color 0.2s ease-in-out; }
.user-info a:hover { color: var(--cor-primaria); }



/* --- ESTILOS DO MENU LATERAL (SIDEBAR) --- */
.sidebar {
    grid-area: sidebar;
    background-color: var(--cor-primaria);
    color: var(--cor-texto-claro);
    padding: 0 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 10px;
    height: var(--altura-cabecalho);
    box-sizing: border-box;
}

.sidebar .logo {
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    padding: 0;
    transition: opacity 0.2s, width 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

#sidebar-toggle-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 10px;
}

.sidebar-menu {
    padding: 0;
    margin: 0;
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu li a {
    color: var(--cor-texto-menu);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-radius: 6px;
    transition: background-color 0.2s ease-in-out;
    white-space: nowrap;
}

.sidebar-menu li a i {
    font-size: 1.1rem;
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.sidebar-menu li a:hover {
    background-color: var(--cor-fundo-menu-hover);
}

.sidebar-menu .menu-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cor-cinza-claro-menu);
    text-transform: uppercase;
    padding: 20px 20px 10px 20px;
    white-space: nowrap;
}


/* --- ESTILOS PARA O MENU COLAPSÁVEL (A "MÁGICA") --- */
.grid-container.sidebar-mini {
    grid-template-columns: 80px 1fr;
}

.grid-container.sidebar-mini .sidebar .logo,
.grid-container.sidebar-mini .sidebar .menu-header .link-text {
    opacity: 0;
    width: 0;
    padding: 0;
    margin: 0;
}

.grid-container.sidebar-mini .sidebar .link-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.1s, width 0.1s;
}

.grid-container.sidebar-mini .sidebar-menu li a {
    justify-content: center;
}

.grid-container.sidebar-mini .sidebar-menu li a i {
    margin-right: 0;
}

.content {
    grid-area: content;
    height: 100%;      /* Garante que o container tenha uma altura definida */
    overflow-y: auto;   /* Permite a rolagem APENAS neste container */
    padding: 20px;
    overflow-x: hidden;
}

/* --- Componentes Comuns --- */

/* Cabeçalhos de Página */
.page-header {
    display: flex; /* */
    justify-content: space-between; /* */
    align-items: center; /* */
    margin-bottom: 1.5rem; /* */
}
.page-header h1 {
    display: flex; /* */
    align-items: center; /* */
    gap: 15px; /* */
    font-size: 1.8rem; /* */
    margin: 0; /* */
	color: var(--cor-texto-titulo)
}
.title-icon-wrapper {
    display: inline-flex; /* */
    align-items: center; /* */
    justify-content: center; /* */
    width: 45px; /* */
    height: 45px; /* */
    background-color: var(--cor-fundo-icone-titulo)
    border-radius: 50%; /* */
    color: var(--cor-icone-titulo)
    font-size: 1.2rem; /* */
}
hr.separator {
    border: 0; /* */
    border-top: 1px solid rgba(0,0,0,0.1); /* */
    margin: 1.5rem 0; /* */
}
.text-danger { color: var(--cor-perigo); } /* */
.text-primary { color: var(--cor-primaria); } /* */
.text-muted { color: var(--cor-cinza-escuro); font-size: 0.9em; } /* */
.text-center { text-align: center; } /* */

/* --- Botões --- */
.btn {
    height: var(--altura-padrao-input);
    border-radius: var(--raio-borda-botao);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 25px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn:hover { opacity: 0.9; }

.btn-add { background-color: var(--cor-primaria); color: white; }
.btn-save { background-color: #007bff; color: white; }
.btn-cancel { background-color: var(--cor-cinza-escuro); color: white; }
.btn-danger { background-color: var(--cor-perigo); color: white; }
.btn-ok { background-color: var(--cor-sucesso); color: white; }

.btn-action {
    height: 32px;
    border-radius: var(--raio-borda-botao);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8em;
}

.btn-action.edit { background-color: #007bff; color: white; }
.btn-action.delete { background-color: var(--cor-perigo); color: white; }
.btn-action.reactivate { background-color: var(--cor-sucesso); color: white; }
.btn-action.link { background-color: var(--cor-sucesso); color: white; }
.btn-action.liquidado { background-color: #0d6efd; color: white; }
.btn-action.liquidado:hover { background-color: #0b5ed7; }

.btn-action-icon.delete {
    color: var(--cor-perigo); /* Deixa o ícone vermelho */
}
.btn-action-icon.delete:hover {
    background-color: #fcebeb; /* Um fundo rosa bem claro ao passar o mouse */
}

.btn-action.icon-only:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.btn-action.icon-only.delete {
    background-color: transparent; /* Garante fundo transparente */
    color: var(--cor-perigo); /* Deixa o ícone da lixeira vermelho */
}

.btn-action.icon-only.delete:hover {
    background-color: #fddede; /* Um fundo vermelho bem clarinho ao passar o mouse */
    color: #9d2331; /* Escurece um pouco o ícone no hover */
}

/* --- Formulários --- */
.form-container {
    background: #fff; /* */
    padding: 25px 30px; /* */
    border-radius: var(--raio-borda-padrao); /* */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* */
    max-width: 900px; /* */
    margin: auto; /* */
}
.form-group {
    display: flex; /* */
    flex-direction: column; /* */
    margin-bottom: 20px; /* */
}
.form-group label {
    font-weight: 600; /* */
    margin-bottom: 5px; /* */
}
.form-control {
    width: 100%; /* */
    height: var(--altura-padrao-input); /* */
    padding: 10px; /* */
    border: 1px solid #ccc; /* */
    border-radius: 4px; /* */
    box-sizing: border-box; /* */
    font-size: 1rem; /* */
}

textarea.form-control {
    height: auto;       /* Permite que a altura seja flexível, ignorando a altura fixa da classe .form-control */
    min-height: 120px;  /* ESTE É O VALOR QUE VOCÊ PODE AJUSTAR! Tente 100px, 150px, etc. */
    padding-top: 2px;  /* Garante que o texto sempre comece com um respiro no topo */
    line-height: 1.5;   /* Melhora o espaçamento entre as linhas do texto digitado */
}

.form-actions {
    display: flex; /* */
    justify-content: flex-end; /* */
    gap: 10px; /* */
    margin-top: 25px; /* */
}
.form-grid {
    display: grid; /* */
    grid-template-columns: repeat(4, 1fr); /* */
    gap: 20px 15px; /* */
}
.grid-col-2 { grid-column: span 2; } /* */
.grid-col-3 { grid-column: span 3; } /* */
.grid-col-4 { grid-column: span 4; } /* */

/* --- Componente: Modal de Confirmação --- */
.modal {
    display: none; /* */
    position: fixed; /* */
    z-index: 1000; /* */
    left: 0; top: 0; width: 100%; height: 100%; /* */
    overflow: auto; /* */
    background-color: rgba(0,0,0,0.6); /* */
}
.modal-content {
    background-color: #fefefe; /* */
    margin: 15% auto; /* */
    padding: 30px; /* */
    border-radius: var(--raio-borda-padrao); /* */
    width: 80%; /* */
    max-width: 400px; /* */
    text-align: center; /* */
}
.close-btn {
    position: absolute; /* */
    top: 10px; right: 20px; /* */
    font-size: 28px; /* */
    font-weight: bold; /* */
}

/* Container que posiciona os toasts no canto da tela */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- ESTILOS DO QUADRO KANBAN (MÓDULO TAREFAS) --- */
.kanban-board {
    display: flex; /* */
    gap: 20px; /* */
    width: 100%; /* */
    overflow-x: auto; /* */
    padding-bottom: 20px; /* */
    min-height: 600px; /* */
}

.kanban-column {
    flex: 1; /* */
    min-width: 300px; /* */
    max-width: 320px; /* */
    background-color: #f4f5f7; /* */
    border-radius: var(--raio-borda-padrao); /* */
    padding: 10px; /* */
    display: flex; /* */
    flex-direction: column; /* */
}

.kanban-column-header {
    padding: 10px; /* */
    margin-bottom: 10px; /* */
    font-weight: 600; /* */
    display: flex; /* */
    justify-content: space-between; /* */
    align-items: center; /* */
    border-bottom: 2px solid var(--cor-borda); /* */
}

.task-count {
    background-color: var(--cor-cinza-escuro); /* */
    color: white; /* */
    border-radius: 50%; /* */
    width: 24px; /* */
    height: 24px; /* */
    display: inline-flex; /* */
    align-items: center; /* */
    justify-content: center; /* */
    font-size: 0.8em; /* */
}

.kanban-cards {
    flex-grow: 1; /* */
    min-height: 100px; /* */
    padding: 5px; /* */
    transition: background-color 0.2s; /* */
}

.kanban-cards.drag-over {
    background-color: #e9e9ed; /* */
}

.task-card {
    background-color: white; /* */
    border-radius: 5px; /* */
    padding: 15px; /* */
    margin-bottom: 10px; /* */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* */
    cursor: grab; /* */
    border-left: 5px solid; /* */
}

.task-card.priority-alta { border-left-color: var(--cor-perigo); } /* */
.task-card.priority-media { border-left-color: var(--cor-aviso); } /* */
.task-card.priority-baixa { border-left-color: var(--cor-sucesso); } /* */

.task-card-header h5 {
    margin: 0; /* */
    font-size: 1rem; /* */
}

.task-card-body {
    font-size: 0.9em; /* */
    margin: 10px 0; /* */
    color: var(--cor-cinza-escuro); /* */
}

.task-card-footer {
    display: flex; /* */
    justify-content: space-between; /* */
    align-items: center; /* */
    font-size: 0.8em; /* */
}

/* --- ESTILOS DO COMPONENTE DE PAGINAÇÃO --- */
.pagination-container {
    margin-top: 25px; /* */
    text-align: center; /* */
}
.pagination {
    display: inline-flex; /* */
    justify-content: center; /* */
    align-items: center; /* */
    gap: 5px; /* */
}
.pagination a, .pagination span {
    padding: 8px 15px; /* */
    border: 1px solid var(--cor-borda); /* */
    text-decoration: none; /* */
    color: var(--cor-primaria); /* */
    background-color: white; /* */
    border-radius: 4px; /* */
    font-weight: 600; /* */
}
.pagination span {
    color: var(--cor-texto); /* */
    background: none; /* */
    border-color: transparent; /* */
}
.pagination a.disabled {
    color: #ccc; /* */
    pointer-events: none; /* */
    background-color: #f8f9fa; /* */
}
.pagination a:not(.disabled):hover {
    background-color: #f4f4f4; /* */
}


/* --- ESTILOS PARA PÁGINAS DE LISTAGEM (INDEX) --- */
.filter-bar {
    background-color: white;
    padding: 15px 20px;
    border-radius: var(--raio-borda-padrao);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 180px;
}

.filter-group label {
    margin-bottom: 5px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--cor-cinza-escuro);
}

.filter-group input, .filter-group select {
    height: var(--altura-padrao-input);
    border-radius: 5px;
    border: 1px solid var(--cor-borda);
    padding: 0 15px;
    font-size: 0.9em;
}

.filter-group select:not([class*="select2-hidden-accessible"]) {
    padding: 0 5px; /* Reduz o espaçamento interno para o texto caber */
}

select.form-control:not(.select2-hidden-accessible) {
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 10px; /* Reduz um pouco o padding lateral */
}

.filter-group-actions {
    display: flex;
    gap: 10px;
}

.btn-filter { background-color: var(--cor-primaria); color: white; }
.btn-clear { background-color: var(--cor-cinza-escuro); color: white; }
.btn-secondary { background-color: var(--cor-sucesso); color: white; }

.list-container {
    background-color: white;
    padding: 25px;
    border-radius: var(--raio-borda-padrao);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px; /* Diminuímos para 10px */
}

.list-header h3 { margin: 0; font-size: 1.3rem; }
.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* Permite que os botões quebrem para a linha de baixo */
    justify-content: flex-end; /* Alinha os botões à direita */
}

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

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--cor-borda);
    vertical-align: middle;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.actions-cell { white-space: nowrap; text-align: right; }
.badge { padding: 5px 12px; border-radius: 15px; color: white; font-size: 0.9em; text-transform: capitalize; }
.status-ativo { background-color: var(--cor-sucesso); }
.status-inativo { background-color: var(--cor-cinza-escuro); }
.status-pendente {background-color: #ffc107; /* Amarelo */}
.status-Processado {background-color: #007bff; /* Azul (ou outra cor que desejar para "Processado") */}
.status-ok {background-color: #007bff; /* Azul (ou outra cor que desejar para "Processado") */}



.btn-action.reactivate { background-color: var(--cor-sucesso); color: white; }

/* ======================================================== */
/* --- PADRÃO PARA CABEÇALHO E FILTROS FIXOS --- */
/* ======================================================== */
.sticky-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--cor-secundaria);
    padding-top: 20px; /* Espaçamento superior */
    padding-bottom: 1px; /* Necessário para renderizar o fundo corretamente */
}

.sticky-wrapper .page-header {
    padding: 0 10px; /* Alinha o conteúdo com a lista abaixo */
}

.sticky-wrapper .filter-bar {
    margin: 0 10px; /* Alinha o conteúdo com a lista abaixo */
}

/* ======================================================== */
/* --- PADRÃO PARA ETIQUETAS DE STATUS (BADGES) --- */
/* ======================================================== */
.status-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.85em;
    color: #fff;
    text-align: center;
    display: inline-block;
    min-width: 80px;
}

.status-enviado {
    background-color: var(--cor-sucesso); /* Verde */
}

.status-pendente {
    background-color: #f0ad4e; /* Laranja */
}

.status-falha {
    background-color: var(--cor-perigo); /* Vermelho */
}

/* ================================== */
/* --- ESTILOS PARA TELA DE CHAT --- */
/* ================================== */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
}
.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    line-height: 1.5;
    margin-bottom: 15px; /* Adiciona o espaço entre os balões */
}

.message-bubble p {
    margin: 0;
}
.message-author {
    font-weight: 700;
    font-size: 0.9em;
    margin-bottom: 5px;
}
.message-time {
    font-size: 0.75em;
    text-align: right;
    margin-top: 5px;
    opacity: 0.7;
}
/* Mensagens Recebidas (dos outros) */
.message-bubble.received {
    background-color: #f1f0f0;
    border-bottom-left-radius: 2px;
    align-self: flex-start;
}
/* Mensagens Enviadas (por você) */
.message-bubble.sent {
    background-color: #dcf8c6;
    border-bottom-right-radius: 2px;
    align-self: flex-end;
}
.reply-form-container {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: var(--raio-borda-padrao);
}

.message-body p {
    margin: 0;
    white-space: pre-wrap; /* Esta linha mágica preserva as quebras de linha e espaços */
}

/* ================================== */
/* --- ESTILOS PARA O MODAL DE CHAT --- */
/* ================================== */
.chat-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1040;
}

.chat-modal-right {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 500px;
    height: 100%;
    background-color: white;
    box-shadow: -5px 0px 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1050;
}

.chat-modal-right.is-visible {
    transform: translateX(0);
}

.chat-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--cor-borda);
    background-color: #f8f9fa;
}

.chat-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.chat-modal-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.chat-modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex; /* Adicione esta linha */
    flex-direction: column; /* Adicione esta linha */
}

.chat-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--cor-borda);
    background-color: #f8f9fa;
}

.reply-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50% !important; /* Força o formato redondo */
    padding: 0 !important;
    font-size: 1.2rem;
}

.status-aberto {
    background-color: #007bff; /* Azul */
}

.status-resolvido {
    background-color: var(--cor-cinza-escuro); /* Cinza */
}

/* Ajustes no cabeçalho do modal de chat */
.chat-modal-header {
    flex-direction: column;
    align-items: stretch;
}
.header-main-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.header-sub-line {
    width: 100%;
    padding-top: 10px;
}
/* Botão mais fino */
.btn-slim {
    height: 28px;
    padding: 0 12px;
    font-size: 0.8em;
}

/* ================================== */
/* --- ESTILOS PARA NOTIFICAÇÕES --- */
/* ================================== */
.notification-bell {
    position: relative;
    margin-right: 20px;
    font-size: 1.3rem;
    color: var(--cor-cinza-escuro);
    cursor: pointer;
}
.notification-dot {
    position: absolute;
    top: 0px;
    right: -5px;
    min-width: 18px; /* Largura mínima */
    height: 18px;
    padding: 0 5px; /* Espaçamento para o número não ficar colado */
    background-color: var(--cor-perigo);
    border-radius: 9px; /* Metade da altura para ficar redondinho */
    border: 2px solid var(--cor-terciaria);
    color: white; /* Cor do número */
    font-size: 11px; /* Tamanho da fonte do número */
    font-weight: bold;
    /* Adicionado para centralizar o número dentro da bolinha */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ================================== */
/* --- ESTILOS PARA O DASHBOARD --- */
/* ================================== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.card {
    background-color: #fff;
    border-radius: var(--raio-borda-padrao);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 5px solid;
}

.card-icon {
    font-size: 2.5rem;
    padding-right: 20px;
    border-right: 1px solid var(--cor-borda);
}

.card-content h3 {
    margin: 0;
    font-size: 2rem;
}

.card-content p {
    margin: 0;
    color: var(--cor-cinza-escuro);
    font-weight: 500;
}

/* Cores dos Cards */
.card-blue { border-color: #007bff; }
.card-blue .card-icon { color: #007bff; }

.card-orange { border-color: #fd7e14; }
.card-orange .card-icon { color: #fd7e14; }

.card-green { border-color: var(--cor-sucesso); }
.card-green .card-icon { color: var(--cor-sucesso); }

.card-red { border-color: var(--cor-perigo); }
.card-red .card-icon { color: var(--cor-perigo); }

.card-purple { border-color: #6f42c1; }
.card-purple .card-icon { color: #6f42c1; }

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.chart-container {
    background-color: #fff;
    padding: 20px;
    border-radius: var(--raio-borda-padrao);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.chart-container h3 {
    margin-top: 0;
    text-align: center;
}

.btn-action.icon-only {
    background: none;
    color: inherit;
    padding: 8px;
    border: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: auto;
}

.btn-action.icon-only:hover {
    background-color: rgba(0, 0, 0, 0.05); /* Adiciona um leve destaque ao passar o mouse */
}

.btn-action.icon-only i {
    margin: 0; /* Remove qualquer margem extra do ícone */
    font-size: 1em; /* Garante que o tamanho do ícone seja adequado */
}

/* --- ESTILOS PARA O DROPDOWN DE AÇÕES (CORRIGIDO) --- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background-color: var(--cor-cinza-escuro);
  color: white;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: #f9f9f9;
  min-width: 220px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 100;
  border-radius: var(--raio-borda-padrao);
  overflow: hidden;
}

.dropdown-content a, .dropdown-content .dropdown-item-form-trigger {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9em;
  cursor: pointer;
}

.dropdown-content a i {
    width: 15px;
    text-align: center;
    color: var(--cor-cinza-escuro);
}

.dropdown-content a:hover, .dropdown-content .dropdown-item-form-trigger:hover {
    background-color: #f1f1f1;
}

.dropdown-divider {
    height: 1px;
    margin: 5px 0;
    overflow: hidden;
    background-color: #e5e5e5;
}

.dropdown-content.show {
  display: block;
}

/* --- Estilos para Toast/Flash Messages --- */
.toast {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 1rem;
    border-radius: var(--raio-borda-padrao);
    color: #fff;
    background-color: var(--cor-cinza-escuro); /* Cor padrão */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    width: 350px;
    min-height: 60px;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
    position: relative;
    right: -20px;
}

.toast i {
    font-size: 1.5rem;
    margin-right: 15px;
}

.toast .toast-body p {
    margin: 0;
    font-weight: 500;
}

.toast.success { background-color: var(--cor-sucesso); }
.toast.danger { background-color: var(--cor-perigo); }
.toast.info { background-color: #0d6efd; } /* Usando um azul padrão para mensagens de informação */

@keyframes fadeIn {
    from { opacity: 0; right: -50px; }
    to { opacity: 1; right: 0; }
}
@keyframes fadeOut {
    from { opacity: 1; right: 0; }
    to { opacity: 0; right: -50px; }
}

* ======================================================== */
/* --- AJUSTES PARA PLUGINS EXTERNOS (EX: SELECT2) --- */
/* ======================================================== */

/* Força a altura do container do Select2 para ser igual aos outros inputs */
.select2-container .select2-selection--single {
    height: var(--altura-padrao-input); 
}

/* Alinha verticalmente o texto e a seta dentro do Select2 */
.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    display: flex;
    align-items: center;
    position: static; /* Necessário para o alinhamento da seta funcionar */
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    margin-top: 0 !important; /* Remove qualquer margem que desalinhe a seta */
}


.btn-voltar {
    background-color: #6c757d; /* Cor de fundo cinza, como os botões secundários */
    color: white;
}

.btn-voltar:hover {
    background-color: #5a6268; /* Cor um pouco mais escura no hover */
    color: white;
}

/* Estilo base para todos os toasts */
.toast {
    display: flex;
    align-items: center;
    padding: 15px;
    color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    width: 350px;
    min-height: 60px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.5s ease, transform 0.5s ease;
    /* Ajuste de borda arredondada somente à esquerda */
    border-radius: var(--raio-borda-padrao) 0 0 var(--raio-borda-padrao);
}

.toast i {
    font-size: 1.5rem;
    margin-right: 15px;
}
.toast .toast-body p {
    margin: 0;
    font-weight: 500;
}


/* Cores translúcidas por categoria */
.toast.danger {
    background-color: rgba(220, 53, 69, 0.82); /* Vermelho com 80% de opacidade */
    border-left: 5px solid #a0212d;
}
.toast.success {
    background-color: rgba(40, 167, 69, 0.82); /* Verde com 80% de opacidade */
    border-left: 5px solid #1a6d2d;
}
.toast.info {
    background-color: rgba(13, 202, 240, 0.82); /* Azul com 80% de opacidade */
    border-left: 5px solid #0a829b;
}

/* Animações de deslize */
@keyframes slideInFromRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutToRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.toast.slide-in { animation: slideInFromRight 0.5s forwards; }
.toast.slide-out { animation: slideOutToRight 0.5s forwards; }

/* --- FIM DA ALTERAÇÃO --- */


.card-header-aligned {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header-aligned h3 {
    margin: 0; /* Remove todas as margens do título para um alinhamento perfeito */
}

/* --- Ajustes na Tabela de Usuários --- */
.table-users .col-email {
    /* Define uma largura máxima para a coluna de email */
    max-width: 250px; 
    
    /* Permite que emails muito longos quebrem a linha */
    word-break: break-all;
}

.table-users .col-papel {
    /* Define uma largura mínima para a coluna de papel */
    min-width: 140px; 
}