/* ============================
   MAIS POLÍMEROS
   CHAT AO VIVO
   ============================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {

    /* Cores principais */
    --navy: #1D1D3C;
    --navy-light: #28224F;

    --blue: #27348B;

    --teal: #3193A3;
    --teal-light: #4AB9B0;

    /* Apoio */
    --orange: #EF6B07;
    --yellow: #FFD407;
    --red: #D10000;

    /* Neutras */
    --white: #FFFFFF;
    --gray-50: #FAFAFA;
    --gray-100: #F6F6F6;
    --gray-150: #F1F1F1;
    --gray-200: #E9E9E9;
    --gray-300: #D1D1D1;
    --gray-500: #909090;
    --gray-700: #555555;

    --green: #14c737;

    --sidebar-width: 215px;
    --list-width: 340px;
    --contact-width: 350px;
}

body {
    font-family: "DIN Round Pro", Calibri, Arial, sans-serif;
    background: var(--gray-100);
    color: var(--navy);
    height: 100vh;
    overflow: hidden;
}

button,
input,
textarea {
    font-family: inherit;
}


/* ============================
   APP
   ============================ */

.app {
    height: 100vh;
    display: flex;
}


/* ============================
   SIDEBAR
   ============================ */

.sidebar {

    width: var(--sidebar-width);
    flex-shrink: 0;

    background:
        linear-gradient(
            165deg,
            #111136 0%,
            var(--navy) 55%,
            #161543 100%
        );

    color: white;

    display: flex;
    flex-direction: column;

    padding: 25px 14px;

    position: relative;

    overflow: hidden;
}


/* =========================================
   GRAFISMO ATRÁS DO BOTÃO AJUDA
   ========================================= */

.sidebar {
    position: relative;
    overflow: hidden;
}


/* remove qualquer grafismo antigo criado pelo CSS */
.sidebar::after,
.sidebar::before {
    display: none !important;
}


/* imagem real do grafismo */
.sidebar-brand-shape {
    position: absolute;

    /* posição */
    right: -8px;
    bottom: 82px;
    width: 185px;

    /* tamanho */
    width: 185px;
    height: auto;

    object-fit: contain;

    /* fica atrás de Ajuda/Sair */
    z-index: 1;

    pointer-events: none;
    user-select: none;
}


/* menu normal acima da imagem */
.sidebar .logo,
.sidebar .menu {
    position: relative;
    z-index: 3;
}


/* Ajuda e Sair ficam na frente da imagem */
.sidebar-bottom {
    position: relative;
    z-index: 5;

    margin-top: auto;

    display: flex;
    flex-direction: column;
    gap: 20px;

    padding: 12px 14px 3px;
}


/* botões transparentes para o grafismo aparecer atrás */
.bottom-item {
    position: relative;

    z-index: 6;

    display: flex;
    align-items: center;
    gap: 13px;

    border: none;

    background: transparent;

    color: #FFFFFF;

    font-size: 14px;
    font-weight: 500;

    cursor: pointer;
}

/* =========================
   LOGO MAIS POLÍMEROS
   ========================= */

.logo {
    width: 100%;
    height: 90px;

    display: flex;
    align-items: flex-start;
    justify-content: flex-start;

    padding: 5px 10px 0 15px;
    margin-bottom: 40px;

    position: relative;
    z-index: 5;
}

.logo-img {
    width: 140px;
    height: auto;

    display: block;
    object-fit: contain;
}

/* MENU */

.menu {

    display: flex;

    flex-direction: column;

    gap: 12px;
}


.menu-item {

    width: 100%;

    border: 0;

    background: transparent;

    color: #ffffff;

    height: 50px;

    border-radius: 26px;

    padding: 0 15px;

    display: flex;

    align-items: center;

    gap: 14px;

    font-size: 14px;

    cursor: pointer;

    text-align: left;

    transition: .2s;
}


.menu-item:hover {

    background:
        rgba(
            255,
            255,
            255,
            .08
        );
}


.menu-item.active {

    background:
        linear-gradient(
            90deg,
            #247e9d,
            var(--teal)
        );

    box-shadow:
        0 5px 18px
        rgba(49, 147, 163, .3);
}


.menu-item .icon {

    width: 25px;

    text-align: center;

    font-size: 20px;
}


.badge-orange {

    margin-left: auto;

    background: var(--orange);

    color: white;

    min-width: 22px;

    height: 22px;

    border-radius: 12px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 11px;

    font-weight: 700;
}


.sidebar-bottom {

    margin-top: auto;

    display: flex;

    flex-direction: column;

    gap: 20px;

    padding: 15px;
}


.bottom-item {

    position: relative;

    z-index: 2;

    border: none;

    background: transparent;

    color: white;

    display: flex;

    align-items: center;

    gap: 15px;

    font-size: 14px;

    cursor: pointer;
}


.bottom-item span {

    font-size: 22px;

    width: 25px;
}


/* ============================
   MAIN
   ============================ */

.main {

    flex: 1;

    min-width: 0;

    height: 100vh;

    display: flex;

    flex-direction: column;
}


/* ============================
   TOPBAR
   ============================ */

.topbar {

    height: 82px;

    flex-shrink: 0;

    background: white;

    border-bottom:
        1px solid var(--gray-200);

    padding: 0 35px;

    display: flex;

    align-items: center;

    justify-content: space-between;
}


.topbar h1 {

    font-size: 28px;

    font-weight: 700;

    color: var(--navy);
}


.user-area {

    display: flex;

    align-items: center;

    gap: 12px;
}


