.chat-flutuante {
    position: fixed !important;
    bottom: 10px;
    right: 25px;
    width: 650px;
    height: 70vh;
    z-index: 1030;
}

.direct-chat-messages {
    height: 100% !important;
    overflow-y: auto;
}

.scrollable-alert {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 15px;
    word-wrap: break-word;
}

#mensagem_usuario {
    resize: vertical;
    min-height: 50px;
    max-height: 200px;
}

#enviar_mensagem {
    white-space: nowrap;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#loading-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 100px;
    color: orange;
    animation: pulse 2s infinite alternate;
}

#loading-text {
    color: white;
    font-size: 24px;
    margin-top: 16px;
    text-shadow: 1px 1px 3px black;
}

#error-text {
    color: white;
    font-size: 24px;
    margin-top: 16px;
    text-shadow: 1px 1px 3px black;
}

.loader {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: inline-block;
    border-top: 3px solid #fff;
    border-right: 3px solid transparent;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 20px;
    text-decoration: none;
}

.close-button i {
    display: inline-block;
}

.error-input {
    border: 1px solid red;
}

.hidden {
    display: none;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.green-icon {
    color: #16FE38;
}

.orange-icon {
    color: orange;
}

#loading-error {
    color: orange;
    font-size: 100px;
    margin-top: 16px;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.floating-button {
    position: fixed;
    bottom: 30px;
    right: 25px;
    z-index: 1000;
}

.floating-menu {
    display: none;
    position: absolute;
    bottom: 55px;
    right: 0;
    z-index: 1000;
    max-width: 300px;
}

.floating-menu .card {
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.3);
    font-size: 24px;
    white-space: nowrap;
}

.floating-menu .card:hover {
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.5);
}

.floating-menu .card a {
    display: block;
    text-decoration: none;
    color: #333;
    padding: 10px;
}

#floatingBtn:focus {
    outline: 2px solid rgba(0, 0, 0, 0.3);
}

.centered-text {
    max-width: 80%;
    text-align: center;
    word-wrap: break-word;
}

#botao_direito {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(200, 200, 200, 0.8);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    font-family: 'Arial', sans-serif;
    width: 200px;
    padding: 0;
    margin: 0;
}

#botao_direito ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#botao_direito a {
    padding: 12px 18px;
}

#botao_direito li {
    font-size: 15px;
    color: #333;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#botao_direito li a {
    color: inherit;
    text-decoration: none;
    display: block;
}

#botao_direito li:first-child {
    border-radius: 10px 10px 0 0;
}

#botao_direito li:last-child {
    border-radius: 0 0 10px 10px;
}

#botao_direito li:not(:last-child) {
    border-bottom: 1px solid rgba(200, 200, 200, 0.9);
}

#botao_direito li:hover {
    background-color: rgba(240, 240, 240, 0.9);
    text-decoration: solid;
    cursor: pointer;
}

#botao_direito li:active {
    background-color: rgba(220, 220, 220, 0.9);
    color: #000;
}

.notificacoes {
    max-height: 500px;
    overflow-y: auto;
}

.notificacao-item {
    display: flex;
    padding: 0;
    text-decoration: none;
    color: inherit;
    border: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background-color 0.2s ease;
}

.notificacao-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
    color: inherit;
}

.notificacao-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.notificacao-texto {
    flex: 1;
    margin-right: 5px;
    overflow: visible;
    white-space: normal;
    word-wrap: break-word;
    color: #526071;
    line-height: 1.45;
}

.notificacao-horario {
    font-size: 0.72rem;
    white-space: nowrap;
    color: #7f8b99;
}

.notificacao-item.nao_clicada {
    background: rgba(87, 136, 253, 0.08);
}

.notificacao-item.lida {
    background: #fff;
}

.notificacao-item.lida .notificacao-status {
    color: #6c757d;
    background: #f1f3f5;
}

.notificacao-layout {
    display: flex;
    width: 100%;
    padding: 0.8rem 0.9rem;
    align-items: flex-start;
}

