/* =========================================================
   BASE / RESET
========================================================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        linear-gradient(135deg,
            #0f172a,
            #1e293b);
    color: #1e293b;
}

a {
    color: inherit;
}

/* =========================================================
   WILLCONNECT — CABEÇALHO
========================================================= */

.willconnect-site {
    min-height: 100vh;
    background: #f8fafc;
    color: #0f172a;
}

.willconnect-site-topo {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 34px;
    min-height: 112px;
    padding: 18px 7%;
    background:
        linear-gradient(135deg,
            rgba(8, 13, 28, 0.98) 0%,
            rgba(15, 23, 42, 0.98) 45%,
            rgba(12, 74, 110, 0.94) 100%);
    border-bottom: 1px solid rgba(125, 211, 252, 0.18);
    box-shadow:
        0 18px 42px rgba(8, 13, 28, 0.32),
        inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.willconnect-site-topo::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    content: "";
    background:
        radial-gradient(circle at 16% 0%,
            rgba(32, 178, 170, 0.28),
            transparent 34%),
        radial-gradient(circle at 84% 0%,
            rgba(14, 165, 233, 0.22),
            transparent 28%);
    pointer-events: none;
}

.willconnect-site-marca {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(14px);
}

/* =========================================================
   WILLCONNECT — LOGOMARCA
========================================================= */

.willconnect-logo {
    display: block;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.willconnect-logo-topo {
    height: 86px;
    filter:
        drop-shadow(0 0 4px rgba(255, 255, 255, 0.92))
        drop-shadow(0 0 12px rgba(255, 255, 255, 0.66))
        drop-shadow(0 0 28px rgba(255, 255, 255, 0.38))
        drop-shadow(0 0 44px rgba(125, 211, 252, 0.22))
        drop-shadow(0 14px 20px rgba(0, 0, 0, 0.24));
}

.willconnect-logo-login {
    height: 58px;
    margin: 0 auto;
}

.willconnect-logo-painel {
    height: 54px;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 26px;
}

@media (max-width: 600px) {
    .willconnect-logo-login,
    .willconnect-logo-painel {
        height: 48px;
    }
}

/* =========================================================
   WILLCONNECT — MENU SUPERIOR
========================================================= */

.willconnect-site-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.32);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
}

.willconnect-site-menu a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    color: rgba(226, 232, 240, 0.88);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.2px;
    text-decoration: none;
    transition:
        background 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.willconnect-site-menu a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateY(-1px);
}