.notification {

    position: relative;

    border: 0;

    background: transparent;

    color: var(--navy);

    font-size: 24px;

    cursor: pointer;
}


.notification span {

    position: absolute;

    right: 0;

    top: 1px;

    width: 8px;

    height: 8px;

    background: var(--teal);

    border-radius: 50%;
}


.user-avatar {

    width: 44px;

    height: 44px;

    border-radius: 50%;

    display: flex;

    align-items: center;

    justify-content: center;

    background: var(--navy);

    color: white;

    font-weight: bold;
}


.user-info {

    display: flex;

    flex-direction: column;
}


.user-info strong {

    font-size: 14px;
}


.user-info small {

    color: var(--gray-500);
}


.arrow {

    border: none;

    background: transparent;

    cursor: pointer;

    color: var(--navy);
}


/* ============================
   LAYOUT CHAT
   ============================ */

.chat-layout {

    flex: 1;

    min-height: 0;

    display: grid;

    grid-template-columns:
        var(--list-width)
        minmax(400px, 1fr)
        var(--contact-width);

    background: white;
}


/* ============================
   CONVERSATION PANEL
   ============================ */

.conversation-panel {

    border-right:
        1px solid var(--gray-200);

    min-width: 0;

    display: flex;

    flex-direction: column;

    background: white;
}


.conversation-tools {

    height: 78px;

    display: flex;

    align-items: center;

    justify-content: space-around;

    padding: 0 18px;
}


.tool {

    width: 42px;

    height: 42px;

    border: 0;

    background: transparent;

    border-radius: 10px;

    font-size: 19px;

    color: var(--navy);

    cursor: pointer;

    position: relative;
}


.tool:hover {

    background: var(--gray-100);
}


.tool.active {

    background: var(--navy);

    color: white;
}


.tool-badge {

    position: absolute;

    top: -3px;

    right: -3px;

    background: var(--teal);

    color: white;

    border-radius: 10px;

    padding: 2px 5px;

    font-size: 9px;
}


/* SEARCH */

.search-container {

    position: relative;

    height: 50px;

    margin: 0 20px 15px;

    border:
        1px solid var(--gray-200);

    border-radius: 10px;

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 0 14px;
}


.search-container > span {

    font-size: 25px;

    color: var(--navy);
}


.search-container input {

    flex: 1;

    border: none;

    outline: none;

    font-size: 14px;

    min-width: 0;
}


.search-container button {

    border: none;

    background: transparent;

    color: var(--navy);

    cursor: pointer;

    font-size: 17px;
}


/* LIST */

.conversation-list {

    flex: 1;

    overflow-y: auto;
}


.conversation {

    min-height: 105px;

    margin: 0;

    padding: 18px 20px;

    border-bottom:
        1px solid var(--gray-200);

    display: flex;

    gap: 13px;

    cursor: pointer;

    position: relative;

    transition: .2s;
}


.conversation:hover {

    background: var(--gray-50);
}


.conversation.active {

    background:
        linear-gradient(
            90deg,
            rgba(49,147,163,.12),
            rgba(74,185,176,.05)
        );
}


.avatar {

    width: 50px;

    height: 50px;

    flex-shrink: 0;

    border-radius: 50%;

    background: var(--gray-200);

    color: var(--gray-700);

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 23px;

    position: relative;
}


.status {

    position: absolute;

    width: 12px;

    height: 12px;

    border-radius: 50%;

    right: 0;

    bottom: 0;

    border: 2px solid white;
}


.status.online {

    background: var(--green);
}


.channel {

    position: absolute;

    width: 15px;

    height: 15px;

    right: -2px;

    bottom: -1px;

    border-radius: 50%;
}


.channel.orange {

    background: var(--orange);
}


.conversation-data {

    flex: 1;

    min-width: 0;
}


.conversation-title {

    display: flex;

    justify-content: space-between;

    gap: 10px;

    margin-bottom: 5px;
}