.notificacao-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.notificacao-avatar,
.notificacao-avatar-fallback {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6c757d, #5788fd);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.08em;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.notificacao-avatar-card,
.notificacao-toast-card {
    border-radius: 0.75rem;
    background: #e9ecef;
}

.notificacao-tipo-badge {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.62rem;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
}

.notificacao-corpo {
    min-width: 0;
    flex: 1;
}

.notificacao-topo {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.notificacao-autor {
    font-size: 0.93rem;
    font-weight: 700;
    color: #343a40;
    line-height: 1.2;
    padding-top: 0.05rem;
}

.notificacao-status {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(87, 136, 253, 0.12);
    color: #3454d1;
    padding: 0.22rem 0.38rem;
}

.notificacao-acao-arquivar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #7f8b99;
    background: #f8f9fb;
    border: 1px solid rgba(15, 23, 42, 0.08);
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.notificacao-acao-arquivar:hover {
    color: #3454d1;
    background: #edf2ff;
    border-color: rgba(52, 84, 209, 0.16);
}

.notificacao-acao-arquivar i {
    font-size: 0.78rem;
}

.notificacao-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.3rem;
}

.notificacao-modulo {
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: #2f6df6;
}

.notificacao-titulo {
    font-size: 0.84rem;
    font-weight: 600;
    color: #343a40;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
}

.notificacao-texto {
    margin-right: 0;
    font-size: 0.82rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.sem_notificacoes {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.6rem 1rem;
    color: #64748b;
    gap: 0.5rem;
}

.sem_notificacoes_icone {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(87, 136, 253, 0.15), rgba(42, 157, 143, 0.15));
    color: #5788fd;
    font-size: 1.25rem;
}

.sem_notificacoes_titulo {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1d2a38;
}

.sem_notificacoes_texto {
    font-size: 0.84rem;
    max-width: 280px;
}

.dropdown_notificacoes {
    width: 460px !important;
    max-width: min(90vw, 460px);
    border: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown_notificacoes .dropdown-header {
    padding: 0.7rem 0.9rem;
    font-size: 0.78rem;
}

.notificacoes-cabecalho {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: left;
}

.notificacoes-acao-header {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 !important;
    border: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: #3454d1;
    text-decoration: none;
    white-space: nowrap;
}

.notificacoes-acao-header:hover,
.notificacoes-acao-header:focus {
    color: #2743a6;
    text-decoration: none;
}

.notificacoes-acao-header.disabled,
.notificacoes-acao-header:disabled {
    color: #adb5bd;
    pointer-events: none;
}

.dropdown_notificacoes .lista_notificacoes {
    max-height: min(60vh, 520px) !important;
}

.dropdown_notificacoes .dropdown-divider {
    margin: 0;
}

@media (max-width: 767px) {
    .dropdown_notificacoes {
        width: min(94vw, 360px) !important;
    }

    .notificacoes-cabecalho {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .notificacao-layout {
        padding: 0.72rem 0.8rem;
    }

    .notificacao-avatar,
    .notificacao-avatar-fallback {
        width: 34px;
        height: 34px;
    }

    .notificacao-autor {
        font-size: 0.9rem;
    }

    .notificacao-meta {
        gap: 0.28rem;
    }

    .notificacao-titulo {
        font-size: 0.8rem;
    }

    .notificacao-texto {
        font-size: 0.78rem;
    }
}

.toast-custom {
    margin-top: 50px !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2) !important;
    padding: 0 !important;
}

.notificacao-toast {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    text-align: left;
}

.notificacao-toast-persona {
    position: relative;
    flex-shrink: 0;
}

.notificacao-toast-avatar,
.notificacao-toast-fallback {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #264653, #5788fd);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.notificacao-toast-icon {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
}

.notificacao-toast-text {
    min-width: 0;
}

.notificacao-toast-modulo {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5788fd;
    margin-bottom: 0.1rem;
}

.notificacao-toast-autor {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1d2a38;
    margin-bottom: 0.12rem;
}

.notificacao-toast-mensagem {
    font-size: 0.85rem;
    line-height: 1.45;
    color: #526071;
}

.botao_acao {
    border-radius: 10px;
    padding: 0 1.125rem;
    border: none;
    height: 2rem;
    will-change: auto;
    background: white;
    background-color: #5788fd;
    color: white;
}

.botao_acao:hover {
    border-radius: 10px;
    padding: 0 1.125rem;
    border: none;
    height: 2rem;
    will-change: auto;
    background: white;
    background-color: gray;
    color: white;
}

.botao_voltar_acao {
    border-radius: 10px;
    padding: 0 1.125rem;
    border: none;
    height: 2rem;
    will-change: auto;
    background: white;
    background-color: #fc1010;
    color: white;
}

.botao_acao_ganhar {
    border-radius: 10px;
    padding: 0 1.125rem;
    border: none;
    height: 2rem;
    will-change: auto;
    background: white;
    background-color: #10C971;
    color: white;
}

#sidebar-wrapper {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 450px;
    background: #343a40;
    color: #f0f0f0;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #333;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
}

#sidebar-wrapper.toggled {
    transform: translateX(0);
}

