/* GeSS — Widget do chatbot (bolha flutuante + painel de chat).
   Usa as mesmas variáveis de tema de nrdesk.css (--nr-primary etc.) — ver :root lá. */

.nr-chatbot-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1030; /* abaixo dos modais do Bootstrap (backdrop 1050/dialog 1055) — um modal aberto cobre o widget */
    font-family: inherit;
}

.nr-chatbot-bubble {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: var(--nr-gradient);
    color: #fff;
    font-size: 1.4rem;
    box-shadow: 0 8px 24px rgba(0, 120, 212, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .15s ease;
}
.nr-chatbot-bubble:hover { transform: scale(1.06); }
.nr-chatbot-widget.nr-chatbot-aberto .nr-chatbot-bubble { display: none; }

.nr-chatbot-panel {
    display: none;
    flex-direction: column;
    position: absolute;
    right: 0;
    bottom: 0;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(31, 36, 48, .22);
    overflow: hidden;
}
.nr-chatbot-widget.nr-chatbot-aberto .nr-chatbot-panel { display: flex; }

.nr-chatbot-header {
    background: var(--nr-gradient);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.nr-chatbot-icon-btn {
    background: rgba(255,255,255,.18);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
}
.nr-chatbot-icon-btn:hover { background: rgba(255,255,255,.3); }

.nr-chatbot-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px 16px;
}

.nr-chatbot-texto-ajuda {
    font-size: .82rem;
    color: var(--nr-gray);
    margin-bottom: 10px;
}

.nr-chatbot-tabs .nav-link {
    font-size: .82rem;
    padding: 6px 10px;
}

.nr-chatbot-status {
    font-size: .78rem;
    color: var(--nr-gray);
}

/* ---- Menu ---- */
.nr-chatbot-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 8px;
    border-radius: 8px;
    cursor: pointer;
    border-bottom: 1px solid var(--nr-card-border);
}
.nr-chatbot-item:hover { background: var(--nr-primary-light); }
.nr-chatbot-item .titulo { font-weight: 600; font-size: .85rem; color: var(--nr-dark); }
.nr-chatbot-item .descricao { font-size: .75rem; color: var(--nr-gray); }

/* ---- Conversa (chat log) ---- */
.nr-chatbot-log {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.nr-chatbot-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: .83rem;
    line-height: 1.4;
    white-space: pre-wrap;
}
.nr-chatbot-msg-bot {
    align-self: flex-start;
    background: var(--nr-bg);
    color: var(--nr-dark);
    border-bottom-left-radius: 2px;
}
.nr-chatbot-msg-usuario {
    align-self: flex-end;
    background: var(--nr-gradient);
    color: #fff;
    border-bottom-right-radius: 2px;
}
.nr-chatbot-msg-erro {
    align-self: flex-start;
    background: #fee2e2;
    color: var(--nr-danger);
    border-bottom-left-radius: 2px;
}
.nr-chatbot-msg-sucesso {
    align-self: flex-start;
    background: #dcfce7;
    color: var(--nr-success);
    border-bottom-left-radius: 2px;
    font-weight: 600;
}

.nr-chatbot-opcoes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.nr-chatbot-opcoes .btn { font-size: .78rem; }

.nr-chatbot-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--nr-card-border);
    padding: 10px 12px;
    display: flex;
    gap: 8px;
}

@media (max-width: 420px) {
    .nr-chatbot-widget { right: 12px; bottom: 12px; }
    .nr-chatbot-panel { width: calc(100vw - 24px); }
}