.conversation-title strong {

    font-size: 14px;

    color: #19192d;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}


.conversation-title time {

    color: var(--gray-500);

    font-size: 11px;

    white-space: nowrap;
}


.conversation p {

    color: #858585;

    font-size: 12px;

    margin-bottom: 7px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


.tag {

    display: inline-block;

    background: var(--teal);

    color: white;

    padding: 3px 10px;

    border-radius: 10px;

    font-size: 9px;

    font-weight: bold;
}


.unread {

    position: absolute;

    right: 19px;

    top: 53px;

    background: var(--teal);

    color: white;

    border-radius: 5px;

    min-width: 18px;

    height: 18px;

    display: flex;

    justify-content: center;

    align-items: center;

    font-size: 10px;
}


/* ============================
   CHAT AREA
   ============================ */

.chat-area {

    min-width: 0;

    display: flex;

    flex-direction: column;

    background: #fff;
}


.chat-header {

    min-height: 87px;

    padding: 0 28px;

    border-bottom:
        1px solid var(--gray-200);

    display: flex;

    align-items: center;

    justify-content: space-between;
}


.chat-person {

    display: flex;

    align-items: center;

    gap: 14px;
}


.chat-person > div:last-child {

    display: flex;

    flex-direction: column;

    gap: 3px;
}


.chat-person small {

    color: var(--gray-500);
}


.chat-actions {

    display: flex;

    gap: 10px;
}


.chat-actions button {

    width: 40px;

    height: 40px;

    background: transparent;

    border: none;

    border-radius: 50%;

    color: var(--navy);

    cursor: pointer;

    font-size: 19px;
}


.chat-actions button:hover {

    background: var(--gray-100);
}


/* MENSAGENS */

.messages {

    flex: 1;

    min-height: 0;

    overflow-y: auto;

    padding: 20px 28px;

    background:
        linear-gradient(
            rgba(255,255,255,.97),
            rgba(255,255,255,.97)
        );
}


.date-divider {

    width: fit-content;

    margin: 0 auto 20px;

    border:
        1px solid var(--gray-200);

    padding: 7px 18px;

    border-radius: 9px;

    color: var(--gray-500);

    font-size: 11px;

    background: white;
}


.message {

    display: flex;

    margin-bottom: 20px;
}


.message.client {

    justify-content: flex-start;
}


.message.attendant {

    justify-content: flex-end;
}


.bubble {

    max-width: 65%;

    padding: 14px 17px 20px;

    border-radius: 14px;

    font-size: 13px;

    line-height: 1.55;

    position: relative;
}


.client .bubble {

    background: var(--gray-150);

    color: #555;
}


.attendant .bubble {

    background:
        linear-gradient(
            135deg,
            var(--navy-light),
            var(--navy)
        );

    color: white;
}


.message-time {

    float: right;

    margin-left: 20px;

    margin-top: 7px;

    font-size: 9px;

    opacity: .75;
}


/* ESTOQUE */

.stock-card {

    min-width: 230px;

    border-radius: 14px;

    background: var(--gray-100);

    padding: 17px;

    position: relative;

    display: flex;

    flex-direction: column;

    gap: 3px;
}


.stock-card > strong {

    font-size: 14px;
}


.stock-card > b {

    font-size: 12px;
}


.stock-content {

    display: flex;

    align-items: center;

    gap: 12px;

    margin-top: 12px;
}


.stock-icon {

    width: 30px;

    height: 30px;

    display: flex;

    justify-content: center;

    align-items: center;

    border: 1px solid var(--gray-300);

    border-radius: 8px;
}


.stock-content > div:last-child {

    display: flex;

    flex-direction: column;

    gap: 3px;
}


.stock-content small {

    color: var(--teal);

    font-size: 10px;
}


.stock-content strong {

    color: var(--teal);

    font-size: 16px;
}


.stock-time {

    position: absolute;

    right: 10px;

    bottom: 8px;

    color: var(--gray-500);

    font-size: 9px;
}


/* ============================
   INPUT
   ============================ */

.message-input {

    min-height: 75px;

    margin: 0 20px 20px;

    border:
        1px solid var(--gray-200);

    border-radius: 10px;

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 8px 10px;

    background: white;
}


.message-input textarea {

    flex: 1;

    resize: none;

    border: 0;

    outline: 0;

    padding: 10px;

    font-size: 13px;

    max-height: 120px;
}


.attach,
.emoji {

    border: none;

    background: transparent;

    font-size: 20px;

    cursor: pointer;

    color: var(--navy);
}


.send {

    width: 47px;

    height: 47px;

    border-radius: 50%;

    border: none;

    background: var(--navy);

    color: white;

    font-size: 20px;

    cursor: pointer;

    transition: .2s;
}


.send:hover {

    background: var(--teal);

    transform: scale(1.05);
}


/* ============================
   CONTACT
   ============================ */

.contact-panel {

    min-width: 0;

    border-left:
        1px solid var(--gray-200);

    overflow-y: auto;

    background: white;

    padding: 20px 25px;
}


.contact-header {

    text-align: center;

    position: relative;

    padding-top: 15px;

    padding-bottom: 20px;
}


.contact-background-symbol {

    position: absolute;

    right: 0;

    top: -30px;

    font-size: 180px;

    line-height: 1;

    color: rgba(49,147,163,.08);

    font-weight: bold;

    pointer-events: none;
}


.contact-avatar {

    width: 72px;

    height: 72px;

    margin: auto;

    border-radius: 50%;

    background: var(--gray-200);

    display: flex;

    align-items: center;

    justify-content: center;

    color: #333;

    font-size: 30px;

    position: relative;

    z-index: 1;
}

/* =========================================
   PAINEL DO CONTATO
   ========================================= */

    .contact-header {
    position: relative;
    overflow: hidden;

    min-height: 250px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    text-align: center;

    padding-top: 24px;
    padding-bottom: 20px;
}


/* símbolo da Mais Polímeros ao fundo */
.contact-background-symbol {
    position: absolute;

    top: 16px;
    right: 22px;

    width: 108px;
    height: auto;

    opacity: 0.10;

    z-index: 0;

    pointer-events: none;
}


/* avatar acima do símbolo */
.contact-avatar {
    width: 88px;
    height: 88px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #E9E9E9;
    color: #2A2A2A;

    font-size: 28px;
    font-weight: 400;

    position: relative;
    z-index: 3;

    margin-bottom: 16px;
}


/* nome, selo e botões acima do símbolo */
.contact-header h2,
.contact-type,
.contact-actions {
    position: relative;
    z-index: 3;
}

.contact-header h2 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: #1D1D3C;
}

.contact-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 5px 14px;

    border-radius: 999px;

    background: #3193A3;
    color: #FFFFFF;

    font-size: 9px;
    font-weight: 700;

    margin-bottom: 18px;
}

.contact-actions {
    display: flex;
    gap: 12px;
}

.contact-actions button {
    width: 48px;
    height: 48px;

    border: none;
    border-radius: 50%;

    background: #F3F3F3;
    color: #1D1D3C;

    font-size: 18px;
    cursor: pointer;
}

.contact-actions .whatsapp {
    color: #18C13E;
}
.contact-header h2 {

    margin: 13px 0 8px;

    font-size: 18px;

    position: relative;
}


