html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
/* =========================================================
   CAÇA CHAT - VISUAL 2026
   ========================================================= */

:root {
    --caca-blue: #0878ff;
    --caca-blue-dark: #0563d8;
    --caca-navy: #111827;
    --caca-text: #111827;
    --caca-muted: #697386;
    --caca-border: #e3e8ef;
    --caca-bg: #f5f9ff;
    --caca-success: #18a558;
}

html, body {
    min-height: 100%;
}

body {
    background:
        radial-gradient(circle at 95% 4%, rgba(44,130,255,.12), transparent 28%),
        radial-gradient(circle at 4% 92%, rgba(44,130,255,.10), transparent 28%),
        #f8fbff;
    color: var(--caca-text);
}

.caca-navbar {
    background: linear-gradient(90deg, #171e27, #202832);
    min-height: 68px;
    box-shadow: 0 1px 10px rgba(0,0,0,.08);
}

.caca-navbar .navbar-brand {
    font-size: 1.35rem;
    font-weight: 800;
    color: white !important;
    letter-spacing: -.3px;
}

.caca-navbar .nav-link {
    color: #c9d1dc !important;
    font-weight: 500;
    padding: 1.35rem .8rem !important;
    position: relative;
}

.caca-navbar .nav-link:hover {
    color: white !important;
}

.caca-navbar .nav-link.active-page {
    color: white !important;
}

.caca-navbar .nav-link.active-page::after {
    content: "";
    position: absolute;
    left: .8rem;
    right: .8rem;
    bottom: 0;
    height: 3px;
    background: var(--caca-blue);
    border-radius: 3px 3px 0 0;
}

.caca-user {
    color: white;
    font-weight: 600;
}

.caca-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 34px 20px 60px;
}

/* LOGIN */

.login-shell {
    min-height: calc(100vh - 135px);
    display: flex;
    align-items: center;
}

.login-brand-icon {
    width: 88px;
    height: 68px;
    border-radius: 28px;
    background: linear-gradient(135deg, #0568e8, #268dff);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 35px rgba(8,120,255,.22);
    margin-bottom: 26px;
    position: relative;
}

.login-brand-icon::after {
    content: "";
    position: absolute;
    right: -23px;
    bottom: -7px;
    width: 54px;
    height: 41px;
    border-radius: 22px;
    background: #9dccff;
    z-index: -1;
}

.login-dots {
    display: flex;
    gap: 7px;
}

.login-dots span {
    width: 9px;
    height: 9px;
    background: white;
    border-radius: 50%;
}

.login-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1.7px;
    margin-bottom: 12px;
}

.login-hero .subtitle {
    font-size: 1.42rem;
    color: #49566b;
    max-width: 470px;
    line-height: 1.45;
}

.login-benefit {
    display: flex;
    gap: 16px;
    margin-top: 28px;
    align-items: flex-start;
}

.login-benefit-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 12px;
    background: #e9f3ff;
    color: var(--caca-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 700;
}

.login-benefit strong {
    display: block;
    font-size: 1rem;
}

.login-benefit small {
    color: var(--caca-muted);
}

.login-card {
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(226,232,240,.95);
    border-radius: 16px;
    padding: 38px;
    box-shadow: 0 18px 55px rgba(40,72,120,.12);
}

.login-card h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.7px;
}

.login-card .form-control {
    min-height: 52px;
    border-radius: 10px;
    border-color: #d7dee8;
}

.login-card .form-control:focus {
    border-color: var(--caca-blue);
    box-shadow: 0 0 0 .2rem rgba(8,120,255,.11);
}