.willconnect-site-menu .willconnect-site-menu-acao,
.willconnect-site-botao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid rgba(153, 246, 228, 0.28);
    border-radius: 14px;
    background:
        linear-gradient(135deg,
            #22c7bb,
            #17857f 58%,
            #0f766e);
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    box-shadow:
        0 14px 34px rgba(32, 178, 170, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.willconnect-site-menu .willconnect-site-menu-acao:hover,
.willconnect-site-botao:hover {
    color: #ffffff;
    box-shadow:
        0 18px 40px rgba(32, 178, 170, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

@media (max-width: 900px) {
    .willconnect-site-topo {
        align-items: stretch;
        flex-direction: column;
        gap: 16px;
        min-height: auto;
        padding: 16px 20px 18px;
    }

    .willconnect-site-marca {
        align-self: flex-start;
        padding: 8px 10px;
        border-radius: 16px;
    }

    .willconnect-logo-topo {
        height: 72px;
    }

    .willconnect-site-menu {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .willconnect-site-menu a {
        justify-content: center;
        padding: 0 10px;
        text-align: center;
    }
}

@media (max-width: 460px) {
    .willconnect-logo-topo {
        height: 64px;
    }

    .willconnect-site-menu {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   WILLCONNECT — PRIMEIRO CONTATO OBRAPAS
========================================================= */

.primeiro-contato-aviso {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-left: 4px solid #22c7bb;
    color: #0f172a;
}

.primeiro-contato-aviso strong {
    font-size: 16px;
}

.primeiro-contato-aviso span {
    color: #475569;
    font-size: 14px;
}

.primeiro-contato-topo {
    align-items: center;
}

.primeiro-contato-filtros {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) repeat(5, minmax(130px, 1fr));
    gap: 14px;
    margin: 22px 0;
}

.primeiro-contato-filtros label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.primeiro-contato-filtros input,
.primeiro-contato-filtros select {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 8px;
    padding: 0 12px;
    background: #ffffff;
    color: #0f172a;
    font-size: 14px;
}

.primeiro-contato-filtros-acoes {
    display: flex;
    align-items: end;
    gap: 10px;
}

.primeiro-contato-tabela td {
    vertical-align: top;
}

.primeiro-contato-tabela td strong,
.primeiro-contato-tabela td small {
    display: block;
}

.primeiro-contato-tabela td small {
    margin-top: 4px;
    color: #64748b;
}

.primeiro-contato-telefones {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
}

.primeiro-contato-telefones span {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 7px 9px;
    border-radius: 8px;
    background: rgba(15, 118, 110, 0.08);
    color: #0f766e;
    font-weight: 800;
}

.primeiro-contato-telefones small {
    color: #475569;
    font-size: 11px;
    font-weight: 700;
}

.primeiro-contato-teste {
    display: grid;
    gap: 9px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(34, 199, 187, 0.28);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.04), rgba(34, 199, 187, 0.08));
    color: #0f172a;
}

.primeiro-contato-teste strong,
.primeiro-contato-teste small,
.primeiro-contato-teste label,
.primeiro-contato-teste span {
    color: inherit;
}

.primeiro-contato-preview {
    max-width: 420px;
    padding: 10px;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
    white-space: normal;
}

.primeiro-contato-alerta {
    padding: 10px 12px;
    border: 1px solid rgba(245, 158, 11, 0.32);
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
    font-size: 12px;
    font-weight: 800;
}

.primeiro-contato-teste textarea {
    width: 100%;
    min-height: 88px;
    resize: vertical;
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 8px;
    padding: 10px 12px;
    color: #0f172a;
    font: inherit;
    font-weight: 600;
}

.primeiro-contato-template {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.primeiro-contato-template-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
    gap: 18px;
    align-items: start;
}

.primeiro-contato-template-meta,
.primeiro-contato-template-form,
.primeiro-contato-template-preview,
.primeiro-contato-template-vars {
    display: grid;
    gap: 9px;
}

.primeiro-contato-template-selos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.primeiro-contato-template-meta {
    margin-bottom: 12px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.primeiro-contato-template-vars {
    grid-template-columns: repeat(auto-fit, minmax(140px, max-content));
    margin: 12px 0;
}

.primeiro-contato-template-form {
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.82);
}

.primeiro-contato-template-form select {
    width: 100%;
}

.primeiro-contato-template-avisos {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.primeiro-contato-template-avisos span {
    padding: 9px 11px;
    border-radius: 8px;
    background: rgba(14, 165, 233, 0.1);
    color: #075985;
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 900px) {
    .primeiro-contato-template-grid {
        grid-template-columns: 1fr;
    }

    .primeiro-contato-template-selos {
        justify-content: flex-start;
    }
}

.crm-alerta {
    margin-bottom: 16px;
    padding: 13px 16px;
    border-radius: 8px;
    font-weight: 800;
}

.crm-alerta-sucesso {
    background: #ecfdf5;
    color: #047857;
}

.crm-alerta-erro {
    background: #fef2f2;
    color: #b91c1c;
}

.crm-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.crm-badge-sucesso {
    background: #dcfce7;
    color: #166534;
}

.crm-badge-alerta {
    background: #fef3c7;
    color: #92400e;
}

.crm-badge-neutro {
    background: #e2e8f0;
    color: #334155;
}

@media (max-width: 1100px) {
    .primeiro-contato-filtros {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .primeiro-contato-aviso,
    .primeiro-contato-topo,
    .primeiro-contato-filtros-acoes {
        align-items: stretch;
        flex-direction: column;
    }

    .primeiro-contato-filtros {
        grid-template-columns: 1fr;
    }

    .primeiro-contato-filtros-acoes .crm-botao-primario,
    .primeiro-contato-filtros-acoes .crm-botao-secundario,
    .primeiro-contato-topo .crm-botao-primario {
        width: 100%;
    }
}

/* =========================================================
   WILLCONNECT — HERO PRINCIPAL
========================================================= */

.willconnect-site-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    align-items: center;
    gap: 58px;
    min-height: calc(100vh - 112px);
    padding: 78px 7% 86px;
    overflow: hidden;
    background:
        radial-gradient(circle at 16% 22%,
            rgba(32, 178, 170, 0.18),
            transparent 32%),
        radial-gradient(circle at 86% 24%,
            rgba(14, 165, 233, 0.18),
            transparent 30%),
        linear-gradient(135deg,
            #f8fafc 0%,
            #eef7f7 46%,
            #e8f3ff 100%);
}

.willconnect-site-hero::before {
    position: absolute;
    inset: 28px 7%;
    content: "";
    border: 1px solid rgba(32, 178, 170, 0.14);
    border-radius: 28px;
    pointer-events: none;
}

.willconnect-site-etiqueta,
.willconnect-section-heading span,
.willconnect-site-final span {
    display: inline-flex;
    margin-bottom: 16px;
    color: #0f766e;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.willconnect-site-hero h1 {
    max-width: 780px;
    margin: 0;
    color: #07111f;
    font-size: 66px;
    line-height: 1.02;
}

.willconnect-site-hero h1 span {
    display: block;
    margin-top: 14px;
    color: #284155;
    font-size: 35px;
    line-height: 1.18;
}

.willconnect-site-hero p {
    max-width: 760px;
    margin: 24px 0 0;
    color: #475569;
    font-size: 18px;
    line-height: 1.78;
}

.willconnect-site-acoes {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 34px;
}

.willconnect-site-botao-secundario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid rgba(15, 118, 110, 0.24);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
    color: #0f766e;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.willconnect-hero-produto {
    position: relative;
    min-height: 520px;
    overflow: hidden;
    border: 1px solid rgba(125, 211, 252, 0.26);
    border-radius: 28px;
    background:
        linear-gradient(145deg,
            rgba(8, 13, 28, 0.96),
            rgba(15, 23, 42, 0.92) 58%,
            rgba(12, 74, 110, 0.88));
    box-shadow:
        0 32px 80px rgba(15, 23, 42, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.willconnect-hero-produto::after {
    position: absolute;
    inset: -1px;
    z-index: -1;
    content: "";
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(32, 178, 170, 0.46), rgba(125, 211, 252, 0.24));
    filter: blur(18px);
    opacity: 0.62;
}

.willconnect-hero-produto::before {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    background:
        linear-gradient(180deg,
            rgba(8, 13, 28, 0.04),
            rgba(8, 13, 28, 0.16)),
        radial-gradient(circle at 50% 10%,
            rgba(255, 255, 255, 0.18),
            transparent 32%);
    pointer-events: none;
}

.willconnect-hero-imagem-institucional {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 520px;
    object-fit: cover;
    object-position: center;
    filter: saturate(1.05) contrast(1.03);
}

/* =========================================================
   WILLCONNECT — SEÇÕES DA LANDING
========================================================= */

.willconnect-site-secao,
.willconnect-site-final {
    padding: 82px 7%;
    border-top: 1px solid #e2e8f0;
}

.willconnect-site-secao {
    background: #ffffff;
}

.willconnect-section-heading {
    max-width: 860px;
}

.willconnect-section-heading h2,
.willconnect-site-final h2 {
    margin: 0;
    color: #0f172a;
    font-size: 38px;
    line-height: 1.15;
}

.willconnect-section-heading p,
.willconnect-site-final p {
    max-width: 780px;
    margin: 18px 0 0;
    color: #475569;
    font-size: 17px;
    line-height: 1.75;
}

/* =========================================================
   WILLCONNECT — RECURSOS
========================================================= */

.willconnect-recursos {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.willconnect-site-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 34px;
}

.willconnect-site-cards article {
    min-height: 178px;
    padding: 26px;
    border: 1px solid #dbeafe;
    border-radius: 22px;
    background:
        linear-gradient(180deg,
            #ffffff,
            #f8fafc);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.06);
}

.willconnect-site-cards h3 {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 20px;
}

.willconnect-site-cards p {
    margin: 0;
    color: #475569;
    line-height: 1.7;
}

/* =========================================================
   WILLCONNECT — PARA QUEM É
========================================================= */

.willconnect-publicos {
    background:
        linear-gradient(135deg,
            #0f172a,
            #12364a);
}

.willconnect-publicos .willconnect-section-heading span,
.willconnect-publicos .willconnect-section-heading h2 {
    color: #ffffff;
}

.willconnect-publicos-lista {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-top: 34px;
}

.willconnect-publicos-lista strong {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 15px;
    text-align: center;
}

/* =========================================================
   WILLCONNECT — INTEGRAÇÕES FUTURAS
========================================================= */

.willconnect-site-integracoes {
    background: #f1f5f9;
}

.willconnect-integracoes-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

.willconnect-integracoes-grid span {
    padding: 14px 18px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 999px;
    background: #ffffff;
    color: #0f766e;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

/* =========================================================
   WILLCONNECT — CHAMADA FINAL
========================================================= */

.willconnect-site-final {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    background:
        radial-gradient(circle at 20% 0%,
            rgba(32, 178, 170, 0.26),
            transparent 34%),
        linear-gradient(135deg,
            #08111f,
            #0f172a 58%,
            #0f4c5c);
}

.willconnect-site-final span,
.willconnect-site-final h2,
.willconnect-site-final p {
    color: #ffffff;
}

.willconnect-site-final p {
    color: #cbd5e1;
}

@media (max-width: 1000px) {
    .willconnect-site-hero,
    .willconnect-site-cards,
    .willconnect-publicos-lista {
        grid-template-columns: 1fr;
    }

    .willconnect-site-hero {
        min-height: auto;
        padding-top: 52px;
    }

    .willconnect-site-final {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 700px) {
    .willconnect-site-hero,
    .willconnect-site-secao,
    .willconnect-site-final {
        padding-left: 22px;
        padding-right: 22px;
    }

    .willconnect-site-hero h1 {
        font-size: 42px;
    }

    .willconnect-site-hero h1 span,
    .willconnect-section-heading h2,
    .willconnect-site-final h2 {
        font-size: 27px;
    }

    .willconnect-site-acoes {
        align-items: stretch;
        flex-direction: column;
    }

    .willconnect-site-botao,
    .willconnect-site-botao-secundario {
        width: 100%;
    }

    .willconnect-hero-produto,
    .willconnect-hero-imagem-institucional {
        min-height: 340px;
    }
}

/* =========================================================
   COMPONENTES — ALERTAS
========================================================= */

.alerta-erro,
.alerta-sucesso {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
}

.alerta-erro {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alerta-sucesso {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* =========================================================
   WILLCONNECT — LOGIN
========================================================= */

.login-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 36px;
    background:
        radial-gradient(circle at 18% 14%,
            rgba(32, 178, 170, 0.25),
            transparent 30%),
        radial-gradient(circle at 82% 12%,
            rgba(125, 211, 252, 0.2),
            transparent 28%),
        linear-gradient(135deg,
            #07111f,
            #0f172a 50%,
            #0f4c5c);
}

.login-container::before {
    position: absolute;
    inset: 28px;
    content: "";
    border: 1px solid rgba(125, 211, 252, 0.12);
    border-radius: 30px;
    pointer-events: none;
}

.login-container::after {
    position: absolute;
    width: 520px;
    height: 520px;
    content: "";
    border-radius: 50%;
    background: rgba(32, 178, 170, 0.14);
    filter: blur(80px);
    transform: translate(36vw, 28vh);
    pointer-events: none;
}

/* =========================================================
   WILLCONNECT — NAVEGAÇÃO LOGIN
========================================================= */

.login-voltar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    margin-bottom: 20px;
    padding: 0 13px;
    border: 1px solid rgba(15, 118, 110, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #0f766e;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.login-voltar:hover {
    border-color: rgba(32, 178, 170, 0.42);
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.login-voltar span {
    font-size: 15px;
    line-height: 1;
}

/* =========================================================
   WILLCONNECT — CARD LOGIN
========================================================= */

.login-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    padding: 42px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 30px;
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.96),
            rgba(248, 250, 252, 0.9));
    box-shadow:
        0 32px 86px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
}

.login-box::before {
    position: absolute;
    inset: 0 0 auto;
    height: 7px;
    content: "";
    background: linear-gradient(90deg, #22c7bb, #7dd3fc, #17857f);
}

.login-cabecalho {
    margin-bottom: 30px;
    text-align: center;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.login-cabecalho span {
    display: inline-flex;
    margin-bottom: 12px;
    color: #0f766e;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.login-box h1 {
    margin: 0;
    color: #0f172a;
    font-size: 32px;
    line-height: 1.12;
}

.login-box p {
    max-width: 360px;
    margin: 14px auto 0;
    color: #475569;
    line-height: 1.7;
}

/* =========================================================
   WILLCONNECT — FORMULÁRIO LOGIN
========================================================= */

.campo {
    margin-bottom: 20px;
}

.campo label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 900;
}

.campo input {
    width: 100%;
    height: 56px;
    padding: 0 16px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    outline: none;
    background:
        linear-gradient(180deg,
            #ffffff,
            #f8fafc);
    color: #0f172a;
    font-size: 15px;
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.campo input:hover {
    border-color: rgba(32, 178, 170, 0.5);
}

.campo input:focus {
    border-color: #20B2AA;
    box-shadow:
        0 0 0 4px rgba(32, 178, 170, 0.14),
        0 12px 28px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.login-box button {
    width: 100%;
    height: 56px;
    margin-top: 4px;
    border: 1px solid rgba(153, 246, 228, 0.26);
    border-radius: 16px;
    background:
        linear-gradient(135deg,
            #22c7bb,
            #17857f 58%,
            #0f766e);
    color: #ffffff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 900;
    box-shadow:
        0 18px 38px rgba(32, 178, 170, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition:
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.login-box button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 22px 46px rgba(32, 178, 170, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

@media (max-width: 600px) {
    .login-container {
        padding: 22px;
    }

    .login-container::before {
        inset: 14px;
        border-radius: 22px;
    }

    .login-box {
        padding: 34px 24px;
        border-radius: 24px;
    }

    .login-box h1 {
        font-size: 26px;
    }

    .login-voltar {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================================
   PAINEL — ESTRUTURA BASE
========================================================= */

.painel-container {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
    background: #f1f5f9;
}

.painel-sidebar {
    background: linear-gradient(180deg, #0f172a, #1e293b);
    color: #ffffff;
    padding: 28px 22px;
}

.painel-sidebar h2 {
    margin: 0 0 34px;
    font-size: 24px;
}

.painel-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-secao-titulo {
    margin-top: 18px;
    margin-bottom: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.22);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
    opacity: 0.85;
}

.painel-sidebar nav .menu-secao-titulo:first-child {
    margin-top: 0;
}

.painel-sidebar nav a {
    color: #e2e8f0;
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 12px;
    font-weight: 600;
    transition: 0.25s ease;
}

.painel-sidebar nav a:hover {
    background: rgba(32, 178, 170, 0.18);
    color: #ffffff;
}

.painel-sidebar nav a.ativo {
    background: rgba(32, 178, 170, 0.24);
    color: #ffffff;
}

.painel-conteudo {
    padding: 38px;
}

.painel-conteudo h1 {
    margin-top: 0;
    color: #0f172a;
    font-size: 32px;
}

.painel-conteudo p {
    color: #475569;
    font-size: 16px;
}

/* Responsividade — Painel */
@media (max-width: 768px) {
    .painel-container {
        grid-template-columns: 1fr;
    }

    .painel-sidebar {
        position: relative;
    }
}

/* =========================================================
   PAINEL — LOGO DO MENU
========================================================= */

.painel-logo {
    margin-bottom: 34px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.painel-logo h2 {
    margin: 0;
    font-size: 24px;
    color: #ffffff;
}

.painel-logo span {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #20B2AA;
    text-transform: uppercase;
}

/* =========================================================
   PAINEL — TOPO INTERNO
========================================================= */

.painel-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;

    margin-bottom: 34px;
    padding: 26px 30px;

    background: #ffffff;

    border: 1px solid #e2e8f0;
    border-radius: 22px;

    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.painel-topo h1 {
    margin: 0;
    color: #0f172a;
    font-size: 30px;
}

.painel-topo p {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 15px;
}

.painel-topo-acoes a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 11px 16px;

    border-radius: 12px;

    background: linear-gradient(135deg, #20B2AA, #17857f);

    color: #ffffff;

    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.painel-topo-acoes {
    display: flex;
    align-items: center;
    gap: 12px;
}

.painel-topo-lado-direito {
    display: flex;
    align-items: center;
    gap: 16px;
}

.painel-usuario {
    min-width: 180px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.painel-usuario strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
}

.painel-usuario span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.painel-topo-acoes form {
    margin: 0;
}

.painel-topo-acoes button {
    min-height: 42px;
    padding: 11px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.painel-topo-acoes button:hover {
    background: #f8fafc;
    color: #0f172a;
}

/* Responsividade — Topo do Painel */
@media (max-width: 768px) {
    .painel-topo {
        flex-direction: column;
        align-items: flex-start;
    }

    .painel-topo-acoes {
        width: 100%;
        flex-wrap: wrap;
    }

    .painel-topo-lado-direito {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .painel-usuario {
        width: 100%;
    }
}

/* =========================================================
   PAINEL — CARDS E BLOCOS
========================================================= */

.painel-metricas {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.painel-metricas article,
.painel-bloco,
.painel-modulos a {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.painel-metricas article {
    padding: 22px;
}

.painel-metricas span,
.painel-modulos span {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.painel-metricas strong {
    display: block;
    margin: 12px 0 8px;
    color: #0f172a;
    font-size: 34px;
}

.painel-metricas small {
    color: #64748b;
    line-height: 1.5;
}

.painel-modulos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.painel-modulos a {
    display: block;
    padding: 22px;
    text-decoration: none;
    transition: 0.25s ease;
}

.painel-modulos a:hover {
    border-color: rgba(32, 178, 170, 0.5);
    transform: translateY(-2px);
}

.painel-modulos strong {
    display: block;
    margin-top: 10px;
    color: #0f172a;
    font-size: 18px;
}

.painel-bloco {
    padding: 28px;
}

.painel-bloco h2 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 22px;
}

.painel-bloco p {
    max-width: 720px;
    margin: 0;
    line-height: 1.7;
}

/* =========================================================
   PAINEL — MÓDULO EMPRESAS
========================================================= */

.crm-card {
    padding: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background:
        linear-gradient(180deg,
            #ffffff,
            #f8fafc);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.crm-card-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.crm-card-topo span {
    display: block;
    margin-bottom: 6px;
    color: #17857f;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.crm-card-topo h2 {
    margin: 0;
    color: #0f172a;
    font-size: 24px;
}

.crm-botao-primario,
.crm-botao-secundario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 13px;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
}

.crm-botao-primario {
    border: 1px solid rgba(153, 246, 228, 0.32);
    background: linear-gradient(135deg, #22c7bb, #17857f);
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(32, 178, 170, 0.22);
}

.crm-botao-secundario {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
}

.crm-tabela-wrapper {
    overflow-x: auto;
}

.crm-tabela {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

.crm-tabela th,
.crm-tabela td {
    padding: 15px 14px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.crm-tabela th {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.crm-tabela td {
    color: #334155;
    font-size: 14px;
}

.crm-tabela tbody tr:hover {
    background: rgba(32, 178, 170, 0.05);
}

.crm-tabela-vazia {
    color: #64748b;
    text-align: center;
}

.crm-acoes-linha {
    display: flex;
    gap: 10px;
}

.crm-acoes-linha a {
    color: #17857f;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.crm-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.crm-status-ativo {
    background: #dcfce7;
    color: #166534;
}

.crm-status-inativo {
    background: #fee2e2;
    color: #991b1b;
}

.monitor-sessao-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.monitor-sessao-status-conectada {
    background: #dcfce7;
    color: #166534;
}

.monitor-sessao-status-desconectada {
    background: #fee2e2;
    color: #991b1b;
}

.monitor-sessao-status-aguardando_qr {
    background: #fef3c7;
    color: #92400e;
}

.monitor-sessao-status-conectando {
    background: #dbeafe;
    color: #1d4ed8;
}

.monitor-sessao-status-erro {
    background: #ffedd5;
    color: #c2410c;
}

.monitor-sessao-status-pausada {
    background: #e5e7eb;
    color: #4b5563;
}

.crm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.crm-form-grid .campo {
    margin-bottom: 0;
}

.campo select {
    width: 100%;
    height: 56px;
    padding: 0 16px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    outline: none;
    background: #ffffff;
    color: #0f172a;
    font-size: 15px;
}

.campo select:focus {
    border-color: #20B2AA;
    box-shadow: 0 0 0 4px rgba(32, 178, 170, 0.14);
}

.crm-form-acoes {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.crm-detalhes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
}

.crm-detalhes div {
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
}

.crm-detalhes dt {
    margin-bottom: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.crm-detalhes dd {
    margin: 0;
    color: #0f172a;
    font-weight: 800;
}

.crm-paginacao {
    margin-top: 18px;
}

.crm-paginacao-lista {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.crm-paginacao .crm-botao-primario,
.crm-paginacao .crm-botao-secundario {
    min-height: 40px;
    border-radius: 10px;
    box-shadow: none;
}

.crm-paginacao-pagina {
    width: 40px;
    padding: 0;
}

.crm-paginacao-navegacao {
    padding: 0 14px;
}

.crm-paginacao .desabilitado {
    opacity: 0.45;
    cursor: not-allowed;
}

.crm-paginacao-reticencias {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 40px;
    color: #64748b;
    font-weight: 900;
}

.crm-paginacao-resumo {
    margin: 0 0 12px;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

/* =========================================================
WILLCONNECT — ENTIDADES CRM
========================================================= */

.entidades-crm-filtros {
    margin-bottom: 22px;
}

.entidade-crm-nome {
    max-width: 320px;
}

.entidade-crm-nome strong,
.entidade-crm-nome small {
    display: block;
    overflow-wrap: anywhere;
}

.entidade-crm-nome strong {
    color: #0f172a;
    font-weight: 900;
}

.entidade-crm-nome small {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.entidade-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.entidade-status-nao-prospectada {
    background: #f1f5f9;
    color: #475569;
}

.entidade-status-prospectada {
    background: #dbeafe;
    color: #1d4ed8;
}

.entidade-status-inativa {
    background: #fee2e2;
    color: #991b1b;
}

.entidade-status-ativo,
.entidade-status-ativa {
    background: #dcfce7;
    color: #166534;
}

.entidade-status-pendente,
.entidade-status-nao-informado,
.entidade-status-desconhecido {
    background: #fef3c7;
    color: #92400e;
}

.entidade-show-card {
    display: grid;
    gap: 22px;
}

.entidade-show-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.entidade-info-item {
    min-width: 0;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.entidade-info-item label {
    display: block;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.entidade-info-item p {
    margin: 0;
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.entidade-show-secao {
    display: grid;
    gap: 12px;
}

.entidade-show-secao-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.entidade-show-secao-topo h3 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    font-weight: 900;
}

.entidade-show-secao-topo span {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.entidade-lista-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
}

.entidade-lista-item strong,
.entidade-lista-item small {
    display: block;
    overflow-wrap: anywhere;
}

.entidade-lista-item strong {
    color: #0f172a;
    font-weight: 900;
}

.entidade-lista-item small {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.entidade-lista-badges {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.entidade-show-vazio {
    margin: 0;
    padding: 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: #64748b;
    font-weight: 800;
    text-align: center;
}

/* =========================================================
   WILLCONNECT — CANAIS WHATSAPP
========================================================= */

.crm-canais-whatsapp {
    position: relative;
    overflow: hidden;
}

.crm-canais-whatsapp::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #20B2AA, #60a5fa, #22c55e);
}

.crm-tabela-canais {
    min-width: 1040px;
}

.campo-largo {
    grid-column: 1 / -1;
}

.campo textarea {
    width: 100%;
    min-height: 118px;
    padding: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    outline: none;
    background: #ffffff;
    color: #0f172a;
    font-family: inherit;
    font-size: 15px;
    resize: vertical;
}

.campo textarea:focus {
    border-color: #20B2AA;
    box-shadow: 0 0 0 4px rgba(32, 178, 170, 0.14);
}

.crm-token-mascarado {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px;
    font-weight: 900;
}

.crm-status-configurando {
    background: #dbeafe;
    color: #1d4ed8;
}

.crm-status-conectado {
    background: #dcfce7;
    color: #166534;
}

.crm-status-desconectado {
    background: #fef3c7;
    color: #92400e;
}

.crm-status-bloqueado {
    background: #fee2e2;
    color: #991b1b;
}

/* =========================================================
   WILLCONNECT — CONTATOS
========================================================= */

.crm-contatos {
    position: relative;
    overflow: hidden;
}

.crm-contatos::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #17857f, #22c7bb, #6366f1);
}

.crm-tabela-contatos {
    min-width: 980px;
}

.crm-contato-identidade,
.crm-contato-titulo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crm-contato-identidade strong {
    color: #0f172a;
    font-size: 14px;
}

.crm-contato-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid rgba(32, 178, 170, 0.24);
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.9), transparent 28%),
        linear-gradient(135deg, #20B2AA, #1d4ed8);
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(32, 178, 170, 0.22);
}

.crm-contato-avatar-grande {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    font-size: 22px;
}

.crm-origem {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.crm-origem-whatsapp {
    background: #dcfce7;
    color: #166534;
}

.crm-origem-site {
    background: #dbeafe;
    color: #1d4ed8;
}

.crm-origem-manual {
    background: #f1f5f9;
    color: #475569;
}

.crm-origem-importacao {
    background: #ede9fe;
    color: #6d28d9;
}

.crm-origem-campanha {
    background: #fef3c7;
    color: #92400e;
}

/* =========================================================
   WILLCONNECT — CONVERSAS
========================================================= */

.crm-conversas {
    position: relative;
    overflow: hidden;
}

.crm-conversas::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #0f766e, #2563eb, #7c3aed);
}

.crm-inbox-lista {
    display: grid;
    gap: 14px;
}

.crm-conversa-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 14px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background:
        linear-gradient(135deg, #ffffff, #f8fafc);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.crm-conversa-corpo {
    min-width: 0;
}

.crm-conversa-linha {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.crm-conversa-linha h3 {
    margin: 0 0 5px;
    color: #0f172a;
    font-size: 17px;
}

.crm-conversa-linha p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.crm-conversa-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.crm-conversa-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

.crm-status-aberta {
    background: #dcfce7;
    color: #166534;
}

.crm-status-aguardando {
    background: #fef3c7;
    color: #92400e;
}

.crm-status-finalizada {
    background: #dbeafe;
    color: #1d4ed8;
}

.crm-status-arquivada {
    background: #f1f5f9;
    color: #475569;
}

.crm-chat-shell {
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background:
        linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.07);
}

.crm-chat-topo {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.crm-chat-topo span {
    display: block;
    margin-bottom: 5px;
    color: #17857f;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.crm-chat-topo h2 {
    margin: 0 0 4px;
    color: #0f172a;
    font-size: 24px;
}

.crm-chat-topo p {
    margin: 0;
    color: #64748b;
    font-weight: 800;
}

.crm-chat-acoes {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.crm-chat-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 0;
}

.crm-chat-mensagens {
    min-height: 430px;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(32, 178, 170, 0.10), transparent 30%),
        linear-gradient(180deg, #f8fafc, #eef2f7);
}

.crm-chat-placeholder {
    display: grid;
    align-content: center;
    min-height: 382px;
    padding: 28px;
    border: 1px dashed #94a3b8;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    text-align: center;
}

.crm-chat-placeholder span {
    color: #17857f;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.crm-chat-placeholder h3 {
    margin: 10px 0 8px;
    color: #0f172a;
    font-size: 22px;
}

.crm-chat-placeholder p {
    max-width: 430px;
    margin: 0 auto;
    color: #64748b;
    line-height: 1.6;
}

.crm-chat-dados {
    padding: 24px;
    border-left: 1px solid #e2e8f0;
}

.crm-chat-dados .crm-detalhes {
    grid-template-columns: 1fr;
}

.crm-chat-envio {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 24px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

.crm-chat-envio span {
    flex: 1;
    min-height: 46px;
    padding: 13px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 800;
}

.crm-chat-envio button {
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: #cbd5e1;
    color: #ffffff;
    font-weight: 900;
}

/* =========================================================
   WILLCONNECT — MENSAGENS
========================================================= */

.crm-mensagens {
    position: relative;
    overflow: hidden;
}

.crm-mensagens::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #16a34a, #20B2AA, #2563eb);
}

.crm-mensagens-lista,
.crm-timeline-mensagens {
    display: grid;
    gap: 16px;
}

.crm-mensagem-linha {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.crm-mensagem-linha.crm-mensagem-saida {
    grid-template-columns: minmax(0, 1fr) 44px;
}

.crm-mensagem-linha.crm-mensagem-saida .crm-contato-avatar {
    order: 2;
}

.crm-mensagem-linha.crm-mensagem-saida .crm-mensagem-bolha {
    justify-self: end;
    background:
        linear-gradient(135deg, #dcfce7, #ecfdf5);
}

.crm-mensagem-bolha {
    width: min(760px, 100%);
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background:
        linear-gradient(135deg, #ffffff, #f8fafc);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.crm-mensagem-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.crm-mensagem-topo strong {
    color: #0f172a;
    font-size: 14px;
}

.crm-mensagem-hora {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.crm-mensagem-bolha p {
    margin: 0 0 12px;
    color: #334155;
    line-height: 1.55;
}

.crm-mensagem-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.crm-mensagem-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.crm-direcao,
.crm-tipo-mensagem {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.crm-direcao-entrada {
    background: #dbeafe;
    color: #1d4ed8;
}

.crm-direcao-saida {
    background: #dcfce7;
    color: #166534;
}

.crm-tipo-texto {
    background: #f1f5f9;
    color: #475569;
}

.crm-tipo-imagem {
    background: #ede9fe;
    color: #6d28d9;
}

.crm-tipo-audio {
    background: #fef3c7;
    color: #92400e;
}

.crm-tipo-documento {
    background: #e0f2fe;
    color: #0369a1;
}

.crm-tipo-sistema {
    background: #fee2e2;
    color: #991b1b;
}

.crm-status-mensagem {
    background: #eef2ff;
    color: #3730a3;
}

.crm-chat-mensagens-reais {
    max-height: 620px;
    overflow-y: auto;
}

.crm-mensagem-chat {
    display: flex;
}

.crm-mensagem-chat-saida {
    justify-content: flex-end;
}

.crm-mensagem-chat .crm-mensagem-bolha {
    max-width: 78%;
}

.crm-mensagem-chat-saida .crm-mensagem-bolha {
    background:
        linear-gradient(135deg, #dcfce7, #ecfdf5);
}

.crm-mensagem-destaque .crm-mensagem-bolha {
    border-color: rgba(32, 178, 170, 0.42);
    box-shadow: 0 16px 36px rgba(32, 178, 170, 0.16);
}

.crm-payload-box {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #0f172a;
}

.crm-payload-box span {
    display: block;
    margin-bottom: 10px;
    color: #99f6e4;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.crm-payload-box pre {
    max-height: 260px;
    margin: 0;
    overflow: auto;
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
}

/* =========================================================
   WILLCONNECT — INBOX
========================================================= */

.willconnect-inbox {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    min-height: 680px;
    border: 1px solid #dbe4ef;
    border-radius: 22px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.inbox-lista {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-right: 1px solid #dbe4ef;
    background:
        linear-gradient(180deg, #f8fafc, #eef2f7);
}

.inbox-lista-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid #dbe4ef;
}

.inbox-lista-topo span {
    color: #17857f;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.inbox-lista-topo strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #0f172a;
    color: #ffffff;
    font-size: 14px;
}

.inbox-lista-scroll {
    display: grid;
    align-content: start;
    gap: 10px;
    height: 620px;
    padding: 12px;
    overflow-y: auto;
}

.inbox-conversa-link {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 16px;
    color: inherit;
    text-decoration: none;
}

.inbox-conversa-link:hover,
.inbox-conversa-link.ativo {
    border-color: rgba(32, 178, 170, 0.30);
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.inbox-conversa-info {
    min-width: 0;
}

.inbox-conversa-linha {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.inbox-conversa-linha strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 14px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inbox-conversa-linha small,
.inbox-conversa-telefone {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.inbox-conversa-telefone {
    display: block;
    margin-bottom: 8px;
}

.inbox-conversa-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.inbox-conversa-meta span:not(.crm-status) {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 900;
}

.inbox-chat {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background:
        radial-gradient(circle at top right, rgba(32, 178, 170, 0.10), transparent 28%),
        linear-gradient(180deg, #f8fafc, #edf4f7);
}

.inbox-chat-topo {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #dbe4ef;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(14px);
}

.inbox-chat-topo span {
    display: block;
    margin-bottom: 5px;
    color: #17857f;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.inbox-chat-topo h2 {
    margin: 0 0 4px;
    color: #0f172a;
    font-size: 22px;
}

.inbox-chat-topo p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.inbox-chat-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}

.inbox-chat-badges > span:not(.crm-status) {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 12px;
    font-weight: 900;
}

.inbox-chat-mensagens {
    display: grid;
    align-content: start;
    gap: 14px;
    height: 540px;
    padding: 24px;
    overflow-y: auto;
}

.inbox-mensagem {
    display: flex;
    justify-content: flex-start;
}

.inbox-mensagem-saida {
    justify-content: flex-end;
}

.inbox-mensagem-bolha {
    width: min(620px, 78%);
    padding: 14px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 18px 18px 18px 6px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.inbox-mensagem-saida .inbox-mensagem-bolha {
    border-color: rgba(34, 197, 94, 0.24);
    border-radius: 18px 18px 6px 18px;
    background: #dcfce7;
}

.inbox-mensagem-bolha p {
    margin: 0 0 10px;
    color: #1e293b;
    line-height: 1.55;
}

.inbox-mensagem-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.inbox-mensagem-meta span {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.inbox-resposta-placeholder {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #dbe4ef;
    background: rgba(255, 255, 255, 0.90);
}

.inbox-resposta-placeholder span {
    flex: 1;
    min-height: 46px;
    padding: 13px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 800;
}

.inbox-resposta-placeholder button {
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: #cbd5e1;
    color: #ffffff;
    font-weight: 900;
}

.inbox-vazia,
.inbox-sem-conversa {
    padding: 28px;
    color: #64748b;
    text-align: center;
}

.inbox-vazia-chat,
.inbox-sem-conversa {
    display: grid;
    align-content: center;
    min-height: 420px;
}

.inbox-sem-conversa span {
    color: #17857f;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.inbox-sem-conversa h2 {
    margin: 10px 0 8px;
    color: #0f172a;
}

.inbox-sem-conversa p {
    margin: 0 auto;
    max-width: 420px;
    line-height: 1.6;
}

/* =========================================================
   WILLCONNECT — ENVIO DE MENSAGENS
========================================================= */

.inbox-envio-form {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 16px 20px;
    border-top: 1px solid #dbe4ef;
    background: rgba(255, 255, 255, 0.94);
}

.inbox-envio-campo {
    display: grid;
    gap: 8px;
}

.inbox-envio-form textarea {
    width: 100%;
    min-height: 48px;
    max-height: 130px;
    padding: 13px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 18px;
    outline: none;
    background: #ffffff;
    color: #0f172a;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.45;
    resize: vertical;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.03);
}

.inbox-envio-form textarea:focus {
    border-color: #20B2AA;
    box-shadow: 0 0 0 4px rgba(32, 178, 170, 0.14);
}

.inbox-anexo-botao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.inbox-anexo-botao input {
    display: none;
}

.inbox-arquivo-preview {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    width: fit-content;
    max-width: 100%;
    padding: 0 10px;
    border: 1px solid rgba(32, 178, 170, 0.24);
    border-radius: 999px;
    background: #ecfeff;
    color: #0f766e;
    font-size: 12px;
    font-weight: 900;
}

.inbox-envio-form button {
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid rgba(153, 246, 228, 0.32);
    border-radius: 16px;
    background: linear-gradient(135deg, #22c7bb, #17857f);
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(32, 178, 170, 0.22);
}

.inbox-envio-form button:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.inbox-mensagem-meta span:last-child {
    border-radius: 999px;
}

.inbox-mensagem-saida .inbox-mensagem-meta span:last-child {
    color: #166534;
}

/* =========================================================
   WILLCONNECT — MIDIAS
========================================================= */

.inbox-midia-imagem,
.inbox-midia-documento,
.inbox-midia-audio {
    display: block;
    margin-bottom: 10px;
}

.inbox-midia-imagem {
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    background: #0f172a;
}

.inbox-midia-imagem img {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.inbox-midia-imagem:hover img {
    transform: scale(1.015);
}

.inbox-midia-documento {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid #dbe4ef;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    color: inherit;
    text-decoration: none;
}

.inbox-midia-documento strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: linear-gradient(135deg, #20B2AA, #2563eb);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.inbox-midia-documento span,
.inbox-midia-audio span {
    overflow: hidden;
    color: #0f172a;
    font-size: 14px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inbox-midia-documento small {
    grid-column: 2;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.inbox-midia-audio {
    display: grid;
    gap: 9px;
    padding: 12px;
    border: 1px solid #dbe4ef;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
}

.inbox-midia-audio audio {
    width: 100%;
}

/* =========================================================
   WILLCONNECT — ETIQUETAS E DEPARTAMENTOS
========================================================= */

.tag-amostra {
    display: inline-flex;
    width: 28px;
    height: 28px;
    border: 3px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.tag-badge,
.departamento-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    width: fit-content;
    padding: 0 10px;
    border: 1px solid color-mix(in srgb, var(--tag-cor, #20B2AA) 35%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--tag-cor, #20B2AA) 14%, #ffffff);
    color: color-mix(in srgb, var(--tag-cor, #20B2AA) 70%, #0f172a);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.departamento-badge {
    border-style: dashed;
}

.inbox-tags-linha,
.classificacao-resumo {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.inbox-classificacao-filtros,
.inbox-classificacao-form {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid #dbe4ef;
    background: rgba(255, 255, 255, 0.72);
}

.inbox-classificacao-form {
    grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr) auto;
    align-items: center;
    padding: 12px 20px;
}

.inbox-classificacao-filtros select,
.inbox-classificacao-form select {
    min-height: 38px;
    width: 100%;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: #334155;
    font-weight: 800;
}

.inbox-classificacao-form select[multiple] {
    min-height: 64px;
    padding: 8px 10px;
}

.inbox-classificacao-form button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(153, 246, 228, 0.32);
    border-radius: 13px;
    background: linear-gradient(135deg, #22c7bb, #17857f);
    color: #ffffff;
    font-weight: 900;
}

/* =========================================================
   WILLCONNECT — OPERADORES E ATRIBUIÇÕES
========================================================= */

.inbox-filtros {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid #dbe4ef;
}

.inbox-filtros a {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #475569;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.inbox-filtros a:hover,
.inbox-filtros a.ativo {
    border-color: rgba(32, 178, 170, 0.28);
    background: #ffffff;
    color: #0f766e;
}

.inbox-operador-resumo {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.inbox-operador-badge,
.inbox-prioridade {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.inbox-operador-badge {
    background: #f1f5f9;
    color: #334155;
}

.inbox-prioridade-baixa {
    background: #e0f2fe;
    color: #0369a1;
}

.inbox-prioridade-normal {
    background: #f1f5f9;
    color: #475569;
}

.inbox-prioridade-alta {
    background: #fef3c7;
    color: #92400e;
}

.inbox-prioridade-urgente {
    background: #fee2e2;
    color: #991b1b;
}

.inbox-atendimento-acoes {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-left: auto;
}

.inbox-atendimento-acoes form {
    margin: 0;
}

.inbox-botao-primario,
.inbox-botao-secundario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 13px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.inbox-botao-primario {
    border: 1px solid rgba(153, 246, 228, 0.32);
    background: linear-gradient(135deg, #22c7bb, #17857f);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(32, 178, 170, 0.20);
}

.inbox-botao-secundario {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
}

/* =========================================================
   WILLCONNECT — REALTIME INBOX
========================================================= */

.inbox-sync-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px 12px;
    border: 1px solid #dbe4ef;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.inbox-sync-status strong {
    color: #0f766e;
    font-size: 12px;
    text-transform: uppercase;
}

.inbox-sync-status small {
    color: #64748b;
    font-weight: 800;
}

.inbox-sync-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.14);
}

.inbox-sync-status[data-estado="atualizando"] .inbox-sync-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.16);
}

.inbox-sync-status[data-estado="erro"] .inbox-sync-dot {
    background: #ef4444;
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.14);
}

.inbox-sync-status[data-estado="erro"] strong {
    color: #b91c1c;
}

.inbox-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    margin-right: 6px;
    padding: 0 7px;
    border-radius: 999px;
    background: #22c55e;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
}

.menu-inbox-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    margin-left: auto;
    padding: 0 7px;
    border-radius: 999px;
    background: #22c55e;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
}

.inbox-conversa-link.tem-nao-lidas {
    border-color: rgba(34, 197, 94, 0.32);
    background: #f0fdf4;
}

.inbox-conversa-link.tem-nao-lidas .inbox-conversa-linha strong {
    color: #166534;
}

.willconnect-inbox.inbox-tem-nova-mensagem {
    box-shadow:
        0 0 0 4px rgba(34, 197, 94, 0.10),
        0 20px 50px rgba(15, 23, 42, 0.08);
}

.inbox-mensagem-nova .inbox-mensagem-bolha {
    animation: inboxNovaMensagem 1.6s ease;
}

@keyframes inboxNovaMensagem {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.35);
        transform: translateY(4px);
    }

    100% {
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
        transform: translateY(0);
    }
}

.inbox-chat-mensagens {
    scroll-behavior: smooth;
}

/* =========================================================
   WILLCONNECT — RESPOSTAS RAPIDAS
========================================================= */

.macro-atalho {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border: 1px solid rgba(32, 178, 170, 0.24);
    border-radius: 999px;
    background: rgba(32, 178, 170, 0.10);
    color: #0f766e;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
}

.inbox-envio-campo {
    position: relative;
}

.respostas-rapidas-dropdown {
    position: absolute;
    right: 10px;
    bottom: calc(100% + 10px);
    z-index: 20;
    width: min(420px, calc(100vw - 42px));
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 250, 0.96));
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(18px);
}

.respostas-rapidas-dropdown button {
    display: grid;
    grid-template-columns: minmax(88px, auto) 1fr auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #0f172a;
    cursor: pointer;
    text-align: left;
    transition: background 0.18s ease, transform 0.18s ease;
}

.respostas-rapidas-dropdown button:hover,
.respostas-rapidas-dropdown button.ativo {
    background: rgba(32, 178, 170, 0.13);
    transform: translateY(-1px);
}

.respostas-rapidas-dropdown strong {
    color: #0f766e;
    font-size: 12px;
    font-weight: 900;
}

.respostas-rapidas-dropdown span {
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.respostas-rapidas-dropdown small {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

/* =========================================================
   WILLCONNECT — SLA E MÉTRICAS
========================================================= */

.sla-badge,
.sla-tempo-fila {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.sla-badge-dentro_prazo,
.sla-card-dentro_prazo {
    border-color: rgba(34, 197, 94, 0.22);
    background: rgba(34, 197, 94, 0.11);
    color: #166534;
}

.sla-badge-alerta,
.sla-card-alerta {
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
}

.sla-badge-atrasado,
.sla-card-atrasado {
    border-color: rgba(239, 68, 68, 0.26);
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
}

.sla-tempo-fila {
    border: 1px solid rgba(100, 116, 139, 0.18);
    background: #f8fafc;
    color: #475569;
}

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

.relatorio-lista {
    display: grid;
    gap: 12px;
}

.relatorio-lista div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.relatorio-lista strong {
    color: #0f172a;
    font-size: 14px;
}

.relatorio-lista span,
.relatorio-lista p {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

/* =========================================================
   WILLCONNECT — AUTOMAÇÕES BÁSICAS
========================================================= */

.automacao-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.automacao-status-ativa {
    border: 1px solid rgba(34, 197, 94, 0.22);
    background: rgba(34, 197, 94, 0.11);
    color: #166534;
}

.automacao-status-inativa {
    border: 1px solid rgba(100, 116, 139, 0.20);
    background: #f8fafc;
    color: #64748b;
}

/* =========================================================
   WILLCONNECT — DISTRIBUIÇÃO AUTOMÁTICA
========================================================= */

.distribuicao-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.distribuicao-badge-ativa,
.distribuicao-badge-auto,
.distribuicao-card {
    border-color: rgba(14, 165, 233, 0.24);
    background: rgba(14, 165, 233, 0.11);
    color: #075985;
}

.distribuicao-badge-inativa {
    border: 1px solid rgba(100, 116, 139, 0.20);
    background: #f8fafc;
    color: #64748b;
}

/* =========================================================
   WILLCONNECT — TEMPLATES META
========================================================= */

.template-status,
.template-inbox-atalho {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.template-status-rascunho {
    border: 1px solid rgba(100, 116, 139, 0.20);
    background: #f8fafc;
    color: #475569;
}

.template-status-enviado_para_meta,
.template-status-pausado {
    border: 1px solid rgba(14, 165, 233, 0.24);
    background: rgba(14, 165, 233, 0.11);
    color: #075985;
}

.template-status-aprovado {
    border: 1px solid rgba(34, 197, 94, 0.22);
    background: rgba(34, 197, 94, 0.11);
    color: #166534;
}

.template-status-rejeitado {
    border: 1px solid rgba(239, 68, 68, 0.24);
    background: rgba(239, 68, 68, 0.11);
    color: #991b1b;
}

.template-ajuda {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.template-meta-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
    gap: 18px;
}

.template-whatsapp-preview {
    padding: 18px;
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(220, 252, 231, 0.86), rgba(236, 253, 245, 0.96));
    color: #14532d;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.55;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.16);
}

.template-whatsapp-preview p {
    margin: 0;
}

.template-variaveis {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.template-variaveis strong {
    width: 100%;
    color: #0f172a;
    font-size: 13px;
}

.template-variaveis span {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(32, 178, 170, 0.11);
    color: #0f766e;
    font-size: 12px;
    font-weight: 900;
}

/* =========================================================
   WILLCONNECT — CONFIGURAÇÃO META
========================================================= */

.meta-config-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.meta-config-ajuda {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.meta-ambiente {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.meta-ambiente-sandbox {
    border: 1px solid rgba(14, 165, 233, 0.24);
    background: rgba(14, 165, 233, 0.11);
    color: #075985;
}

.meta-ambiente-producao {
    border: 1px solid rgba(34, 197, 94, 0.22);
    background: rgba(34, 197, 94, 0.11);
    color: #166534;
}

.meta-config-lista {
    display: grid;
    gap: 14px;
}

.meta-config-lista div {
    display: grid;
    grid-template-columns: minmax(160px, 0.35fr) 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.meta-config-lista span {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.meta-config-lista strong {
    color: #0f172a;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.meta-config-lista button {
    padding: 9px 12px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #20b2aa, #0f766e);
    color: #ffffff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

/* =========================================================
   WILLCONNECT — WEBHOOK META
========================================================= */

.webhook-meta-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.webhook-meta-status-sim {
    border: 1px solid rgba(34, 197, 94, 0.22);
    background: rgba(34, 197, 94, 0.11);
    color: #166534;
}

.webhook-meta-status-nao {
    border: 1px solid rgba(245, 158, 11, 0.24);
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
}

.webhook-meta-checklist {
    display: grid;
    gap: 12px;
}

.webhook-meta-checklist div {
    display: grid;
    grid-template-columns: auto minmax(160px, 0.25fr) 1fr;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.webhook-meta-checklist strong {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #0f766e;
    color: #ffffff;
    font-size: 12px;
}

.webhook-meta-checklist span {
    color: #475569;
    font-size: 13px;
    font-weight: 900;
}

.webhook-meta-checklist code {
    color: #0f172a;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.webhook-meta-resultado {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(32, 178, 170, 0.11);
    color: #0f766e;
    font-size: 13px;
    font-weight: 900;
}

@media (max-width: 900px) {
    .painel-metricas,
    .painel-modulos,
    .crm-form-grid,
    .crm-detalhes,
    .entidade-show-grid {
        grid-template-columns: 1fr;
    }

    .crm-card-topo,
    .crm-form-acoes,
    .entidade-show-secao-topo,
    .entidade-lista-item {
        align-items: stretch;
        flex-direction: column;
    }

    .entidade-lista-item {
        grid-template-columns: 1fr;
    }

    .entidade-lista-badges {
        justify-content: flex-start;
    }

    .crm-botao-primario,
    .crm-botao-secundario {
        width: 100%;
    }

    .crm-paginacao .crm-botao-primario,
    .crm-paginacao .crm-botao-secundario {
        width: auto;
    }

    .crm-conversa-linha,
    .crm-chat-topo,
    .crm-chat-acoes,
    .crm-chat-envio {
        align-items: stretch;
        flex-direction: column;
    }

    .crm-chat-acoes {
        width: 100%;
        margin-left: 0;
    }

    .crm-chat-grid {
        grid-template-columns: 1fr;
    }

    .crm-chat-dados {
        border-left: 0;
        border-top: 1px solid #e2e8f0;
    }

    .crm-mensagem-linha,
    .crm-mensagem-linha.crm-mensagem-saida {
        grid-template-columns: 1fr;
    }

    .crm-mensagem-linha .crm-contato-avatar {
        display: none;
    }

    .crm-mensagem-chat .crm-mensagem-bolha {
        max-width: 100%;
    }

    .willconnect-inbox {
        grid-template-columns: 1fr;
    }

    .inbox-lista {
        border-right: 0;
        border-bottom: 1px solid #dbe4ef;
    }

    .inbox-lista-scroll {
        height: auto;
        max-height: 360px;
    }

    .inbox-chat-topo,
    .inbox-resposta-placeholder {
        align-items: stretch;
        flex-direction: column;
    }

    .inbox-chat-badges {
        justify-content: flex-start;
        margin-left: 0;
    }

    .inbox-chat-mensagens {
        height: 520px;
        padding: 18px;
    }

    .inbox-mensagem-bolha {
        width: 100%;
    }

    .inbox-envio-form {
        grid-template-columns: 1fr;
    }

    .inbox-atendimento-acoes,
    .inbox-atendimento-acoes form,
    .inbox-botao-primario,
    .inbox-botao-secundario {
        width: 100%;
    }

    .respostas-rapidas-dropdown {
        left: 0;
        right: 0;
        width: 100%;
    }

    .respostas-rapidas-dropdown button {
        grid-template-columns: 1fr;
    }

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

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

    .meta-config-lista div {
        grid-template-columns: 1fr;
    }

    .webhook-meta-checklist div {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
WILLY — GERENCIADOR DE FLUXOS
========================================================= */

.willy-fluxo-alerta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-left: 4px solid #38bdf8;
}

.willy-fluxo-metricas {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.willy-fluxo-metrica {
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.willy-fluxo-metrica span,
.willy-fluxo-definicoes dt,
.willy-fluxo-template-topo p,
.willy-fluxo-whatsapp-preview span {
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 700;
}

.willy-fluxo-metrica strong {
    color: #0f172a;
    font-size: 2rem;
    line-height: 1;
}

.willy-fluxo-botao {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.willy-fluxo-vazio {
    padding: 24px;
    color: #64748b;
    text-align: center;
}

.willy-fluxo-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.willy-fluxo-badge-rascunho,
.willy-fluxo-tipo-decisao {
    background: #e0f2fe;
    color: #075985;
}

.willy-fluxo-badge-ativo,
.willy-fluxo-acao-avancar {
    background: #dcfce7;
    color: #166534;
}

.willy-fluxo-badge-pausado,
.willy-fluxo-acao-revisao-humana {
    background: #fef3c7;
    color: #92400e;
}

.willy-fluxo-acao-encaminhar-humano {
    background: #ede9fe;
    color: #5b21b6;
}

.willy-fluxo-acao-encerrar {
    background: #fee2e2;
    color: #991b1b;
}

.willy-fluxo-acao-opt-out,
.willy-fluxo-tipo-opt-out {
    background: #f1f5f9;
    color: #334155;
}

.willy-fluxo-badge-inicial {
    background: #cffafe;
    color: #155e75;
}

.willy-fluxo-detalhe-topo,
.willy-fluxo-etapa-cabecalho,
.willy-fluxo-template-topo {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.willy-fluxo-detalhe-topo h2,
.willy-fluxo-etapa-card h2,
.willy-fluxo-template h3 {
    margin: 8px 0 4px;
}

.willy-fluxo-definicoes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.willy-fluxo-definicoes div {
    min-width: 0;
}

.willy-fluxo-definicoes dd {
    margin: 3px 0 0;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.willy-fluxo-avisos {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.willy-fluxo-aviso {
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
}

.willy-fluxo-validacao-grid,
.willy-fluxo-listas-validacao {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.willy-fluxo-hash,
.willy-fluxo-template code,
.willy-fluxo-tabela code {
    overflow-wrap: anywhere;
    white-space: normal;
}

.willy-fluxo-erro-texto {
    color: #b91c1c;
    font-weight: 800;
}

.willy-fluxo-etapas {
    display: grid;
    gap: 18px;
}

.willy-fluxo-ordem {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-weight: 900;
}

.willy-fluxo-etapa-selos {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.willy-fluxo-definicoes-etapa {
    margin-top: 16px;
}

.willy-fluxo-template {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.willy-fluxo-whatsapp-preview {
    margin: 14px 0;
    padding: 14px;
    border-radius: 8px;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
}

.willy-fluxo-whatsapp-preview pre {
    margin: 10px 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: inherit;
    color: #064e3b;
    line-height: 1.55;
}

.willy-fluxo-opcoes {
    display: grid;
    gap: 12px;
}

.willy-fluxo-opcao {
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.willy-fluxo-opcao dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0 0;
}

.willy-fluxo-opcao dt {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 800;
}

.willy-fluxo-opcao dd {
    margin: 2px 0 0;
    overflow-wrap: anywhere;
}

.willy-fluxo-terminal {
    margin-top: 16px;
    padding: 14px;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
}

.willy-fluxo-publicacoes {
    margin: 0;
    padding-left: 18px;
}

.willy-fluxo-botao:focus-visible,
.willy-fluxo-tabela a:focus-visible,
.willy-fluxo-detalhe-topo a:focus-visible {
    outline: 3px solid #38bdf8;
    outline-offset: 3px;
}

@media (max-width: 1100px) {
    .willy-fluxo-metricas,
    .willy-fluxo-avisos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .willy-fluxo-definicoes,
    .willy-fluxo-opcao dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .willy-fluxo-metricas,
    .willy-fluxo-avisos,
    .willy-fluxo-definicoes,
    .willy-fluxo-validacao-grid,
    .willy-fluxo-listas-validacao,
    .willy-fluxo-opcao dl {
        grid-template-columns: 1fr;
    }

    .willy-fluxo-detalhe-topo,
    .willy-fluxo-etapa-cabecalho,
    .willy-fluxo-template-topo {
        flex-direction: column;
    }

    .willy-fluxo-etapa-selos {
        justify-content: flex-start;
    }

    .willy-fluxo-tabela thead {
        display: none;
    }

    .willy-fluxo-tabela tr,
    .willy-fluxo-tabela td {
        display: block;
        width: 100%;
    }

    .willy-fluxo-tabela tr {
        padding: 14px 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .willy-fluxo-tabela td {
        padding: 8px 0;
    }

    .willy-fluxo-tabela td::before {
        content: attr(data-label);
        display: block;
        color: #64748b;
        font-size: 0.76rem;
        font-weight: 900;
        text-transform: uppercase;
    }
}

/* =========================================================
WILLY — EDIÇÃO DE RASCUNHOS
========================================================= */

/* Árvore administrativa: hierarquia visual sem expor a estrutura técnica. */
.willy-arvore {
    overflow: visible;
}

.willy-arvore-lista {
    display: block;
    margin: 4px 0 0;
    padding: 0;
    overflow: visible;
}

.willy-arvore-item {
    display: block;
    margin-left: calc(var(--willy-nivel, 0) * 32px);
    padding: 5px 0 6px;
    border: 0;
    background: transparent;
}

.willy-arvore-item-cabecalho {
    display: block;
}

.willy-arvore-titulo {
    display: block;
    color: #172033;
    line-height: 1.3;
}

.willy-arvore-acoes {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.willy-arvore-acoes form,
.willy-arvore-rodape form {
    margin: 0;
}

.willy-arvore-acoes .crm-botao-secundario,
.willy-arvore-acoes button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: .82rem;
}

.willy-arvore-adicionar,
.willy-arvore-conteudo {
    margin-top: 10px;
    border: 1px solid #dbeafe;
    border-radius: 9px;
    background: #f8fbff;
    overflow: hidden;
}

.willy-arvore-adicionar > summary,
.willy-arvore-conteudo > summary {
    padding: 10px 12px;
    color: #075985;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 850;
    list-style-position: inside;
}

.willy-arvore-adicionar[open] > summary,
.willy-arvore-conteudo[open] > summary {
    border-bottom: 1px solid #dbeafe;
    background: #eff6ff;
}

.willy-arvore-form {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
}

.willy-arvore-form label {
    display: grid;
    gap: 7px;
    color: #334155;
    font-weight: 800;
}

.willy-arvore-form input,
.willy-arvore-form textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    color: #0f172a;
    font: inherit;
}

.willy-arvore-form textarea {
    min-height: 180px;
    resize: vertical;
}

.willy-arvore-form input:focus,
.willy-arvore-form textarea:focus {
    outline: 3px solid rgba(56, 189, 248, .24);
    border-color: #0ea5e9;
}

.willy-arvore-ajuda {
    margin: -4px 0 0;
    padding: 10px 12px;
    border-left: 3px solid #7dd3fc;
    background: #fff;
    color: #475569;
    font-size: .88rem;
    line-height: 1.5;
}

.willy-arvore-conteudo pre {
    max-height: 360px;
    margin: 0;
    padding: 16px;
    overflow: auto;
    white-space: pre-wrap;
    color: #334155;
    font: inherit;
    line-height: 1.55;
}

.willy-arvore-rodape {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 760px) {
    .willy-arvore-lista {
        display: block;
        margin-inline: 0;
        overflow-x: visible;
    }

    .willy-arvore-acoes {
        width: auto;
    }

    .willy-arvore-form {
        padding: 14px;
    }
}

/* Apresentação final: árvore textual compacta, hierarquia somente por recuo. */
.willy-arvore {
    overflow: visible;
}

.willy-arvore-lista {
    display: block;
    margin: 4px 0 0;
    padding: 0;
    overflow: visible;
}

.willy-arvore-item {
    display: block;
    margin-left: 0;
    padding: 5px 0 6px calc(var(--willy-nivel, 0) * 32px);
    border: 0;
    border-radius: 0;
    background: transparent;
    background-image: repeating-linear-gradient(
        to right,
        transparent 0,
        transparent 15px,
        #cbd5e1 15px,
        #cbd5e1 16px,
        transparent 16px,
        transparent 32px
    );
    background-position: left top;
    background-repeat: no-repeat;
    background-size: calc(var(--willy-nivel, 0) * 32px) 100%;
    box-shadow: none;
}

.willy-arvore-item-cabecalho {
    display: block;
}

.willy-arvore-titulo {
    gap: 5px;
    color: #172033;
    font-size: .94rem;
    line-height: 1.3;
}

.willy-arvore-item-terminal .willy-arvore-titulo,
.willy-arvore-item-retorno .willy-arvore-titulo {
    color: #475569;
    font-weight: 700;
}

.willy-arvore-nivel-1 .willy-arvore-titulo {
    color: #7c3aed;
    font-weight: 900;
}

.willy-arvore-nivel-2 .willy-arvore-titulo {
    color: #0369a1;
    font-weight: 850;
}

.willy-arvore-nivel-3 .willy-arvore-titulo {
    color: #0f766e;
    font-weight: 800;
}

.willy-arvore-nivel-4 .willy-arvore-titulo {
    color: #475569;
    font-weight: 750;
}

.willy-arvore-item-terminal .willy-arvore-titulo,
.willy-arvore-item-retorno .willy-arvore-titulo {
    color: #64748b;
    font-weight: 700;
}

.willy-arvore-acoes {
    gap: 6px;
    width: auto;
}

.willy-arvore-acoes .willy-arvore-botao,
.willy-arvore-resumo-acoes .willy-arvore-botao,
.willy-arvore-acoes .crm-botao-secundario,
.willy-arvore-acoes button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 3px 8px;
    border: 1px solid #bae6fd;
    border-radius: 5px;
    background: #f0f9ff;
    color: #0369a1;
    font-size: .75rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
}

.willy-arvore-acoes .willy-arvore-botao:hover,
.willy-arvore-resumo-acoes .willy-arvore-botao:hover {
    border-color: #7dd3fc;
    background: #e0f2fe;
    color: #075985;
    text-decoration: none;
}

.willy-arvore-acoes .willy-arvore-botao-excluir {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.willy-arvore-acoes .willy-arvore-botao-excluir:hover {
    border-color: #fca5a5;
    background: #fee2e2;
    color: #991b1b;
}

.willy-arvore-adicionar,
.willy-arvore-conteudo {
    max-width: 680px;
    margin: 5px 0 0 20px;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.willy-arvore-resumo {
    padding-left: 12px;
    border-left: 1px solid #cbd5e1;
}

.willy-arvore-adicionar > summary,
.willy-arvore-conteudo > summary {
    padding: 2px 0;
    color: #334155;
    font-size: .84rem;
    font-weight: 800;
    list-style-position: outside;
}

.willy-arvore-adicionar[open] > summary,
.willy-arvore-conteudo[open] > summary {
    border: 0;
    background: transparent;
}

.willy-arvore-adicionar > summary {
    display: inline-block;
    padding: 4px 9px;
    border: 1px solid #fde68a;
    border-radius: 5px;
    background: #fef3c7;
    color: #78350f;
}

.willy-arvore-resumo-acoes {
    display: inline-flex;
    gap: 6px;
    margin: 3px 0 4px;
}

.willy-arvore-conteudo pre {
    max-height: 260px;
    margin: 5px 0 0;
    padding: 10px 12px;
    border-left: 2px solid #cbd5e1;
    background: #f8fafc;
    font-size: .84rem;
}

.willy-arvore-form {
    gap: 10px;
    margin-top: 6px;
    padding: 12px 0 8px 12px;
    border-left: 2px solid #bae6fd;
}

.willy-arvore-form textarea {
    min-height: 130px;
}

.willy-arvore-ajuda {
    padding: 7px 9px;
    font-size: .8rem;
}

.willy-arvore-rodape {
    display: block;
    margin-top: 8px;
    padding-top: 10px;
}

.willy-rascunho-opcao-card:target {
    border-color: #0ea5e9;
    outline: 3px solid rgba(14, 165, 233, .18);
}

@media (max-width: 760px) {
    .willy-arvore-item {
        margin-left: 0;
        padding-left: calc(var(--willy-nivel, 0) * 32px);
    }
}

.willy-fluxo-edicao-aviso,
.willy-rascunho-topo,
.willy-rascunho-arquivar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.willy-fluxo-edicao-aviso {
    margin: 14px 0;
    padding: 12px;
    border: 1px solid rgba(14, 165, 233, 0.28);
    border-radius: 8px;
    background: rgba(14, 165, 233, 0.08);
    color: #075985;
    font-weight: 800;
}

.willy-fluxo-edicao-aviso form {
    margin: 0;
}

.willy-rascunho-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 18px;
    align-items: start;
}

.willy-rascunho-form,
.willy-rascunho-campo,
.willy-rascunho-opcoes,
.willy-rascunho-efeitos,
.willy-rascunho-arquivar form {
    display: grid;
    gap: 12px;
}

.willy-rascunho-campo span {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 800;
}

.willy-rascunho-form input,
.willy-rascunho-form textarea,
.willy-rascunho-form select,
.willy-rascunho-arquivar input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    color: #0f172a;
    font: inherit;
}

.willy-rascunho-form textarea {
    resize: vertical;
}

.willy-rascunho-imagem {
    margin-bottom: 4px;
}

.willy-rascunho-imagem > input[type="file"] {
    padding: 9px;
    border-style: dashed;
    background: #f8fafc;
}

.willy-rascunho-imagem-preview {
    display: grid;
    gap: 10px;
    justify-items: start;
}

.willy-rascunho-imagem-preview[hidden] {
    display: none;
}

.willy-rascunho-imagem-preview img,
.willy-fluxo-whatsapp-preview > img {
    display: block;
    width: auto;
    max-width: min(100%, 520px);
    max-height: 320px;
    border-radius: 8px;
    object-fit: contain;
}

.willy-fluxo-whatsapp-preview > img[hidden] {
    display: none;
}

.willy-botao-perigo-suave {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.willy-rascunho-form input:focus,
.willy-rascunho-form textarea:focus,
.willy-rascunho-form select:focus,
.willy-rascunho-arquivar input:focus {
    outline: 3px solid rgba(56, 189, 248, 0.34);
    border-color: #0ea5e9;
}

.willy-rascunho-preview {
    position: sticky;
    top: 16px;
}

.willy-rascunho-opcao-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.willy-rascunho-opcao-inativa {
    border-style: dashed;
    background: #f8fafc;
    opacity: 0.82;
}

.willy-rascunho-opcao-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.willy-rascunho-opcao-topo strong {
    color: #0f172a;
}

.willy-rascunho-opcao-topo label,
.willy-rascunho-efeitos label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-weight: 800;
}

.willy-rascunho-opcao-topo input,
.willy-rascunho-efeitos input {
    width: auto;
}

.willy-rascunho-opcao-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.willy-rascunho-efeitos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.willy-rascunho-efeitos strong {
    grid-column: 1 / -1;
}

.willy-rascunho-acoes {
    margin-top: 18px;
}

.willy-rascunho-arquivar {
    margin-top: 22px;
    border-left: 4px solid #f59e0b;
}

.willy-rascunho-arquivar form {
    min-width: min(360px, 100%);
}

@media (max-width: 980px) {
    .willy-rascunho-grid,
    .willy-rascunho-opcao-grid,
    .willy-rascunho-efeitos {
        grid-template-columns: 1fr;
    }

    .willy-rascunho-preview {
        position: static;
    }
}

@media (max-width: 700px) {
    .willy-fluxo-edicao-aviso,
    .willy-rascunho-topo,
    .willy-rascunho-arquivar,
    .willy-rascunho-opcao-topo {
        align-items: stretch;
        flex-direction: column;
    }

    .willy-rascunho-acoes .crm-botao-primario,
    .willy-rascunho-acoes .crm-botao-secundario,
    .willy-fluxo-edicao-aviso .crm-botao-primario,
    .willy-fluxo-edicao-aviso .crm-botao-secundario,
    .willy-fluxo-edicao-aviso button {
        width: 100%;
    }
}
/* =========================================================
WILLCONNECT — TRAVAS OPERACIONAIS WILLY
========================================================= */

.primeiro-contato-willy-guard {
    border-color: rgba(245, 158, 11, 0.35);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0.04));
}

.primeiro-contato-willy-guard span {
    display: block;
    margin-top: 6px;
}

.willy-envio-desativado form[action*="autorizar"],
.willy-envio-desativado form[action*="enviar"] {
    display: none !important;
}

/* =========================================================
WILLCONNECT — ATENDIMENTO RECEPTIVO WILLY
========================================================= */

.willy-inbound-alerta {
    border-color: rgba(14, 165, 233, 0.28);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(15, 23, 42, 0.04));
}

.willy-inbound-alerta span {
    display: block;
    margin-top: 6px;
}

.willy-inbound-metricas,
.willy-inbound-menu-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.willy-inbound-metricas {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.willy-inbound-metrica span,
.willy-inbound-detalhes span {
    color: #64748b;
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
}

.willy-inbound-metrica strong {
    color: #0f172a;
    display: block;
    font-size: 1.7rem;
    margin-top: 6px;
}

.willy-inbound-topo {
    align-items: center;
}

.willy-inbound-badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 900;
    padding: 6px 10px;
    text-transform: uppercase;
}

.willy-inbound-badge-aguardando_opcao_menu_inicial {
    background: #e0f2fe;
    color: #075985;
}

.willy-inbound-badge-encaminhar_humano {
    background: #fef3c7;
    color: #92400e;
}

.willy-inbound-badge-encerrado,
.willy-inbound-badge-opt_out {
    background: #e2e8f0;
    color: #334155;
}

.willy-inbound-badge-opcao_invalida {
    background: #fee2e2;
    color: #991b1b;
}

.willy-inbound-vazio {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    padding: 18px;
}

.willy-inbound-detalhes,
.willy-inbound-opcoes,
.willy-inbound-avisos {
    display: grid;
    gap: 12px;
}

.willy-inbound-detalhes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 18px 0;
}

.willy-inbound-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #0f172a;
    line-height: 1.58;
    padding: 18px;
}

.willy-inbound-opcao {
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px;
}

.willy-inbound-opcao strong {
    background: #0f172a;
    border-radius: 8px;
    color: #fff;
    min-width: 42px;
    padding: 7px 10px;
    text-align: center;
}

.willy-inbound-avisos {
    margin-top: 18px;
}

.willy-inbound-avisos span {
    background: #fff7ed;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    color: #7c2d12;
    font-weight: 800;
    padding: 10px 12px;
}

.willy-inbound-editor-opcoes {
    display: grid;
    gap: 14px;
}

.willy-inbound-opcao-editor {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
}

.willy-inbound-opcao-editor legend {
    color: #0f172a;
    font-weight: 900;
    padding: 0 6px;
}

.willy-inbound-opcao-editor label,
.willy-inbound-inline-form {
    display: grid;
    gap: 6px;
}

.willy-inbound-opcao-editor label span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 900;
}

.willy-inbound-opcao-editor input,
.willy-inbound-opcao-editor select,
.willy-inbound-inline-form input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 8px;
    padding: 10px 11px;
}

.willy-inbound-check {
    align-items: center;
    display: flex !important;
    flex-direction: row;
    gap: 8px;
}

.willy-inbound-check input {
    width: auto;
}

.willy-inbound-inline-form {
    margin-top: 14px;
    max-width: 620px;
}

@media (max-width: 980px) {
    .willy-inbound-metricas,
    .willy-inbound-menu-grid,
    .willy-inbound-detalhes,
    .willy-inbound-opcao-editor {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .willy-inbound-topo,
    .willy-inbound-opcao {
        align-items: stretch;
        flex-direction: column;
    }
}

/* =========================================================
WILLCONNECT — TIMELINE DA INBOX CRM EM FORMATO DE CHAT
========================================================= */

.crm-chat {
    background: #f1f5f9;
    border: 1px solid #dbe3ed;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 18px;
}

.crm-chat-scroll {
    height: clamp(320px, 60vh, 680px);
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
}

.crm-chat-nova-mensagem {
    align-self: center;
    background: #0f6f9f;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
    color: #ffffff;
    cursor: pointer;
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    margin: -18px auto 4px;
    padding: 8px 14px;
    position: relative;
    z-index: 1;
}

.crm-chat-nova-mensagem[hidden] {
    display: none;
}

.crm-mensagem {
    display: flex;
    min-width: 0;
    width: 100%;
}

.crm-mensagem-entrada {
    justify-content: flex-start;
}

.crm-mensagem-saida {
    justify-content: flex-end;
}

.crm-mensagem-balao {
    border: 1px solid transparent;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    display: grid;
    gap: 7px;
    max-width: 72%;
    min-width: 0;
    padding: 12px 14px;
    width: fit-content;
}

.crm-mensagem-entrada .crm-mensagem-balao {
    background: #ffffff;
    border-color: #d9e2ec;
    color: #172033;
    border-bottom-left-radius: 4px;
}

.crm-mensagem-saida .crm-mensagem-balao {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #0c4a6e;
    border-bottom-right-radius: 4px;
}

.crm-mensagem-origem {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.crm-mensagem-entrada .crm-mensagem-origem {
    color: #475569;
}

.crm-mensagem-saida .crm-mensagem-origem {
    color: #0369a1;
}

.crm-mensagem-conteudo {
    font-size: 0.94rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.crm-mensagem-meta {
    align-items: center;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.7rem;
    gap: 5px 10px;
}

.crm-mensagem-meta span + span::before {
    content: "•";
    margin-right: 10px;
}

.crm-chat-vazio {
    color: #64748b;
    margin: 0;
    padding: 18px;
    text-align: center;
}

@media (max-width: 700px) {
    .crm-chat {
        padding: 12px;
    }

    .crm-mensagem-balao {
        max-width: 85%;
    }

    .crm-chat-scroll {
        height: clamp(280px, 52vh, 520px);
    }
}

.willy-campo-erro {
    display: block;
    margin-top: 0.35rem;
    color: #a33f4b;
    font-size: 0.82rem;
    font-weight: 600;
}

.willy-rascunho-opcao-card input[aria-invalid="true"] {
    border-color: #c86875;
    box-shadow: 0 0 0 2px rgba(200, 104, 117, 0.12);
}
/* Modal de publicação da Willy */
.willy-publicar-dialog {
    width: min(42.5rem, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 1rem;
    overflow: hidden;
}

.willy-publicar-dialog::backdrop {
    background: rgba(22, 18, 32, 0.52);
    backdrop-filter: blur(2px);
}

.willy-publicar-dialog-form {
    display: grid;
    gap: 1.15rem;
    padding: 1.75rem;
}

.willy-publicar-dialog-form h2,
.willy-publicar-dialog-form p {
    margin: 0;
}

.willy-publicar-dialog-campo {
    display: grid;
    gap: 0.5rem;
    font-weight: 700;
}

.willy-publicar-dialog-campo textarea {
    width: 100%;
    min-height: 6rem;
    padding: 0.8rem 0.9rem;
    box-sizing: border-box;
    resize: vertical;
    border: 1px solid #d7d1df;
    border-radius: 0.65rem;
    font: inherit;
    font-weight: 400;
}

.willy-publicar-dialog-campo textarea:focus {
    border-color: #7a6595;
    outline: 3px solid rgba(122, 101, 149, 0.14);
}

.willy-publicar-dialog-confirmacao {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    line-height: 1.45;
}

.willy-publicar-dialog-confirmacao input {
    flex: 0 0 auto;
    margin-top: 0.2rem;
}

.willy-publicar-dialog-acoes {
    justify-content: flex-end;
    margin-top: 0.15rem;
}

@media (max-width: 520px) {
    .willy-publicar-dialog {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
    }

    .willy-publicar-dialog-form {
        gap: 1rem;
        padding: 1.25rem;
    }

    .willy-publicar-dialog-acoes {
        flex-wrap: wrap;
    }
}


/* =========================================================
WILLY — CARD DE NOVA OPÇÃO DO EDITOR
========================================================= */

.willy-rascunho-opcao-card-nova .willy-nova-opcao-acoes {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-left: auto;
}

.willy-rascunho-opcao-card-nova .willy-nova-opcao-acoes span {
    color: #64748b;
    font-size: 0.88rem;
}

.willy-rascunho-opcao-card-nova .willy-rascunho-novo-conteudo {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
    gap: 12px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.willy-rascunho-opcao-card-nova .willy-rascunho-novo-conteudo[hidden] {
    display: none;
}

.willy-rascunho-opcao-card-nova .willy-rascunho-novo-conteudo small {
    grid-column: 1 / -1;
    color: #64748b;
}

.willy-rascunho-opcao-card-nova .willy-rascunho-efeitos summary {
    cursor: pointer;
    font-weight: 800;
    color: #334155;
}

.willy-rascunho-opcao-card-nova .willy-rascunho-efeitos[open] {
    display: grid;
    gap: 12px;
    padding-top: 4px;
}

@media (max-width: 980px) {
    .willy-rascunho-opcao-card-nova .willy-rascunho-novo-conteudo {
        grid-template-columns: 1fr;
    }

    .willy-rascunho-opcao-card-nova .willy-rascunho-novo-conteudo small {
        grid-column: auto;
    }
}

@media (max-width: 700px) {
    .willy-rascunho-opcao-card-nova .willy-nova-opcao-acoes {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
        margin-left: 0;
    }

    .willy-rascunho-opcao-card-nova .willy-nova-opcao-acoes .crm-botao-secundario {
        width: 100%;
    }
}