.contact-type {

    background: var(--teal);

    color: white;

    border-radius: 12px;

    padding: 4px 12px;

    font-size: 9px;

    font-weight: bold;
}


.contact-actions {

    margin-top: 18px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 12px;
}


.contact-actions button {

    width: 40px;

    height: 40px;

    border-radius: 50%;

    border: 0;

    background: var(--gray-100);

    color: var(--navy);

    font-size: 16px;

    cursor: pointer;
}


.contact-actions .whatsapp {

    color: #10bc4f;
}


.contact-section {

    border-top:
        1px solid var(--gray-200);

    padding-top: 18px;
}


.contact-section h3,
.history h3 {

    font-size: 15px;

    margin-bottom: 20px;

    color: var(--navy);
}


.contact-info {

    display: flex;

    flex-direction: column;

    gap: 3px;

    margin-bottom: 15px;
}


.contact-info label {

    color: var(--gray-500);

    font-size: 10px;
}


.contact-info strong {

    font-size: 12px;

    font-weight: 500;
}


.tags {

    display: flex;

    gap: 8px;
}


.tag-gray {

    background: var(--gray-200);

    color: #555;

    padding: 4px 10px;

    border-radius: 12px;

    font-size: 9px;
}


/* HISTÓRICO */

.history {

    border-top:
        1px solid var(--gray-200);

    padding-top: 18px;

    margin-top: 15px;
}


.history > div {

    display: flex;

    justify-content: space-between;

    margin-bottom: 16px;

    font-size: 11px;
}


.history span {

    color: var(--gray-500);
}


.history strong {

    color: var(--navy);

    font-weight: 500;
}


/* NOVO ATENDIMENTO */

.new-service {

    width: 100%;

    height: 60px;

    margin-top: 20px;

    border: none;

    border-radius: 5px;

    background:
        linear-gradient(
            135deg,
            var(--navy-light),
            var(--navy)
        );

    color: white;

    font-size: 14px;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 12px;

    transition: .2s;
}


.new-service:hover {

    background:
        linear-gradient(
            135deg,
            var(--teal),
            var(--navy)
        );
}


.new-service span {

    font-size: 25px;
}


/* ============================
   SCROLL
   ============================ */

::-webkit-scrollbar {

    width: 6px;
}


::-webkit-scrollbar-track {

    background: transparent;
}


::-webkit-scrollbar-thumb {

    background: #d0d0d0;

    border-radius: 10px;
}


::-webkit-scrollbar-thumb:hover {

    background: #aaa;
}


/* ============================
   RESPONSIVO
   ============================ */

@media(max-width: 1250px) {

    :root {

        --sidebar-width: 180px;

        --list-width: 300px;

        --contact-width: 300px;
    }

}


@media(max-width: 1050px) {

    .contact-panel {

        display: none;
    }

    .chat-layout {

        grid-template-columns:
            300px
            minmax(350px, 1fr);
    }

}


@media(max-width: 780px) {

    .sidebar {

        width: 75px;

        padding-left: 8px;

        padding-right: 8px;
    }

    .logo-text {

        font-size: 20px;
    }

    .logo small {

        display: none;
    }

    .menu-item {

        justify-content: center;
    }

    .menu-item > span:not(.icon) {

        display: none;
    }

    .badge-orange {

        position: absolute;
    }

    .bottom-item {

        font-size: 0;
    }

    .chat-layout {

        grid-template-columns:
            260px
            1fr;
    }

}


@media(max-width: 600px) {

    .conversation-panel {

        display: none;
    }

    .chat-layout {

        display: block;
    }

    .chat-area {

        height: 100%;
    }

    .topbar {

        padding: 0 15px;
    }

    .topbar h1 {

        font-size: 20px;
    }

    .user-info {

        display: none;
    }

}

/* =========================================================
   AJUSTE FINAL — SÍMBOLO MAIS POLÍMEROS NO PAINEL DO CONTATO
   Este bloco deve permanecer no FINAL do arquivo CSS.
   ========================================================= */

.contact-panel {
    min-width: 0;
    border-left: 1px solid var(--gray-200);
    overflow-y: auto;
    background: #FFFFFF;
    padding: 20px 25px;
}

.contact-header {
    position: relative;
    overflow: hidden;

    min-height: 250px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    text-align: center;

    padding-top: 24px;
    padding-bottom: 20px;
}

/*
   O HTML deve usar:
   <img src="./Imagens/simbolo-mais.png"
        class="contact-background-symbol"
        alt="">
*/
.contact-background-symbol {
    position: absolute;

    top: 14px;
    right: 18px;

    width: 112px;
    height: auto;

    display: block;
    object-fit: contain;

    /* deixa o símbolo suave como na referência */
    opacity: 0.12;

    z-index: 0;

    pointer-events: none;
    user-select: none;
}

.contact-avatar {
    width: 88px;
    height: 88px;

    margin: 0 auto 16px;

    border-radius: 50%;

    background: #E9E9E9;
    color: #2A2A2A;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 28px;
    font-weight: 400;

    position: relative;
    z-index: 3;
}

.contact-header h2,
.contact-type,
.contact-actions {
    position: relative;
    z-index: 3;
}

.contact-header h2 {
    margin: 0 0 12px;
    color: var(--navy);
    font-size: 18px;
    font-weight: 700;
}

.contact-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 5px 14px;
    margin: 0 0 18px;

    border-radius: 999px;

    background: var(--teal);
    color: #FFFFFF;

    font-size: 9px;
    font-weight: 700;
}