.btn-caca {
    min-height: 52px;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(90deg, #0878ff, #0570ed);
    color: white;
    font-weight: 700;
    transition: .15s ease;
}

.btn-caca:hover {
    background: linear-gradient(90deg, #0569df, #055fcd);
    color: white;
    transform: translateY(-1px);
}

/* CONVERSAS */

.page-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 2px;
}

.page-subtitle {
    color: var(--caca-muted);
    font-size: 1.05rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--caca-border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(30,70,120,.06);
    height: 100%;
}

.stat-card-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 50%;
    background: #eaf4ff;
    color: var(--caca-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-label {
    color: #5e6b80;
    font-size: .95rem;
}

.stat-number {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -.8px;
}

.conversation-toolbar {
    background: white;
    border: 1px solid var(--caca-border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(30,70,120,.05);
}

.conversation-toolbar .form-control,
.conversation-toolbar .form-select {
    min-height: 47px;
    border-radius: 9px;
}

.conversation-card {
    background: white;
    border: 1px solid var(--caca-border);
    border-radius: 15px;
    padding: 22px;
    margin-bottom: 14px;
    box-shadow: 0 7px 24px rgba(30,70,120,.055);
    transition: .15s ease;
}

.conversation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(30,70,120,.10);
    border-color: #cbdcf2;
}

.conv-avatar {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 50%;
    background: #e7f2ff;
    color: var(--caca-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
}

.conv-title {
    font-weight: 800;
    font-size: 1.16rem;
}

.conv-info {
    color: #475569;
    font-size: .93rem;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.integrity-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #13a856;
    color: white;
    border-radius: 7px;
    padding: 5px 10px;
    font-size: .82rem;
    font-weight: 700;
}

.empty-conversations {
    background: white;
    border: 1px solid var(--caca-border);
    border-radius: 14px;
    text-align: center;
    padding: 55px 20px;
    color: var(--caca-muted);
}

@media (max-width: 991px) {
    .login-hero {
        display: none;
    }

    .login-shell {
        min-height: auto;
        padding: 45px 0;
    }

    .login-card {
        padding: 28px;
    }
}


/* =========================================================
   DASHBOARD INICIO
   ========================================================= */

.dashboard-action-card {
    background: white;
    border: 1px solid var(--caca-border);
    border-radius: 15px;
    padding: 26px;
    height: 100%;
    box-shadow: 0 8px 25px rgba(30,70,120,.055);
    transition: .15s ease;
}

.dashboard-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(30,70,120,.10);
}

.dashboard-action-icon {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    background: #eaf4ff;
    color: var(--caca-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 18px;
}

.dashboard-action-card h4 {
    font-size: 1.16rem;
    font-weight: 800;
    margin-bottom: 7px;
}

.dashboard-action-card p {
    color: var(--caca-muted);
    min-height: 48px;
}

.dashboard-section {
    background: rgba(255,255,255,.55);
    border: 1px solid var(--caca-border);
    border-radius: 16px;
    padding: 24px;
}

.dashboard-section h3 {
    font-size: 1.4rem;
    font-weight: 800;
}


/* =========================================================
   DETALHES DA CONVERSA
   ========================================================= */

.conversa-detalhes-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.conversa-topo {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px;
}

.conversa-voltar {
    color: var(--caca-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: .9rem;
}

.conversa-voltar:hover {
    text-decoration: underline;
}

.conversa-titulo {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.8px;
    margin: 6px 0 3px;
}

.conversa-subtitulo {
    color: var(--caca-muted);
}

.integridade-card {
    background: white;
    border: 1px solid var(--caca-border);
    border-radius: 15px;
    padding: 22px;
    box-shadow: 0 7px 24px rgba(30,70,120,.055);
    margin-bottom: 18px;
}

.integridade-titulo {
    color: #159447;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.integridade-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 30px;
}

.integridade-hash {
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid #edf0f4;
}

.integridade-hash small {
    display: block;
    color: var(--caca-muted);
    margin-bottom: 3px;
}

.integridade-hash code {
    color: #334155;
    font-size: .82rem;
    word-break: break-all;
}

.filtros-conversa-card {
    background: white;
    border: 1px solid var(--caca-border);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 7px 24px rgba(30,70,120,.05);
    margin-bottom: 16px;
}

.filtros-conversa-card .form-control,
.filtros-conversa-card .form-select {
    min-height: 45px;
    border-radius: 9px;
}

.selecao-toolbar {
    background: rgba(255,255,255,.72);
    border: 1px solid var(--caca-border);
    border-radius: 11px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

.chat-area {
    background: #f3efe8 !important;
    border: 1px solid #ebe5db;
    border-radius: 16px;
    padding: 18px !important;
}

.chat-area .msg {
    max-width: 78%;
    background: white;
    border: 1px solid #e5e9ef;
    border-radius: 13px;
    padding: 15px 16px !important;
    margin-bottom: 11px;
    box-shadow: 0 3px 10px rgba(15,23,42,.04);
    transition: .15s ease;
}

.chat-area .msg:hover {
    border-color: #bad5f7;
    box-shadow: 0 6px 16px rgba(30,70,120,.08);
}

.chat-area .msg:has(.msg-pdf-check:checked) {
    border: 2px solid var(--caca-blue);
    background: #f3f8ff;
}

.chat-area .msg-pdf-check {
    cursor: pointer;
}

.conversa-pdf-principal {
    border-radius: 9px;
    padding: 10px 20px;
    font-weight: 700;
}

@media (max-width: 767px) {

    .conversa-detalhes-page {
        padding: 20px 12px 40px;
    }

    .conversa-topo {
        flex-direction: column;
    }

    .integridade-grid {
        grid-template-columns: 1fr;
    }

    .chat-area .msg {
        max-width: 100%;
    }
}


/* =========================================================
   CAÇA CHAT - DETALHES FINAL
   ========================================================= */

/* centraliza SOMENTE a página que contém a conversa */
body:has(.chat-area) main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

/* evita blocos ocupando a tela inteira */
body:has(.chat-area) main > * {
    max-width: 100%;
}

/* título */
body:has(.chat-area) h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.7px;
    margin-top: 8px;
}

/* voltar */
body:has(.chat-area) a[href*="/Conversas"] {
    text-decoration: none;
}

/* card de integridade */
body:has(.chat-area) .integridade-card,
body:has(.chat-area) main > .card {
    background: #fff;
    border: 1px solid #e1e8f0;
    border-radius: 16px;
    box-shadow: 0 7px 22px rgba(30,70,120,.055);
}

/* deixa selo de verificação AZUL */
body:has(.chat-area) .text-success,
body:has(.chat-area) .integridade-titulo {
    color: #0878ff !important;
}

body:has(.chat-area) .bg-success,
body:has(.chat-area) .integrity-badge {
    background: #0878ff !important;
    color: #fff !important;
}

/* filtros */
body:has(.chat-area) .filtros-conversa-card,
body:has(.chat-area) div:has(> div #filtroTexto) {
    background: #fff;
    border: 1px solid #e1e8f0;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 7px 22px rgba(30,70,120,.05);
}

body:has(.chat-area) #filtroTexto,
body:has(.chat-area) #filtroRemetente,
body:has(.chat-area) #filtroDataInicial,
body:has(.chat-area) #filtroDataFinal {
    min-height: 46px;
    border-radius: 9px;
}

/* botões PDF deixam de ser vermelhos */
body:has(.chat-area) .btn-danger {
    background: #0878ff !important;
    border-color: #0878ff !important;
}

body:has(.chat-area) .btn-danger:hover {
    background: #0565d7 !important;
    border-color: #0565d7 !important;
}

/* área da conversa */
body:has(.chat-area) .chat-area {
    background: #eef4fb !important;
    border: 1px solid #dce7f5;
    border-radius: 18px;
    padding: 22px !important;
}

/* cartão de mensagem */
body:has(.chat-area) .chat-area .msg {
    max-width: 78%;
    background: #fff;
    border: 1px solid #dfe6ef;
    border-radius: 14px;
    margin-bottom: 12px;
    padding: 16px 18px !important;
    box-shadow: 0 3px 10px rgba(15,23,42,.045);
}

/* mensagem selecionada */
body:has(.chat-area) .chat-area .msg:has(.msg-pdf-check:checked) {
    background: #eef6ff !important;
    border: 2px solid #0878ff !important;
}

/* seleção */
body:has(.chat-area) .selecao-toolbar {
    background: #fff;
    border: 1px solid #e1e8f0;
    border-radius: 12px;
    padding: 11px 15px;
}

/* hashes menos chamativos */
body:has(.chat-area) code {
    color: #526176;
    font-size: .8rem;
    word-break: break-all;
}

/* logo navbar */
.caca-navbar-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
    display: block;
}

.caca-navbar-brand {
    display: flex;
    align-items: center;
    gap: 9px;
}

.caca-navbar-brand-text {
    color: white;
    font-size: 1.15rem;
    font-weight: 800;
}

/* cores GF4U azul */
:root {
    --caca-blue: #0878ff;
    --caca-blue-dark: #0563d8;
}

@media (max-width: 767px) {

    body:has(.chat-area) main {
        padding: 20px 12px 40px;
    }

    body:has(.chat-area) .chat-area .msg {
        max-width: 100%;
    }

}


/* Ajuste final da logo no topo */
.caca-navbar-logo {
    height: 46px !important;
    width: auto !important;
    max-width: 95px;
    object-fit: contain;
    filter: brightness(1.15) contrast(1.08);
}

.caca-navbar-brand {
    gap: 12px !important;
    padding-top: 6px;
    padding-bottom: 6px;
}

.caca-navbar-brand-text {
    font-size: 1.18rem !important;
    font-weight: 800;
}



/* ===== Logo CAÇA Chat ===== */
.caca-brand{
    display:flex;
    align-items:center;
    gap:10px;
    text-decoration:none;
}

.caca-brand-logo{
    height:32px;
    width:auto;
    max-width:120px;
    object-fit:contain;
    display:block;
}

.caca-brand-text{
    font-weight:700;
    font-size:1.05rem;
    color:#ffffff;
    line-height:1;
    white-space:nowrap;
}

@media (max-width: 768px){
    .caca-brand-logo{
        height:26px;
        max-width:90px;
    }

    .caca-brand-text{
        font-size:0.95rem;
    }
}

/* filtros compactos da conversa */

.filtros-conversa-card {
    padding: 20px !important;
}

.filtros-conversa-card .form-control,
.filtros-conversa-card .form-select,
.filtros-conversa-card .btn {
    min-height: 44px;
}

.filtro-anexo-check {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 1.6rem;
}

@media (max-width: 991px) {
    .filtro-anexo-check {
        min-height: auto;
        padding-top: 8px;
        padding-bottom: 8px;
    }
}


/* =========================================================
   CONVERSA - APROVEITAR MELHOR A TELA
   ========================================================= */

/* página de detalhes mais larga */
body:has(.chat-area) main {
    width: calc(100% - 48px) !important;
    max-width: 1500px !important;
    margin: 0 auto !important;
    padding: 28px 0 55px !important;
}

/* container principal da conversa */
.conversa-detalhes-page {
    width: 100% !important;
    max-width: 1500px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* área azul onde ficam as mensagens */
body:has(.chat-area) .chat-area {
    width: 100% !important;
    max-width: none !important;
    padding: 18px !important;
}

/* mensagens aproveitam toda a área */
body:has(.chat-area) .chat-area .msg {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* integridade, identificação e filtros na largura disponível */
body:has(.chat-area) .integridade-card,
body:has(.chat-area) .filtros-conversa-card,
body:has(.chat-area) .selecao-toolbar {
    width: 100% !important;
    max-width: none !important;
}

/* desktop muito largo */
@media (min-width: 1600px) {
    body:has(.chat-area) main {
        max-width: 1540px !important;
    }

    .conversa-detalhes-page {
        max-width: 1540px !important;
    }
}

/* celular */
@media (max-width: 767px) {
    body:has(.chat-area) main {
        width: calc(100% - 20px) !important;
        padding-top: 18px !important;
    }
}


/* =========================================================
   BALÕES DE CHAT
   ========================================================= */

body:has(.chat-area) .chat-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #edf4fc !important;
}

/* volta a usar largura confortável para leitura */
body:has(.chat-area) .chat-area .msg {
    width: auto !important;
    max-width: 74% !important;
    min-width: 280px;
    margin-bottom: 0 !important;
    padding: 14px 16px 12px !important;
    border-radius: 15px !important;
}

/* contato / outra pessoa */
body:has(.chat-area) .chat-area .msg-contato {
    align-self: flex-start;
    background: #ffffff !important;
    border-bottom-left-radius: 5px !important;
}

/* usuário do CAÇA Chat */
body:has(.chat-area) .chat-area .msg-eu {
    align-self: flex-end;
    background: #e5f1ff !important;
    border-color: #c7ddfa !important;
    border-bottom-right-radius: 5px !important;
}

/* remetente */
body:has(.chat-area) .msg strong,
body:has(.chat-area) .msg a:first-child {
    font-weight: 700;
}

/* checkbox não interfere visualmente no balão */
body:has(.chat-area) .msg .msg-pdf-check {
    margin-right: 3px;
}

/* selecionada */
body:has(.chat-area) .chat-area .msg:has(.msg-pdf-check:checked) {
    border: 2px solid #0878ff !important;
    box-shadow: 0 5px 18px rgba(8,120,255,.14);
}

/* imagem dentro da mensagem */
body:has(.chat-area) .msg img {
    max-width: min(100%, 520px);
    height: auto;
    border-radius: 10px;
}

/* áudio e vídeo */
body:has(.chat-area) .msg audio,
body:has(.chat-area) .msg video {
    max-width: 100%;
}

/* celular */
@media (max-width: 767px) {
    body:has(.chat-area) .chat-area .msg {
        max-width: 92% !important;
        min-width: 0;
    }
}


/* =========================================================
   INTEGRIDADE RECOLHÍVEL
   ========================================================= */

.integridade-card.integridade-compacta {
    padding: 0 !important;
    overflow: hidden;
}

.integridade-resumo {
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    background: #f8fbff;
}

.integridade-resumo:hover {
    background: #f2f7fd;
}

.integridade-resumo-principal {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    color: #0878ff;
}

.integridade-status-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #0878ff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
}

.integridade-resumo-dados {
    color: #596579;
    font-size: .9rem;
}

.integridade-toggle {
    border: 0;
    background: transparent;
    color: #0878ff;
    font-weight: 600;
    white-space: nowrap;
}

.integridade-conteudo {
    padding: 17px 18px;
    border-top: 1px solid #e5ebf2;
}

.integridade-conteudo.integridade-fechada {
    display: none;
}


/* =========================================================
   SELEÇÃO PARA PDF - SÓ QUANDO ATIVADA
   ========================================================= */

.msg .msg-pdf-check,
.msg label:has(.msg-pdf-check),
.selecao-toolbar {
    display: none !important;
}

body.modo-selecao-pdf .msg .msg-pdf-check {
    display: inline-block !important;
}

body.modo-selecao-pdf .msg label:has(.msg-pdf-check) {
    display: inline-flex !important;
}

body.modo-selecao-pdf .selecao-toolbar {
    display: flex !important;
}

body.modo-selecao-pdf .msg {
    cursor: pointer;
}

#btnAtivarSelecaoPdf {
    border-radius: 8px;
}


/* Corrige exibição dos controles de seleção PDF */

.selecao-toolbar {
    display: none !important;
}

body.modo-selecao-pdf .selecao-toolbar {
    display: flex !important;
}

body:not(.modo-selecao-pdf) .msg-pdf-check {
    display: none !important;
}

body.modo-selecao-pdf .msg-pdf-check {
    display: inline-block !important;
}


/* Estado normal: somente botão para iniciar seleção */
body:not(.modo-selecao-pdf) button[onclick="sairModoSelecaoPdf()"] {
    display: none !important;
}

body:not(.modo-selecao-pdf) .msg-pdf-check,
body:not(.modo-selecao-pdf) label:has(.msg-pdf-check) {
    display: none !important;
}

/* Estado de seleção */
body.modo-selecao-pdf #btnAtivarSelecaoPdf {
    display: none !important;
}