.sidebar-header {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #333;
}

.sidebar-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.sidebar-scrollable::-webkit-scrollbar {
    width: 8px;
}

.sidebar-scrollable::-webkit-scrollbar-track {
    background: #1e1e26;
}

.sidebar-scrollable::-webkit-scrollbar-thumb {
    background-color: #4a4a58;
    border-radius: 10px;
    border: 2px solid #343a40;
}

.sidebar-footer {
    position: sticky;
    bottom: 0;
    background: #343a40;
    padding: 1.5rem;
    border-top: 1px solid #333;
    z-index: 10;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sidebar-wrapper .botao_acao {
    border-radius: 8px;
    border: none;
    height: auto;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

#sidebar-wrapper #filtrar {
    background-color: #5788fd;
    color: white;
}

#sidebar-wrapper #filtrar:hover {
    background-color: #4a78e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(87, 136, 253, 0.3);
}

#sidebar-wrapper #salvar_filtro:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#fechar_filtro {
    background: transparent;
    border: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    z-index: 9999;
}

#fechar_filtro:hover {
    opacity: 1;
}

.tooltip {
    top: 0;
}

.snowfall-flakes {
    position: fixed !important;
}

.campo-senior {
    text-transform: uppercase;
}

select[readonly] {
    background: #eee;
    pointer-events: none;
    touch-action: none;
    user-select: none;
}

.modal-xxl {
    max-width: 90%;
    margin: 1.75rem auto;
}

@media (min-width: 576px) {
    .modal-xxl {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .modal-xxl {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .modal-xxl {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .modal-xxl {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .modal-xxl {
        max-width: 1400px;
    }
}

@media (max-width: 576px) {
    #sidebar-wrapper {
        width: 100%;
        border-left: none;
        top: 0;
        height: 100vh;
    }
}

#sidebar-wrapper .card {
    color: #212529;
}

.badge-orange {
    background-color: rgb(255, 123, 0);
    color: white;
}

.w-35{
    width: 35% !important;
}

.mb-3-5 {
    margin-bottom: 0.87rem !important;
}

/* Submenu aberto (treeview): fundo destacado pra agrupar os itens, nos DOIS
   modos. O background vai junto das regras mais específicas (mesma
   especificidade da linha-guia, que já funciona) pra não ser sobrescrito pelo
   CSS do AdminLTE. */
/* Sidebar expandida: fundo + linha-guia vertical + indentação. */
body:not(.sidebar-collapse) .nav-sidebar .nav-treeview {
    background-color: rgba(255, 255, 255, 0.1) !important;
    margin-left: 1rem;
    border-left: 2px solid rgba(255, 255, 255, 0.15);
}
body:not(.sidebar-collapse) .nav-sidebar .nav-treeview > .nav-item > .nav-link {
    padding-left: 0.85rem;
}
/* Sidebar recolhida (mini): só o fundo (sem indentar, pra não desalinhar os ícones). */
body.sidebar-collapse .nav-sidebar .nav-treeview {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* card-header em flex: neutraliza o clearfix ::after do AdminLTE, que vira
   flex-item e empurra o conteúdo pro centro. Sem ele, justify-content-between
   funciona (título à esquerda, botão à direita) e align-items-center centraliza
   verticalmente o título e o botão. */
.card-header.d-flex::before,
.card-header.d-flex::after {
    display: none !important;
}