.contact-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    margin-top: 0;
}

.contact-actions button {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: var(--gray-100);
    color: var(--navy);

    font-size: 16px;
    cursor: pointer;
}

.contact-actions .whatsapp {
    color: #10BC4F;
}

@media (max-width: 1250px) {
    .contact-background-symbol {
        width: 100px;
        top: 16px;
        right: 10px;
    }
}
/* =========================================================
   AJUSTE DE ROLAGEM — CONVERSA ATIVA
   Mantém cabeçalho e caixa de mensagem fixos e faz somente
   o histórico de mensagens rolar dentro da área central.
   ========================================================= */

.chat-layout {
    min-height: 0;
    overflow: hidden;
}

.chat-area {
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.chat-header {
    flex-shrink: 0;
}

.messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #D0D0D0 transparent;
}

.message-input {
    flex-shrink: 0;
}

.messages::-webkit-scrollbar {
    width: 7px;
}

.messages::-webkit-scrollbar-track {
    background: transparent;
}

.messages::-webkit-scrollbar-thumb {
    background: #D0D0D0;
    border-radius: 10px;
}

.messages::-webkit-scrollbar-thumb:hover {
    background: #AAAAAA;
}

/* =========================================================
   PAINEL LATERAL — AÇÕES, EDIÇÃO E RECOLHIMENTO
   ========================================================= */

.contact-panel {
    position: relative;
}

/* Três pontinhos no topo do card, acima do avatar/conversa. */
.contact-more-wrapper {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 30;
}

.contact-more-button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--navy);
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-more-button:hover,
.contact-more-button[aria-expanded="true"] {
    background: var(--gray-200);
}

.contact-more-menu {
    position: absolute;
    top: 44px;
    right: 0;
    min-width: 145px;
    padding: 6px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: #FFFFFF;
    box-shadow: 0 10px 30px rgba(29, 29, 60, 0.14);
}

.contact-more-menu button {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--navy);
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.contact-more-menu button:hover {
    background: var(--gray-100);
}

/* O cabeçalho ganha espaço para os controles superiores sem alterar o card. */
.contact-header {
    padding-top: 48px;
}

/* Recolher / expandir o painel de informações. */
.contact-panel-toggle {
    position: absolute;
    top: 15px;
    left: 8px;
    z-index: 40;
    width: 34px;
    height: 34px;
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--navy);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(29, 29, 60, 0.07);
}

.contact-panel-toggle:hover {
    background: var(--gray-100);
}

.chat-layout.contact-panel-collapsed {
    grid-template-columns: var(--list-width) minmax(400px, 1fr) 52px;
}

.chat-layout.contact-panel-collapsed .contact-panel {
    padding: 0;
    overflow: hidden;
}

.chat-layout.contact-panel-collapsed .contact-panel > :not(.contact-panel-toggle) {
    display: none !important;
}

.chat-layout.contact-panel-collapsed .contact-panel-toggle {
    position: absolute;
    top: 15px;
    left: 9px;
    transform: rotate(180deg);
}

/* Modal de edição. */
.contact-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.contact-edit-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 42, 0.45);
}

.contact-edit-dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: 0 24px 70px rgba(15, 15, 42, 0.24);
    padding: 26px;
}

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

.contact-edit-header h2 {
    color: var(--navy);
    font-size: 21px;
    margin-bottom: 5px;
}

.contact-edit-header p {
    color: var(--gray-500);
    font-size: 12px;
}

.contact-edit-close {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--navy);
    font-size: 24px;
    cursor: pointer;
}

.contact-edit-form {
    display: grid;
    gap: 15px;
}

.contact-edit-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-edit-form label span {
    color: var(--navy);
    font-size: 12px;
    font-weight: 700;
}

.contact-edit-form input {
    width: 100%;
    height: 46px;
    border: 1px solid var(--gray-300);
    border-radius: 9px;
    outline: none;
    padding: 0 13px;
    color: var(--navy);
    background: #FFFFFF;
    font-size: 13px;
}

.contact-edit-form input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(49, 147, 163, 0.10);
}

.contact-edit-error {
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(209, 0, 0, 0.07);
    color: var(--red);
    font-size: 12px;
}

.contact-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 5px;
}

.contact-edit-actions button {
    min-height: 43px;
    padding: 0 18px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.contact-edit-cancel {
    border: 1px solid var(--gray-300);
    background: #FFFFFF;
    color: var(--navy);
}

.contact-edit-save {
    border: 0;
    background: var(--navy);
    color: #FFFFFF;
}

.contact-edit-save:hover {
    background: var(--teal);
}

.contact-edit-save:disabled {
    opacity: .65;
    cursor: wait;
}

@media (max-width: 1050px) {
    .contact-panel-toggle {
        display: none;
    }
}

/* =========================================================
   CORREÇÃO — ELEMENTOS COM ATRIBUTO HIDDEN
   Garante que o modal/menu realmente desapareçam quando
   o JavaScript define element.hidden = true.
   ========================================================= */
[hidden] {
    display: none !important;
}


/* =========================================================
   NOVAS MENSAGENS — DESTAQUE NA LISTA DE CONVERSAS
   Mantém o layout original e aplica o padrão visual aprovado:
   fundo turquesa suave + barra lateral + horário + contador.
   ========================================================= */

.conversation.has-unread {
    background: rgba(49, 147, 163, 0.10);
    box-shadow: inset 4px 0 0 var(--teal);
}

.conversation.has-unread:hover {
    background: rgba(49, 147, 163, 0.14);
}

.conversation.has-unread .conversation-data {
    padding-right: 34px;
}

.conversation.has-unread .conversation-title strong {
    color: var(--navy);
    font-weight: 700;
}

.conversation.has-unread .conversation-title time {
    color: var(--teal);
    font-weight: 700;
}

.conversation.has-unread p {
    color: #41415A;
    font-weight: 600;
}

.unread-count {
    position: absolute;
    right: 20px;
    top: 56px;

    min-width: 23px;
    height: 23px;
    padding: 0 6px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;
    background: var(--teal);
    color: #FFFFFF;

    font-size: 10px;
    font-weight: 700;
    line-height: 1;

    box-shadow: 0 3px 10px rgba(49, 147, 163, 0.22);
}

/* Ao abrir a conversa ela é marcada como lida e volta ao destaque ativo normal. */
.conversation.active {
    box-shadow: none;
}

/* =========================================================
   ATENDIMENTO HUMANO / N8N
   O atendente só pode responder depois de assumir a conversa.
   ========================================================= */

.chat-human-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.attendance-status {
    color: var(--gray-500);
    font-size: 11px;
    white-space: nowrap;
}

.takeover-button {
    min-height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--teal);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
    box-shadow: 0 5px 16px rgba(49, 147, 163, .20);
}