body.modo-selecao-pdf button[onclick="sairModoSelecaoPdf()"] {
    display: inline-block !important;
}

body.modo-selecao-pdf .msg-pdf-check {
    display: inline-block !important;
}

body.modo-selecao-pdf label:has(.msg-pdf-check) {
    display: inline-flex !important;
}


/* =========================================================
   AJUSTES FINAIS DO CHAT
   ========================================================= */

/* reduz espaço entre balões */
body:has(.chat-area) .chat-area {
    gap: 7px !important;
}

/* mensagem de sistema */
body:has(.chat-area) .chat-area .msg-sistema {
    align-self: center !important;
    width: auto !important;
    max-width: 76% !important;

    background: rgba(255,255,255,.65) !important;
    border: 1px solid #d6e0ec !important;

    color: #667085 !important;

    text-align: center;

    border-radius: 20px !important;

    padding: 8px 16px !important;

    box-shadow: none !important;

    font-size: .82rem;
}

/* não destacar remetente em mensagem de sistema */
body:has(.chat-area) .msg-sistema strong,
body:has(.chat-area) .msg-sistema a:first-child {
    color: #667085 !important;
    font-weight: 600 !important;
}

/* horário da mensagem de sistema */
body:has(.chat-area) .msg-sistema {
    opacity: .88;
}

