:root {
    --brand-color: #0b3d63;
    --brand-color-light: #145a8c;
    --accent-color: #4f46e5;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #F3F4F6;
}

/* Floating Header */
.topbar-wrapper {
    padding: 16px 24px;
    background-color: transparent;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar {
    background-color: transparent !important;
    box-shadow: none !important;
    padding: 0;
    width: 100%;
}

.topbar-inner {
    background-color: rgba(255, 255, 255, 1);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    padding: 8px 16px;
    width: 100%;
    margin: 0 auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar.header-scrolled .topbar-inner {
    width: max-content;
    background-color: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50px;
}

/* 1. Estado Normal (Expandido) */
.brand-text,
.right-collapsible {
    display: inline-block;
    /* Essencial para que o max-width e overflow funcionem em spans */
    white-space: nowrap;
    overflow: visible;
    max-width: 300px;
    /* Espaço de sobra para o texto completo */
    opacity: 1;
    flex-shrink: 0;
    /* CRÍTICO: Impede o Flexbox de espremer o conteúdo precocemente */
    transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease-out,
        margin 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. Estado Contraído (Quando .header-scrolled é adicionado via JS no Header) */
.topbar.header-scrolled .brand-text,
.topbar.header-scrolled .right-collapsible {
    max-width: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
    overflow: hidden !important;
    /* Impede que os botões invisíveis recebam cliques */
}

.topbar .navbar-brand {
    color: #1e293b !important;
    font-size: 1.25rem;
}

.nav-pill {
    color: #475569 !important;
    font-weight: 500;
    padding: 8px 16px !important;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.nav-pill:hover {
    color: var(--accent-color) !important;
    background-color: rgba(79, 70, 229, 0.05);
}

.nav-pill.active {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--accent-color) !important;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background-color: transparent;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background-color: #f1f5f9 !important;
}

.dropdown-toggle-no-caret::after {
    display: none;
}

.app-wrapper {
    display: flex;
    min-height: calc(100vh - 56px);
}

.main-content {
    flex: 1;
    padding: 24px;
    min-width: 0;
}

/* ---------- Dashboard ---------- */
/* Modo TV (tela cheia): some com a navegação e os filtros, sobra só o
   conteúdo do dashboard — pensado pra ficar num monitor 24h. */
body.modo-tv .topbar-wrapper,
body.modo-tv #formFiltroDashboard {
    display: none !important;
}

body.modo-tv .main-content {
    padding: 20px;
}

/* Controles do Dashboard */
.shadow-2xs {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.dashboard-refresh-control {
    background-color: #fff;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.dashboard-refresh-control:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.dashboard-refresh-control .form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.dashboard-refresh-control select:focus {
    outline: none;
    box-shadow: none;
}

.pulse-indicator {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

[data-bs-theme="dark"] .dashboard-refresh-control {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .dashboard-refresh-control select {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .dashboard-refresh-control .border-start {
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .badge.bg-white {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

/* ---------- Backdrop Translúcido de Foco (Global) ---------- */
.filtros-floating-backdrop,
.filtros-dashboard-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.filtros-floating-backdrop.active,
.filtros-dashboard-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ---------- Filtros Flutuantes (Overlay Glassmorphism) - Global ---------- */
.filtros-floating-wrapper,
.filtros-dashboard-wrapper {
    position: relative;
    z-index: 1040;
}

.btn-toggle-filtros.active-filter-open,
#btnToggleFiltrosDashboard.active-filter-open {
    position: relative;
    z-index: 1042;
}

.filtros-floating-collapse,
.filtros-dashboard-floating {
    position: absolute;
    top: -6px;
    left: 0;
    right: 0;
    width: 100%;
}

.filtros-floating-card {
    background: rgba(248, 250, 252, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(203, 213, 225, 0.95);
    border-top: 3px solid #4f46e5;
    border-radius: 16px;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.filtros-subcard {
    background: #ffffff;
    border-color: rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

/* Modo escuro para os filtros flutuantes e backdrop */
[data-bs-theme="dark"] .filtros-floating-backdrop,
[data-bs-theme="dark"] .filtros-dashboard-backdrop {
    background: rgba(0, 0, 0, 0.65);
}

[data-bs-theme="dark"] .filtros-floating-card {
    background: rgba(15, 23, 42, 0.98);
    border-color: rgba(51, 65, 85, 0.95);
    border-top: 3px solid #6366f1;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .filtros-subcard {
    background: rgba(30, 41, 59, 0.75);
    border-color: rgba(51, 65, 85, 0.8) !important;
}

[data-bs-theme="dark"] .filtros-floating-card input[type="date"],
[data-bs-theme="dark"] .filtros-floating-card input[type="text"],
[data-bs-theme="dark"] .filtros-floating-card select {
    background-color: #1e293b !important;
    color: #e2e8f0;
    border-color: #334155;
}

/* ---------- Modern KPI Cards ---------- */
.kpi-card {
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    padding: 12px 14px 14px;
    background: #ffffff;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -4px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
    border-color: rgba(99, 102, 241, 0.35);
}

.kpi-card .kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.kpi-card .kpi-value {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    font-feature-settings: "tnum";
}

.kpi-icon-box {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.kpi-card:hover .kpi-icon-box {
    transform: scale(1.08);
}

.kpi-icon-total {
    background-color: rgba(100, 116, 139, 0.1);
    color: #475569;
}

.kpi-icon-abertos {
    background-color: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.kpi-icon-concluidos {
    background-color: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.kpi-icon-sla {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.kpi-icon-tempo {
    background-color: rgba(14, 165, 233, 0.1);
    color: #0284c7;
}

.kpi-icon-satisfacao {
    background-color: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

.kpi-icon-tarefas-vencer {
    background-color: rgba(234, 88, 12, 0.12);
    color: #ea580c;
}

.kpi-card .text-tarefas-prazo {
    color: #d97706;
}

.kpi-card.kpi-tarefas-prazo:hover {
    border-color: rgba(234, 88, 12, 0.45);
}

/* Dark Mode para os cards de KPI */
[data-bs-theme="dark"] .kpi-card {
    background-color: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

[data-bs-theme="dark"] .kpi-card:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.45);
}

[data-bs-theme="dark"] .kpi-card.kpi-tarefas-prazo:hover {
    border-color: #fb923c;
}

[data-bs-theme="dark"] .kpi-card .kpi-label {
    color: #94a3b8;
}

[data-bs-theme="dark"] .kpi-icon-total {
    background-color: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
}

[data-bs-theme="dark"] .kpi-icon-tarefas-vencer {
    background-color: rgba(251, 146, 60, 0.2);
    color: #fb923c;
}

[data-bs-theme="dark"] .kpi-card .text-tarefas-prazo {
    color: #fbbf24 !important;
}

[data-bs-theme="dark"] .kpi-card .text-dark {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .kpi-card .text-primary {
    color: #60a5fa !important;
}

[data-bs-theme="dark"] .kpi-card .text-success {
    color: #34d399 !important;
}

[data-bs-theme="dark"] .kpi-card .text-danger {
    color: #f87171 !important;
}

[data-bs-theme="dark"] .kpi-card .text-info-emphasis {
    color: #38bdf8 !important;
}

[data-bs-theme="dark"] .kpi-card .text-warning-emphasis {
    color: #fbbf24 !important;
}

.chart-card {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 16px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    padding: 22px 24px;
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.chart-card:hover {
    box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.03);
    border-color: rgba(203, 213, 225, 0.9);
}

.chart-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.chart-card:hover .chart-icon-box {
    transform: scale(1.08);
}

.heatmap-cell {
    width: 14px;
    height: 14px;
    border-radius: 3.5px;
    display: inline-block;
    margin: 2px;
    background-color: #f1f5f9;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s ease;
}

.heatmap-cell:hover {
    transform: scale(1.4);
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.heatmap-legend-cell {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

[data-bs-theme="dark"] .heatmap-cell {
    border-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .heatmap-legend-cell {
    border-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .heatmap-legend-cell.empty {
    background-color: #1e293b !important;
}

.status-badge {
    font-size: .75rem;
    padding: .35em .6em;
    border-radius: 20px;
    color: #fff;
    display: inline-block;
    white-space: normal;
    line-height: 1.2;
    text-align: center;
}

/* Tarefa com prazo vencido e ainda não concluída (mesmo critério do backend). */
tr.tarefa-atrasada {
    background-color: rgba(220, 53, 69, .08);
}

tr.tarefa-atrasada:hover {
    background-color: rgba(220, 53, 69, .14);
}

[data-bs-theme="dark"] tr.tarefa-atrasada {
    background-color: rgba(220, 53, 69, .18);
}

[data-bs-theme="dark"] tr.tarefa-atrasada:hover {
    background-color: rgba(220, 53, 69, .26);
}

/* ---------- Tema escuro ---------- */
[data-bs-theme="dark"] body,
html[data-bs-theme="dark"] body {
    background-color: #0f172a;
    color: #f1f5f9;
}

[data-bs-theme="dark"] .kpi-card,
[data-bs-theme="dark"] .chart-card,
[data-bs-theme="dark"] .card {
    background-color: #1e293b;
    color: #f1f5f9;
    border-color: #334155;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .table {
    color: #f1f5f9;
    border-color: #334155;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #0f172a;
    border-color: #3b82f6;
    color: #f1f5f9;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1e293b;
    border-color: #334155;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: #334155;
    color: #fff;
}

[data-bs-theme="dark"] .modal-content {
    background-color: #1e293b;
    border-color: #334155;
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    border-color: #334155;
}

[data-bs-theme="dark"] .offcanvas {
    background-color: #1e293b;
}

[data-bs-theme="dark"] .btn-light {
    background-color: #334155;
    color: #f1f5f9;
    border-color: #334155;
}

[data-bs-theme="dark"] .btn-light:hover {
    background-color: #475569;
    color: #fff;
    border-color: #475569;
}

[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

/* ---------- Login ---------- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-color) 0%, #082846 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    border: none;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .25);
}
/* Ajustes datatables para integrar melhor visualmente */
div.dataTables_wrapper div.dataTables_filter input {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
}
div.dataTables_wrapper div.dataTables_length select {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
}

/* Centralizar textos em todas as tabelas */
.table th, .table td {
    text-align: center !important;
    vertical-align: middle !important;
}

.btn-check:checked + label .cd-filter-badge {
    background-color: #ffffff !important;
    color: #0d6efd !important;
}

/* ---------- Componente de Chat / Bate-papo ---------- */
.chat-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 16px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-card.dragover {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.18) !important;
}

.chat-messages-container {
    max-height: 480px;
    min-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 14px;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Scrollbar moderno e sutil */
.chat-messages-container::-webkit-scrollbar {
    width: 6px;
}
.chat-messages-container::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
}
.chat-messages-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.chat-msg-row {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    animation: chatMsgFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chatMsgFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg-row.chat-msg-me {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-msg-row.chat-msg-other {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-bubble {
    padding: 8px 12px;
    font-size: 0.85rem;
    line-height: 1.45;
    word-break: break-word;
    position: relative;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

/* Balão do próprio usuário: alinhado à direita, azul primário, texto branco, borda inferior direita reta */
.chat-bubble-me {
    background-color: #0d6efd;
    background-image: linear-gradient(135deg, #0d6efd, #0b5ed7);
    color: #ffffff;
    border-radius: 16px 16px 2px 16px;
}

/* Balão de outras pessoas: alinhado à esquerda, cinza claro (#f1f5f9), texto escuro (#0f172a), borda inferior esquerda reta */
.chat-bubble-other {
    background-color: #f1f5f9;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 16px 16px 16px 2px;
}

.chat-bubble.is-internal {
    border-left: 3.5px solid #f59e0b !important;
}

/* Botão de Fixar / Desafixar e Itens Fixados */
.btn-toggle-fixar-chat {
    border-radius: 6px;
    padding: 2px 4px !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.4;
}
.chat-msg-row:hover .btn-toggle-fixar-chat {
    opacity: 0.85;
}
.btn-toggle-fixar-chat:hover {
    opacity: 1 !important;
    transform: scale(1.18);
    color: #f59e0b !important;
}
.btn-toggle-fixar-chat.is-pinned {
    opacity: 1 !important;
    color: #f59e0b !important;
}

.item-msg-fixada {
    background-color: #f8fafc !important;
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.045) 0%, #f8fafc 18%, #f8fafc 100%) !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 4px solid #ea580c !important;
    border-radius: 10px;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.02) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.item-msg-fixada:hover {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    border-left-color: #c2410c !important;
    box-shadow: 0 6px 18px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04) !important;
    transform: translateY(-1px);
}

.item-msg-fixada .btn-light {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
}
.item-msg-fixada .btn-light:hover {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .item-msg-fixada {
    background-color: #0f172a !important;
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.08) 0%, #0f172a 18%, #0f172a 100%) !important;
    border-color: #334155 !important;
    border-left-color: #fb923c !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}
[data-bs-theme="dark"] .item-msg-fixada:hover {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-color: #475569 !important;
    border-left-color: #fdba74 !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .item-msg-fixada .border-bottom {
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .item-msg-fixada .btn-light {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
[data-bs-theme="dark"] .item-msg-fixada .btn-light:hover {
    background-color: #334155 !important;
    border-color: #475569 !important;
}

.item-msg-fixada .btn-desafixar-msg,
.item-msg-fixada .btn-ir-para-msg {
    padding: 4px 10px !important;
    font-size: 0.74rem !important;
    font-weight: 500;
    border-radius: 6px;
    line-height: 1.35;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease-in-out;
}
.item-msg-fixada .btn-desafixar-msg:hover {
    background-color: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}
.item-msg-fixada .btn-ir-para-msg:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.chat-bubble-me a {
    color: #ffffff;
    text-decoration: underline;
}

.chat-bubble-other a {
    color: #0284c7;
    text-decoration: underline;
}

/* Conteúdo Formatado em Markdown das Mensagens Fixadas */
.msg-fixada-texto {
    color: #1e293b;
    font-size: 0.88rem;
    line-height: 1.6;
    word-break: break-word;
}

.msg-fixada-texto p:last-child {
    margin-bottom: 0 !important;
}

.msg-fixada-texto .fa-bookmark {
    margin-right: 8px !important;
    display: inline-block;
}

.msg-fixada-texto hr {
    margin: 1.25rem 0;
    border-color: #e2e8f0;
    opacity: 0.85;
}

.msg-fixada-texto table {
    width: 100%;
    margin: 0.85rem 0;
}

.msg-fixada-texto table th {
    background-color: #f8fafc;
    color: #334155;
    font-weight: 600;
    font-size: 0.8rem;
    border-bottom: 2px solid #e2e8f0;
}

.msg-fixada-texto table td {
    font-size: 0.82rem;
    color: #334155;
}

.msg-fixada-texto ul,
.msg-fixada-texto ol {
    padding-left: 1.35rem;
    margin-bottom: 0.65rem;
}

.msg-fixada-texto li {
    margin-bottom: 0.25rem;
}

.msg-fixada-texto code {
    font-size: 0.85em;
}

[data-bs-theme="dark"] .msg-fixada-texto {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .msg-fixada-texto h1,
[data-bs-theme="dark"] .msg-fixada-texto h2,
[data-bs-theme="dark"] .msg-fixada-texto h3,
[data-bs-theme="dark"] .msg-fixada-texto h4,
[data-bs-theme="dark"] .msg-fixada-texto h5,
[data-bs-theme="dark"] .msg-fixada-texto h6 {
    color: #f1f5f9;
}

[data-bs-theme="dark"] .msg-fixada-texto table {
    border-color: #334155 !important;
    background-color: #1e293b !important;
}

[data-bs-theme="dark"] .msg-fixada-texto table th {
    background-color: #0f172a;
    color: #e2e8f0;
    border-color: #334155;
}

[data-bs-theme="dark"] .msg-fixada-texto table td {
    color: #cbd5e1;
    border-color: #334155;
}

[data-bs-theme="dark"] .msg-fixada-texto hr {
    border-color: #334155;
}

/* Botão de Informações da Mensagem Fixada ("i") */
.btn-info-fixada {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    color: #94a3b8;
    font-size: 0.72rem;
    line-height: 1;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    box-shadow: none;
    flex-shrink: 0;
    opacity: 0.85;
}

.btn-info-fixada:hover,
.btn-info-fixada.active {
    background-color: #e0f2fe;
    border-color: #bae6fd;
    color: #0284c7;
    box-shadow: 0 1px 4px rgba(2, 132, 199, 0.16);
    transform: scale(1.08);
    opacity: 1;
}

.btn-info-fixada-chat {
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
    border-color: #e2e8f0;
    background-color: #ffffff;
    opacity: 0.75;
}

.chat-msg-row:hover .btn-info-fixada-chat {
    opacity: 1;
}

[data-bs-theme="dark"] .btn-info-fixada {
    background-color: #1e293b;
    border-color: #334155;
    color: #64748b;
}

[data-bs-theme="dark"] .btn-info-fixada:hover,
[data-bs-theme="dark"] .btn-info-fixada.active {
    background-color: rgba(2, 132, 199, 0.2);
    border-color: rgba(2, 132, 199, 0.4);
    color: #38bdf8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Popover Flutuante de Informações da Mensagem Fixada */
.popover-info-fixada {
    position: fixed;
    z-index: 1080;
    width: 320px;
    max-width: 90vw;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 14px 30px -4px rgba(15, 23, 42, 0.16), 0 8px 16px -4px rgba(15, 23, 42, 0.08);
    pointer-events: auto;
    user-select: text;
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(4px) scale(0.98);
}

.popover-info-fixada.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.popover-info-fixada .popover-info-header {
    letter-spacing: -0.2px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid #eef2f6;
}

.popover-info-fixada .popover-info-header-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #1e293b;
}

.popover-info-fixada .popover-info-header-title i {
    font-size: 0.95rem;
}

.popover-info-fixada .popover-info-body {
    display: flex;
    flex-direction: column;
}

.popover-info-fixada .popover-info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.popover-info-fixada .popover-info-item + .popover-info-item {
    padding-top: 14px;
    margin-top: 2px;
    border-top: 1px solid #eef2f6;
}

.popover-info-fixada .popover-info-icon {
    width: 30px;
    height: 30px;
    font-size: 0.82rem;
    transition: transform 0.2s ease;
}

.popover-info-fixada .popover-info-item:hover .popover-info-icon {
    transform: scale(1.1);
}

.popover-info-fixada .popover-info-text {
    flex: 1;
    min-width: 0;
}

.popover-info-fixada .popover-info-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    line-height: 1.2;
}

.popover-info-fixada .popover-info-value {
    font-size: 0.83rem;
    line-height: 1.35;
    word-break: break-word;
}

.popover-info-fixada .popover-info-subtext {
    font-size: 0.74rem;
    margin-top: 3px;
    line-height: 1.35;
    word-break: break-word;
}

/* Suporte a Tema Escuro */
[data-bs-theme="dark"] .popover-info-fixada {
    background-color: #1e293b;
    border-color: #334155;
    box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.5), 0 8px 16px -4px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .popover-info-fixada .popover-info-header,
[data-bs-theme="dark"] .popover-info-fixada .popover-info-item + .popover-info-item {
    border-color: #334155;
}

[data-bs-theme="dark"] .popover-info-fixada .popover-info-header-title {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .popover-info-fixada .popover-info-value {
    color: #f8fafc !important;
}

.highlight-chat-pulse {
    animation: highlightChatPulse 2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes highlightChatPulse {
    0% {
        background-color: rgba(245, 158, 11, 0.35);
        border-radius: 12px;
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.25);
    }
    50% {
        background-color: rgba(245, 158, 11, 0.18);
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.12);
    }
    100% {
        background-color: transparent;
        box-shadow: none;
    }
}

/* Mini-cards de anexo dentro do balão */
.chat-attachment-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a !important;
    transition: all 0.15s ease;
}
.chat-attachment-card:hover {
    border-color: #94a3b8;
    background-color: #f8fafc;
    transform: translateY(-1px);
}

.chat-attachment-icon-box {
    width: 28px;
    height: 28px;
    background: #f1f5f9;
    flex-shrink: 0;
}

.chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 4px 6px;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.chat-input-bar:focus-within {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15) !important;
}

.chat-btn-attach {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 8px;
    background-color: transparent;
    color: #64748b !important;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease-in-out;
    padding: 0;
    margin-bottom: 1px;
}
.chat-btn-attach:hover {
    background-color: #f1f5f9;
    color: #0d6efd !important;
}

.chat-textarea {
    flex: 1 1 auto;
    min-width: 0;
    width: 0;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    resize: none;
    font-size: 0.875rem;
    min-height: 36px;
    max-height: 120px;
    line-height: 1.45;
    padding: 6px 8px;
    background-color: transparent !important;
    color: #0f172a;
    display: block;
}
.chat-textarea:focus {
    outline: none !important;
    box-shadow: none !important;
}
.chat-textarea::placeholder {
    color: #94a3b8;
}

.chat-btn-send {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 8px;
    background-color: #0d6efd !important;
    background-image: linear-gradient(135deg, #0d6efd, #0b5ed7) !important;
    color: #ffffff !important;
    border: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.25);
    padding: 0;
    margin-bottom: 1px;
}
.chat-btn-send:hover {
    background-color: #0b5ed7 !important;
    background-image: none !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.35);
}
.chat-btn-send:active {
    transform: translateY(0);
}
.chat-btn-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chat-textarea::-webkit-scrollbar {
    width: 4px;
}
.chat-textarea::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Modo Escuro */
[data-bs-theme="dark"] .chat-card {
    background: #1e293b;
    border-color: #334155;
}
[data-bs-theme="dark"] .chat-messages-container {
    background-color: #0f172a;
}
[data-bs-theme="dark"] .chat-bubble-other {
    background-color: #1e293b;
    color: #f1f5f9;
    border-color: #334155;
}
[data-bs-theme="dark"] .chat-footer {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}
[data-bs-theme="dark"] .chat-input-bar {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}
[data-bs-theme="dark"] .chat-textarea {
    color: #f1f5f9 !important;
    background: transparent !important;
}
[data-bs-theme="dark"] .chat-attachment-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
[data-bs-theme="dark"] .chat-attachment-icon-box {
    background: #0f172a !important;
}
[data-bs-theme="dark"] .chat-btn-attach {
    color: #94a3b8 !important;
}
[data-bs-theme="dark"] .chat-btn-attach:hover {
    background-color: #1e293b;
    color: #38bdf8 !important;
}

/* =========================================================================
   MÓDULO DE AVALIAÇÃO DE SATISFAÇÃO DO CHAMADO (MODERNO E INTUITIVO)
   ========================================================================= */

@keyframes pulse-yellow {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

.animate-pulse-yellow {
    animation: pulse-yellow 2.2s infinite;
}

.card-avaliacao-destaque {
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 50%, #fef3c7 100%);
    border: 1.5px solid #fde68a !important;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.12), 0 8px 10px -6px rgba(245, 158, 11, 0.06);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.card-avaliacao-destaque::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #d97706);
}

.avaliacao-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
    flex-shrink: 0;
}

.star-rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.star-btn {
    background: transparent;
    border: none;
    padding: 4px 6px;
    font-size: 2.1rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.15s ease, filter 0.15s ease;
    line-height: 1;
}

.star-btn:hover,
.star-btn:focus-visible {
    transform: scale(1.22);
    outline: none;
}

.star-btn.active,
.star-btn.hover {
    color: #f59e0b;
    filter: drop-shadow(0 2px 5px rgba(245, 158, 11, 0.4));
}

.star-rating-text {
    transition: all 0.2s ease;
}

.feedback-tag-chip {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s ease;
    user-select: none;
}

.feedback-tag-chip:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.feedback-tag-chip.active {
    background-color: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}

.card-avaliacao-registrada {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.card-avaliacao-registrada::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    bottom: 0;
    background: linear-gradient(180deg, #f59e0b 0%, #10b981 100%);
}

[data-bs-theme="dark"] .card-avaliacao-destaque {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, #1e293b 60%, rgba(245, 158, 11, 0.08) 100%);
    border-color: rgba(245, 158, 11, 0.35) !important;
}

[data-bs-theme="dark"] .feedback-tag-chip {
    background-color: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

[data-bs-theme="dark"] .feedback-tag-chip:hover {
    background-color: #334155;
    color: #ffffff;
}

[data-bs-theme="dark"] .feedback-tag-chip.active {
    background-color: rgba(245, 158, 11, 0.25);
    border-color: #f59e0b;
    color: #fde68a;
}

[data-bs-theme="dark"] .card-avaliacao-registrada {
    background-color: #1e293b;
    border-color: #334155;
}
/* Balões da Voz do Usuário & Classificação (Design Elegante Estilo Balõezinhos) */
.balao-speech-bubble {
    background-color: transparent;
    border: none !important;
    box-shadow: none !important;
    transition: all 0.25s ease;
}

[data-bs-theme="dark"] .balao-speech-bubble {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] #dashVozTexto,
[data-bs-theme="dark"] #dashVozAutor {
    color: #f1f5f9 !important;
}

.balao-adjetivo-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    border-radius: 50rem;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.25;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.balao-adjetivo-pill.pill-verde {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.balao-adjetivo-pill.pill-azul {
    background-color: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #0369a1;
}

.balao-adjetivo-pill.pill-ambar {
    background-color: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
}

.balao-adjetivo-pill.pill-vermelho {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

[data-bs-theme="dark"] .balao-adjetivo-pill.pill-verde {
    background-color: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

[data-bs-theme="dark"] .balao-adjetivo-pill.pill-azul {
    background-color: rgba(2, 132, 199, 0.2);
    border-color: rgba(2, 132, 199, 0.4);
    color: #7dd3fc;
}

[data-bs-theme="dark"] .balao-adjetivo-pill.pill-ambar {
    background-color: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fde68a;
}

[data-bs-theme="dark"] .balao-adjetivo-pill.pill-vermelho {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.transition-fade {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.transition-fade.fade-out {
    opacity: 0;
    transform: translateY(4px);
}







/* Botão de Marcar Notificação como Não Lida (surge no hover do item) */
.notif-card-link .btn-marcar-nao-lida {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease-in-out, visibility 0.15s ease-in-out, transform 0.15s ease-in-out;
}

.notif-card-link:hover .btn-marcar-nao-lida {
    opacity: 1;
    visibility: visible;
}

.notif-card-link .btn-marcar-nao-lida:hover {
    color: var(--bs-primary) !important;
    transform: scale(1.15);
}


/* Notificações Não Lidas - Destaque com Fundo Suave e Borda Lateral (estilo Mensagens Fixadas) */
.notif-chat-item .notif-nao-lida {
    background-color: #f0fdf4 !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, #f0fdf4 35%, #ffffff 100%) !important;
    border-left: 4px solid #10b981 !important;
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.18) !important;
}

.notif-chat-item .notif-nao-lida:hover {
    background-color: #e6fcf0 !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.20) 0%, #e6fcf0 35%, #ffffff 100%) !important;
    border-left-color: #059669 !important;
}

.notif-item .notif-nao-lida {
    background-color: #f0f9ff !important;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.12) 0%, #f0f9ff 35%, #ffffff 100%) !important;
    border-left: 4px solid #0284c7 !important;
    box-shadow: inset 0 0 0 1px rgba(2, 132, 199, 0.18) !important;
}

.notif-item .notif-nao-lida:hover {
    background-color: #e0f2fe !important;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.18) 0%, #e0f2fe 35%, #ffffff 100%) !important;
    border-left-color: #0369a1 !important;
}

[data-bs-theme="dark"] .notif-chat-item .notif-nao-lida {
    background-color: #064e3b !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(6, 78, 59, 0.45) 40%, #0f172a 100%) !important;
    border-left-color: #34d399 !important;
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.3) !important;
}

[data-bs-theme="dark"] .notif-chat-item .notif-nao-lida:hover {
    background-color: rgba(6, 78, 59, 0.65) !important;
    border-left-color: #6ee7b7 !important;
}

[data-bs-theme="dark"] .notif-item .notif-nao-lida {
    background-color: #0c4a6e !important;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.25) 0%, rgba(12, 74, 110, 0.45) 40%, #0f172a 100%) !important;
    border-left-color: #38bdf8 !important;
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.3) !important;
}

[data-bs-theme="dark"] .notif-item .notif-nao-lida:hover {
    background-color: rgba(12, 74, 110, 0.65) !important;
    border-left-color: #7dd3fc !important;
}