.takeover-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(49, 147, 163, .28);
}

.takeover-button.is-owned {
    background: var(--navy);
}

.takeover-button.is-finish {
    background: #FFFFFF;
    color: var(--navy);
    border: 1px solid var(--gray-300);
    box-shadow: none;
}

.takeover-button.is-other,
.takeover-button:disabled {
    cursor: not-allowed;
    opacity: .65;
    box-shadow: none;
}

.message-input.is-locked {
    background: var(--gray-50);
}

.message-input textarea:disabled {
    cursor: not-allowed;
    color: var(--gray-500);
    background: transparent;
}

.send:disabled,
.attach:disabled,
.emoji:disabled {
    cursor: not-allowed;
    opacity: .4;
    transform: none !important;
}

/* Nome do vendedor no cabeçalho da mensagem humana. */
.message-attendant-name {
    display: block;
    margin-bottom: 5px;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.message-attendant-body {
    display: inline;
}

@media (max-width: 900px) {
    .attendance-status {
        display: none;
    }

    .takeover-button {
        padding: 0 13px;
        font-size: 11px;
    }
}

/* =========================================================
   CORREÇÃO DEFINITIVA 2026-08-25 — BARRA INFERIOR DO CHAT

   Regra importante: não usar height:0 no .chat-layout e não usar
   height:100% no .chat-area. O painel central deve ser esticado pela
   linha do CSS Grid e dividir a altura entre cabeçalho, mensagens e
   compositor.
   ========================================================= */
html,
body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
}

.app {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.main {
    min-width: 0;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

.topbar {
    flex: 0 0 82px;
    height: 82px;
}

.chat-layout {
    flex: 1 1 0;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
}

.conversation-panel,
.contact-panel {
    min-height: 0;
}

.chat-area {
    position: relative;
    align-self: stretch;
    min-width: 0;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: hidden;
    display: grid;
    grid-template-rows: 87px minmax(0, 1fr) auto;
}

.chat-header {
    min-height: 0;
    height: 87px;
    grid-row: 1;
    flex: none;
}

.messages {
    grid-row: 2;
    min-width: 0;
    min-height: 0;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
}

.message-input {
    grid-row: 3;
    position: relative;
    z-index: 50;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex: none;
    width: auto;
    min-width: 0;
    min-height: 75px;
    max-height: none;
    margin: 0 20px 20px;
    background: #FFFFFF;
}

.composer-attendance {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 0 0 auto;
    min-width: 0;
}

.composer-attendance .attendance-status {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0 4px;

    color: var(--gray-500);
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

.message-input textarea {
    min-width: 80px;
}

/* Segurança adicional para telas com pouca altura. */
@media (max-height: 720px) {
    .topbar {
        flex-basis: 70px;
        height: 70px;
    }

    .chat-area {
        grid-template-rows: 72px minmax(0, 1fr) auto;
    }

    .chat-header {
        height: 72px;
    }

    .message-input {
        min-height: 64px;
        margin-bottom: 10px;
    }
}

@media (max-width: 1100px) {
    .message-input {
        margin-left: 12px;
        margin-right: 12px;
        gap: 7px;
    }

    .composer-attendance .attendance-status {
        display: none;
    }
}

@media (max-width: 600px) {
    .chat-layout {
        display: block;
        height: 100%;
    }

    .chat-area {
        height: 100%;
        grid-template-rows: 72px minmax(0, 1fr) auto;
    }

    .chat-header {
        height: 72px;
    }
}


/* =========================================================
   FILTRO DE CONVERSAS: RESPONDIDAS / NÃO RESPONDIDAS
   ========================================================= */
.conversation-filter-wrapper {
    position: relative;
    flex: 0 0 auto;
}

.search-container .conversation-filter-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--navy);
    cursor: pointer;
    font-size: 19px;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.search-container .conversation-filter-button:hover,
.search-container .conversation-filter-button[aria-expanded="true"] {
    background: #eef8fa;
    color: var(--teal);
}

.search-container .conversation-filter-button.is-active {
    background: var(--teal);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(49, 147, 163, .12);
}

.conversation-filter-menu[hidden] {
    display: none !important;
}

.conversation-filter-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: -8px;
    z-index: 80;
    width: 215px;
    padding: 7px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 24, 54, .16);
}