/* mensagens normais ficam um pouco mais compactas */
body:has(.chat-area) .chat-area .msg-contato,
body:has(.chat-area) .chat-area .msg-eu {
    margin-top: 1px !important;
}

/* mais espaço só quando muda bastante o fluxo visual */
body:has(.chat-area) .chat-area .msg + .msg {
    margin-top: 2px !important;
}


/* =========================================================
   AVISOS DO WHATSAPP - VISUAL FINAL
   ========================================================= */

body:has(.chat-area) .chat-area .msg.msg-sistema {
    align-self: center !important;

    width: auto !important;
    min-width: 0 !important;
    max-width: 72% !important;

    margin: 8px auto !important;
    padding: 7px 16px !important;

    background: #dfe9f4 !important;
    border: 0 !important;
    border-radius: 18px !important;

    box-shadow: none !important;

    color: #667085 !important;
    text-align: center !important;
    font-size: .80rem !important;
}

/* horário do aviso também discreto */
body:has(.chat-area) .chat-area .msg.msg-sistema * {
    color: #667085 !important;
}


/* =========================================================
   AVISO DE SISTEMA WHATSAPP - DEFINITIVO
   ========================================================= */

.caca-aviso-sistema {
    align-self: center;
    max-width: 72%;
    margin: 10px auto;
    padding: 8px 15px;

    background: #dfe8f2;
    border-radius: 18px;

    color: #657286;
    text-align: center;
    font-size: .82rem;
    line-height: 1.35;

    box-shadow: none;
}

.caca-aviso-sistema small {
    display: block;
    margin-top: 3px;
    color: #8a96a7;
    font-size: .70rem;
}

@media (max-width: 767px) {
    .caca-aviso-sistema {
        max-width: 94%;
    }
}


/* =========================================================
   ABAS DE MÍDIA
   ========================================================= */

.caca-midia-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin: 14px 0 12px;
    padding: 7px;

    background: #ffffff;
    border: 1px solid #dde6f0;
    border-radius: 13px;

    box-shadow: 0 4px 15px rgba(30,70,120,.045);
}

.caca-midia-tab {
    border: 0;
    background: transparent;

    padding: 9px 15px;

    border-radius: 9px;

    color: #526176;

    font-weight: 600;

    transition: .15s ease;
}

.caca-midia-tab:hover {
    background: #eef5ff;
    color: #0878ff;
}

.caca-midia-tab.active {
    background: #0878ff;
    color: #ffffff;
}

.caca-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 21px;
    height: 21px;

    margin-left: 5px;
    padding: 0 6px;

    border-radius: 20px;

    background: rgba(0,0,0,.08);

    font-size: .72rem;
}

.caca-midia-tab.active .caca-tab-count {
    background: rgba(255,255,255,.22);
}

.caca-midia-painel {
    width: 100%;

    margin-bottom: 14px;
    padding: 18px;

    background: #eef4fb;

    border: 1px solid #dae6f4;
    border-radius: 16px;
}