.search-container .conversation-filter-menu button {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.search-container .conversation-filter-menu button:hover {
    background: #f4f8f9;
}

.search-container .conversation-filter-menu button.active {
    background: #eaf6f8;
    color: #247f8e;
}

.search-container .conversation-filter-menu strong {
    min-width: 28px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #eef1f5;
    color: #647087;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
}

.search-container .conversation-filter-menu button.active strong {
    background: #fff;
    color: #247f8e;
}


/* =========================================================
   SELETOR DE EMOJIS — DESIGN MODERNO / DARK
   ========================================================= */

.message-input {
    overflow: visible !important;
}

.emoji-picker-wrapper {
    position: relative;
    z-index: 500;
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;
}

.message-input .emoji {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: transparent;
    color: #70788A;

    font-family:
        "Segoe UI Emoji",
        "Apple Color Emoji",
        "Noto Color Emoji",
        sans-serif;
    font-size: 20px;
    line-height: 1;

    cursor: pointer !important;
    opacity: 1 !important;

    transition:
        background .16s ease,
        color .16s ease,
        transform .16s ease;
}

.message-input .emoji:hover,
.message-input .emoji[aria-expanded="true"] {
    background: #EAF5F6;
    color: var(--teal);
    transform: scale(1.05);
}

.message-input .emoji:disabled {
    pointer-events: auto !important;
    cursor: pointer !important;
    opacity: 1 !important;
}

.emoji-picker[hidden] {
    display: none !important;
}

.emoji-picker {
    position: absolute;

    right: -66px;
    bottom: calc(100% + 18px);

    z-index: 99999;

    width: 420px;
    max-width: min(420px, calc(100vw - 34px));

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border: 1px solid rgba(255,255,255,.08);
    border-radius: 24px;

    background:
        radial-gradient(circle at 85% 90%, rgba(40,34,79,.95), transparent 45%),
        linear-gradient(145deg, #0E241F 0%, #102D32 46%, #172038 100%);

    box-shadow:
        0 26px 70px rgba(11, 19, 33, .34),
        0 8px 22px rgba(11, 19, 33, .18);

    color: #FFFFFF;

    transform-origin: bottom right;
    animation: emojiPickerIn .16s ease-out;
}

@keyframes emojiPickerIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.emoji-search-row {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 18px 18px 10px;
}

.emoji-search-box {
    min-width: 0;
    flex: 1;

    height: 48px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 0 16px;

    border: 1px solid rgba(255,255,255,.08);
    border-radius: 24px;

    background: rgba(255,255,255,.10);
    backdrop-filter: blur(8px);
}

.emoji-search-icon {
    flex: 0 0 auto;

    color: rgba(255,255,255,.62);

    font-size: 26px;
    line-height: 1;
    transform: rotate(-12deg);
}

.emoji-search {
    min-width: 0;
    width: 100%;

    border: 0;
    outline: 0;

    background: transparent;
    color: #FFFFFF;

    font: inherit;
    font-size: 16px;
}

.emoji-search::placeholder {
    color: rgba(255,255,255,.54);
}

.emoji-search::-webkit-search-cancel-button {
    filter: invert(1);
    opacity: .65;
    cursor: pointer;
}

.emoji-picker-close {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255,255,255,.08);
    border-radius: 50%;

    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.72);

    font-size: 22px;
    line-height: 1;

    cursor: pointer;

    transition:
        background .14s ease,
        color .14s ease,
        transform .14s ease;
}

.emoji-picker-close:hover {
    background: rgba(255,255,255,.15);
    color: #FFFFFF;
    transform: scale(1.04);
}

.emoji-grid {
    min-height: 280px;
    max-height: 355px;

    overflow-x: hidden;
    overflow-y: auto;

    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-content: start;
    gap: 6px 8px;

    padding: 12px 18px 14px;

    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.22) transparent;
}

.emoji-grid::-webkit-scrollbar {
    width: 6px;
}

.emoji-grid::-webkit-scrollbar-track {
    background: transparent;
}

.emoji-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255,255,255,.22);
}

.emoji-option {
    width: 52px;
    height: 52px;

    justify-self: center;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 14px;

    background: transparent;

    font-family:
        "Segoe UI Emoji",
        "Apple Color Emoji",
        "Noto Color Emoji",
        sans-serif;
    font-size: 34px;
    line-height: 1;

    cursor: pointer;

    transition:
        background .12s ease,
        transform .12s ease;
}

.emoji-option:hover {
    background: rgba(255,255,255,.10);
    transform: scale(1.15);
}

.emoji-option:active {
    transform: scale(.96);
}

.emoji-empty {
    padding: 52px 20px 60px;

    color: rgba(255,255,255,.58);

    text-align: center;
    font-size: 13px;
}

.emoji-categories {
    position: relative;

    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;

    padding: 10px 16px 14px;

    border-top: 1px solid rgba(255,255,255,.08);

    background: rgba(5,15,18,.18);
    backdrop-filter: blur(10px);
}

.emoji-category-button {
    position: relative;

    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 16px;

    background: transparent;

    font-family:
        "Segoe UI Emoji",
        "Apple Color Emoji",
        "Noto Color Emoji",
        sans-serif;
    font-size: 23px;
    line-height: 1;

    filter: grayscale(.45);
    opacity: .62;

    cursor: pointer;

    transition:
        background .14s ease,
        opacity .14s ease,
        filter .14s ease,
        transform .14s ease;
}

.emoji-category-button:hover {
    background: rgba(255,255,255,.08);
    opacity: .88;
    filter: grayscale(.15);
    transform: translateY(-1px);
}