/* GALERIA DE FOTOS */

.caca-galeria-fotos {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(180px, 1fr));

    gap: 14px;
}

.caca-galeria-item {
    position: relative;

    background: #ffffff;

    border: 1px solid #dfe6ef;
    border-radius: 12px;

    overflow: hidden;

    box-shadow: 0 4px 13px rgba(30,70,120,.06);
}

.caca-galeria-item img {
    display: block;

    width: 100%;
    height: 180px;

    object-fit: cover;

    cursor: pointer;
}

.caca-galeria-meta {
    padding: 9px 10px;

    color: #657286;

    font-size: .76rem;
}

/* ÁUDIO */

.caca-audio-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.caca-audio-item {
    background: white;

    border: 1px solid #dfe6ef;
    border-radius: 12px;

    padding: 14px;
}

.caca-audio-item audio {
    width: 100%;
}

/* DOCUMENTOS */

.caca-documentos-lista {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.caca-documento-item {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 15px;

    padding: 13px 15px;

    background: #ffffff;

    border: 1px solid #dfe6ef;
    border-radius: 11px;
}

.caca-documento-nome {
    font-weight: 600;
}

/* VÍDEOS */

.caca-videos-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(320px, 1fr));

    gap: 15px;
}

.caca-video-item {
    padding: 12px;

    background: white;

    border: 1px solid #dfe6ef;
    border-radius: 12px;
}

.caca-video-item video {
    display: block;

    width: 100%;
    max-height: 420px;

    border-radius: 8px;
}

/* estado vazio */

.caca-midia-vazio {
    text-align: center;

    padding: 42px 20px;

    color: #748095;
}

@media (max-width: 767px) {

    .caca-midia-tabs {
        gap: 4px;
    }

    .caca-midia-tab {
        padding: 8px 10px;
        font-size: .86rem;
    }

    .caca-galeria-fotos {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .caca-galeria-item img {
        height: 140px;
    }

}


/* Importação em lote */

.importacao-resultado {
    display: flex;
    align-items: center;
    gap: 15px;

    padding: 14px 16px;
    margin-bottom: 9px;

    border-radius: 11px;
    border: 1px solid #e1e7ef;
}

.importacao-ok {
    background: #f3f9ff;
    border-color: #cce1fa;
}

.importacao-erro {
    background: #fff8f3;
    border-color: #f2d8c5;
}


/* =========================================================
   PROGRESSO DE IMPORTAÇÃO
   ========================================================= */

.caca-upload-progress {
    margin-top: 20px;
    margin-bottom: 18px;
    padding: 16px;

    background: #f4f8fd;
    border: 1px solid #d8e5f5;
    border-radius: 12px;
}

.caca-upload-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 15px;
    margin-bottom: 10px;

    color: #172235;
}

.caca-upload-barra {
    width: 100%;
    height: 14px;

    overflow: hidden;

    background: #dbe6f2;
    border-radius: 999px;
}

.caca-upload-barra-interna {
    height: 100%;

    background: #0878ff;
    border-radius: 999px;

    transition: width .2s ease;
}

.caca-upload-detalhe {
    margin-top: 9px;

    color: #66768c;
    font-size: .87rem;
}

.caca-processando-spinner {
    display: inline-block;

    width: 14px;
    height: 14px;

    margin-right: 7px;

    border: 2px solid #c6d8ec;
    border-top-color: #0878ff;
    border-radius: 50%;

    vertical-align: -2px;

    animation: caca-spin .75s linear infinite;
}

@keyframes caca-spin {
    to {
        transform: rotate(360deg);
    }
}


/* Miniaturas reais dos vídeos */

.caca-video-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 12px;
    background: #111;
}

.caca-video-preview {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #111;
    pointer-events: none;
}

.caca-video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.caca-video-overlay span {
    display: flex;
    width: 52px;
    height: 52px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, .60);
    color: white;
    font-size: 24px;
    padding-left: 3px;
}

.caca-video-nome {
    padding: 8px 10px;
    background: white;
    font-size: .82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* CAÇA Chat - modal de exclusão sempre acima do backdrop */
#excluirConversaModal {
    z-index: 20050 !important;
}

#excluirConversaModal .modal-dialog {
    position: relative;
    z-index: 20051 !important;
}

.modal-backdrop {
    z-index: 20000 !important;
}