.emoji-category-button.active {
    background: rgba(75,185,176,.23);
    opacity: 1;
    filter: none;
}

.emoji-category-button.active::after {
    content: "";

    position: absolute;
    left: 50%;
    bottom: 4px;

    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: #7CE1D8;

    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(124,225,216,.65);
}

/* Seta do popover */
.emoji-picker::after {
    content: "";

    position: absolute;
    right: 78px;
    bottom: -8px;

    width: 15px;
    height: 15px;

    background: #172038;

    transform: rotate(45deg);
}

@media (max-width: 760px) {
    .emoji-picker {
        position: fixed;

        left: 12px;
        right: 12px;
        bottom: 92px;

        width: auto;
        max-width: none;

        border-radius: 22px;
    }

    .emoji-picker::after {
        display: none;
    }

    .emoji-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .emoji-option {
        width: 46px;
        height: 46px;
        font-size: 30px;
    }
}

@media (max-width: 430px) {
    .emoji-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .emoji-option {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
}


/* =========================================================
   ALERTA DE JANELA DE 24H
   ========================================================= */

.client-24h-warning[hidden] {
    display: none !important;
}

.message-input {
    flex-wrap: wrap;
}

.client-24h-warning {
    order: -20;

    width: 100%;
    flex: 1 0 100%;

    display: flex;
    align-items: center;
    gap: 9px;

    margin: 0 0 3px;
    padding: 9px 11px;

    border: 1px solid #F2B4B4;
    border-radius: 9px;

    background: #FFF2F2;
    color: #B42318;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
}

.client-24h-warning-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #D10000;
    color: #FFFFFF;

    font-size: 12px;
    font-weight: 900;
}

.client-24h-warning-text {
    flex: 1 1 auto;
    min-width: 0;
}

.client-24h-template-button {
    flex: 0 0 auto;

    min-height: 28px;
    padding: 6px 10px;

    border: 1px solid #D10000;
    border-radius: 8px;

    background: #FFFFFF;
    color: #D10000;

    font: inherit;
    font-size: 10px;
    font-weight: 800;

    cursor: pointer;
    white-space: nowrap;

    transition:
        background .14s ease,
        color .14s ease,
        transform .14s ease;
}

.client-24h-template-button:hover {
    background: #D10000;
    color: #FFFFFF;
    transform: translateY(-1px);
}


/* =========================================================
   CONVERSAS ARQUIVADAS
   ========================================================= */

.search-container .conversation-archive-view-button {
    position: relative;

    width: 34px;
    height: 34px;
    flex: 0 0 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 9px;

    background: transparent;
    color: var(--navy);

    cursor: pointer;

    transition:
        background .16s ease,
        color .16s ease,
        box-shadow .16s ease;
}

.search-container .conversation-archive-view-button svg {
    width: 19px;
    height: 19px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.search-container .conversation-archive-view-button:hover {
    background: #eef8fa;
    color: var(--teal);
}

.search-container .conversation-archive-view-button.is-active {
    background: var(--teal);
    color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(49, 147, 163, .12);
}

.archive-count-badge {
    position: absolute;

    top: -5px;
    right: -6px;

    min-width: 17px;
    height: 17px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 4px;

    border: 2px solid #FFFFFF;
    border-radius: 999px;

    background: #D10000;
    color: #FFFFFF;

    font-size: 8px;
    font-weight: 800;
    line-height: 1;
}

.archive-count-badge[hidden] {
    display: none !important;
}

.conversation-data {
    padding-right: 38px;
}

.conversation.has-unread .conversation-data {
    padding-right: 38px;
}

.conversation-archive-button {
    position: absolute;

    top: 14px;
    right: 12px;

    width: 28px;
    height: 28px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid transparent;
    border-radius: 8px;

    background: rgba(255,255,255,.72);
    color: #798397;

    cursor: pointer;
    opacity: .42;

    transition:
        opacity .16s ease,
        background .16s ease,
        color .16s ease,
        border-color .16s ease,
        transform .16s ease;
}

.conversation:hover .conversation-archive-button,
.conversation-archive-button:focus-visible,
.conversation-archive-button.is-restore {
    opacity: 1;
}

.conversation-archive-button:hover {
    border-color: #CFE7EA;
    background: #EAF6F8;
    color: var(--teal);

    transform: translateY(-1px);
}

.conversation-archive-button.is-restore {
    color: #247F8E;
    background: #F0F8F9;
}

.conversation-archive-button svg {
    width: 16px;
    height: 16px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;
}

/* Com o botão de arquivar no topo direito, o contador de não lidas
   fica no canto inferior direito para não haver sobreposição. */
.unread-count {
    top: auto;
    right: 15px;
    bottom: 13px;
}


/* =========================================================
   BOTÃO DESARQUIVAR NA CONVERSA
   ========================================================= */

.chat-header-actions {
    margin-left: auto;

    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-unarchive-button[hidden] {
    display: none !important;
}

.chat-unarchive-button {
    min-height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    padding: 7px 12px;

    border: 1px solid #3193A3;
    border-radius: 9px;

    background: #FFFFFF;
    color: #16798A;

    font: inherit;
    font-size: 11px;
    font-weight: 800;

    cursor: pointer;
    white-space: nowrap;

    transition:
        background .16s ease,
        color .16s ease,
        transform .16s ease;
}

.chat-unarchive-button:hover {
    background: #3193A3;
    color: #FFFFFF;
    transform: translateY(-1px);
}

.chat-unarchive-button svg {
    width: 16px;
    height: 16px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
