/* Help Desk Shop Analytic — E2 (11/10/2026)
   Base: AdminLTE 2 + Bootstrap 3.3.7 + Font Awesome 4 + Source Sans Pro (mesmo padrão do sistema, skin-blue).
   Só classes próprias com prefixo hd- (nunca sobrescrever AdminLTE/Bootstrap global sem escopo .hd-app). */

/* ---------- Casca ---------- */
.hd-app { font-size: 14px; }
.hd-app .main-header .logo .hd-logo-sub { font-size: 13px; font-weight: 400; opacity: .85; margin-left: 2px; }
.hd-app .hd-navbar-titulo { color: #fff; font-size: 16px; font-weight: 600; line-height: 50px; padding-left: 4px; }
.hd-app .hd-nav-usuario { display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 12px; color: #fff; }
.hd-app .hd-nav-nome { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-app .hd-form-sair { margin: 0; }
.hd-app .hd-btn-sair { background: transparent; border: 0; color: #fff; height: 50px; min-width: 50px; padding: 0 15px; font-size: 14px; }
.hd-app .hd-btn-sair:hover, .hd-app .hd-btn-sair:focus { background: rgba(0, 0, 0, .1); outline: 2px solid rgba(255, 255, 255, .6); outline-offset: -2px; }
.hd-avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
    background: #fff; color: #3c8dbc; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.hd-avatar-lg { width: 45px; height: 45px; font-size: 16px; }
.hd-app .hd-user-panel .info { padding-top: 8px; }
.hd-app .hd-user-panel .info p { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-app .hd-user-tipo { font-size: 11px; color: #b8c7ce; }
.hd-app .hd-footer { font-size: 13px; color: #777; }
.hd-pular:focus { position: absolute; z-index: 2000; top: 8px; left: 8px; background: #fff; padding: 8px 12px; }

/* foco visível (acessibilidade) */
.hd-app a:focus-visible, .hd-app button:focus-visible, .hd-app .btn:focus-visible,
.hd-app .form-control:focus-visible, .hd-login a:focus-visible, .hd-login .btn:focus-visible { outline: 2px solid #3c8dbc; outline-offset: 2px; }

/* ---------- Componentes ---------- */
.hd-selo-status { display: inline-block; font-size: 12px; padding: 4px 8px; font-weight: 600; white-space: nowrap; }
.hd-rotulo { font-size: 12px; color: #777; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.hd-muted { color: #777; }
.hd-protocolo { font-weight: 600; color: #3c8dbc; white-space: nowrap; }
.hd-vazio { text-align: center; padding: 36px 16px; color: #666; }
.hd-vazio .fa { font-size: 40px; color: #c5d3dc; display: block; margin-bottom: 10px; }
.hd-vazio p { margin: 0 0 14px; font-size: 15px; }
.hd-acoes-topo { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.hd-acoes-topo .btn { display: inline-flex; align-items: center; gap: 6px; }
.hd-truncar-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hd-app .table > tbody > tr > td { vertical-align: middle; }
.hd-linha-link { cursor: pointer; }
.hd-app .table-hover > tbody > tr.hd-linha-link:hover { background: #f4f8fb; }
.hd-app .alert .fa { margin-right: 6px; }
.hd-ajuda { color: #3c8dbc; cursor: help; margin-left: 4px; }

/* Contadores (cards de contagem: faixa colorida lateral, padrão do sistema) */
.hd-contadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 15px; }
.hd-contador { display: flex; flex-direction: column; justify-content: center; background: #fff; border-radius: 3px; border-left: 4px solid #d2d6de;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .1); padding: 10px 14px; min-height: 64px; color: #333; text-decoration: none; }
.hd-contador:hover, .hd-contador:focus { color: #333; text-decoration: none; background: #f9fbfc; }
.hd-contador.ativo { box-shadow: 0 0 0 2px #3c8dbc inset; }
.hd-contador-numero { font-size: 22px; font-weight: 700; line-height: 1.1; }
.hd-contador-rotulo { font-size: 13px; color: #666; }
.hd-cor-primary { border-left-color: #3c8dbc; } .hd-cor-info { border-left-color: #00c0ef; }
.hd-cor-warning { border-left-color: #f39c12; } .hd-cor-success { border-left-color: #00a65a; }
.hd-cor-danger { border-left-color: #dd4b39; } .hd-cor-default { border-left-color: #d2d6de; }
.hd-cor-purple { border-left-color: #605ca8; }

/* Abas de status (chips) da lista do cliente */
.hd-abas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.hd-abas .btn { border-radius: 16px; }
.hd-abas .badge { margin-left: 4px; }

/* Lista em card (celular) */
.hd-cards { list-style: none; margin: 0; padding: 0; }
.hd-card-item { display: block; border: 1px solid #e3e7ea; border-left: 4px solid #d2d6de; border-radius: 3px; background: #fff;
    padding: 12px 14px; margin-bottom: 10px; color: #333; text-decoration: none; }
.hd-card-item:hover, .hd-card-item:focus { color: #333; text-decoration: none; background: #f9fbfc; }
.hd-card-topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.hd-card-assunto { font-size: 16px; font-weight: 600; margin: 2px 0 4px; }
.hd-card-meta { font-size: 13px; color: #777; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.hd-card-acoes { display: flex; gap: 6px; margin-top: 10px; }
.hd-card-acoes > * { flex: 1 1 0; min-width: 0; }
.hd-card-acoes form { margin: 0; }
.hd-card-acoes .btn { width: 100%; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* Filtros recolhíveis */
.hd-filtros-toggle { text-align: left; min-height: 40px; }
.hd-filtros-toggle .hd-seta { transition: transform .15s; }
.hd-filtros-toggle[aria-expanded="true"] .hd-seta { transform: rotate(180deg); }
.hd-filtros .form-group { margin-bottom: 10px; }
.hd-busca { display: flex; gap: 6px; }
.hd-busca .form-control { flex: 1; min-width: 0; }

/* ---------- Abrir chamado ---------- */
.hd-form .form-group > label { font-weight: 600; display: block; }
.hd-form .help-block { font-size: 13px; }
.hd-obrig { color: #dd4b39; }
.hd-contador-chars { float: right; font-size: 12px; color: #999; font-weight: 400; }
.hd-anexar { display: flex; gap: 8px; flex-wrap: wrap; }
.hd-anexar .btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.hd-input-arquivo { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.hd-previas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hd-previa { position: relative; width: 84px; border: 1px solid #ddd; border-radius: 3px; background: #fff; padding: 4px; text-align: center; font-size: 11px; }
.hd-previa img { width: 74px; height: 74px; object-fit: cover; border-radius: 2px; display: block; }
.hd-previa .hd-previa-icone { width: 74px; height: 74px; display: flex; align-items: center; justify-content: center; font-size: 30px; color: #999; background: #f4f4f4; }
.hd-previa .hd-previa-nome { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.hd-previa.hd-previa-erro { border-color: #dd4b39; color: #dd4b39; }
.hd-previa-remover { position: absolute; top: -10px; right: -10px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: #dd4b39; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 13px; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.hd-dicas { margin: 0; padding-left: 18px; color: #555; }
.hd-dicas li { margin-bottom: 6px; }

/* ---------- Conversa (chat) ---------- */
.hd-chamado-resumo { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 13px; color: #666; }
.hd-chamado-resumo strong { color: #333; font-weight: 600; }
.hd-chat { padding: 4px 2px; }
.hd-chat-dia { text-align: center; margin: 10px 0; }
.hd-chat-dia span { background: #eef2f5; color: #777; font-size: 12px; padding: 3px 10px; border-radius: 10px; }
.hd-msg { display: flex; gap: 8px; margin-bottom: 14px; align-items: flex-end; }
.hd-msg-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; background: #d2d6de; color: #444; }
.hd-msg-corpo { max-width: 78%; min-width: 0; }
.hd-msg-bolha { padding: 9px 12px; border-radius: 10px; background: #f4f4f4; color: #333; word-wrap: break-word; overflow-wrap: anywhere; line-height: 1.45; }
.hd-msg-autor { font-size: 12px; color: #777; margin: 0 4px 3px; }
.hd-msg-autor strong { color: #444; }
.hd-msg-hora { font-size: 11px; color: #999; margin: 3px 4px 0; }
/* minha mensagem: à direita, azul da marca */
.hd-msg.hd-msg-minha { flex-direction: row-reverse; }
.hd-msg.hd-msg-minha .hd-msg-corpo { text-align: right; }
.hd-msg.hd-msg-minha .hd-msg-bolha { background: #3c8dbc; color: #fff; text-align: left; border-bottom-right-radius: 2px; }
.hd-msg.hd-msg-minha .hd-msg-avatar { background: #3c8dbc; color: #fff; }
.hd-msg:not(.hd-msg-minha) .hd-msg-bolha { border-bottom-left-radius: 2px; }
/* atendente (visão do cliente) */
.hd-msg.hd-msg-equipe .hd-msg-avatar { background: #3c8dbc; color: #fff; }
.hd-msg.hd-msg-equipe .hd-msg-bolha { background: #ecf4f9; border: 1px solid #d6e6f0; }
/* resposta automática (IA — pronto para a E3) */
.hd-msg.hd-msg-ia .hd-msg-avatar { background: #605ca8; color: #fff; }
.hd-msg.hd-msg-ia .hd-msg-bolha { background: #f3f2fa; border: 1px solid #dddbef; }
.hd-selo-ia { display: inline-block; background: #605ca8; color: #fff; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 3px; margin-left: 4px; }
.hd-ia-feedback { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: #555; }
.hd-ia-aviso { font-size: 11px; color: #888; margin-top: 4px; }
/* nota interna (só equipe) */
.hd-msg.hd-msg-nota .hd-msg-bolha { background: #fcf8e3; border: 1px dashed #f0c36d; color: #6b4e16; }
.hd-msg.hd-msg-nota .hd-msg-avatar { background: #f39c12; color: #fff; }
/* evento de sistema */
.hd-msg-sistema { text-align: center; font-size: 12px; color: #777; margin: 8px 0 14px; }
.hd-msg-sistema span { background: #f4f4f4; border-radius: 10px; padding: 3px 10px; display: inline-block; }
.hd-msg-anexos { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.hd-anexo { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; min-height: 36px; border-radius: 3px; background: rgba(255, 255, 255, .85);
    border: 1px solid #e1e5e8; color: #3c8dbc; font-size: 13px; max-width: 100%; text-align: left; }
.hd-anexo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-anexo small { color: #999; flex-shrink: 0; }
.hd-msg-minha .hd-anexo { background: rgba(255, 255, 255, .95); }

/* desktop: histórico com rolagem própria, resposta sempre à vista */
@media (min-width: 992px) {
    .hd-chat[data-rolar] { max-height: 58vh; overflow-y: auto; padding-right: 6px; }
}

/* rodapé de resposta (fixo no fim da tela ao rolar) */
.hd-responder { position: sticky; bottom: 0; z-index: 5; background: #fff; border-top: 1px solid #e3e7ea; box-shadow: 0 -2px 6px rgba(0, 0, 0, .06);
    padding: 10px; margin: 0 -10px -10px; }
.hd-responder-linha { display: flex; gap: 8px; align-items: flex-end; }
.hd-responder textarea { flex: 1; min-width: 0; resize: vertical; min-height: 44px; max-height: 40vh; font-size: 16px; }
.hd-responder .btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.hd-responder .hd-previas { margin-top: 8px; }
.hd-responder-encerrado { font-size: 13px; color: #777; margin-bottom: 6px; }
.hd-tabs-resposta { display: flex; gap: 6px; margin-bottom: 8px; }
.hd-tabs-resposta .btn { min-height: 36px; }
.hd-responder.hd-modo-nota { background: #fcf8e3; }
.hd-responder.hd-modo-nota textarea { border-color: #f0c36d; }

/* painel lateral (equipe) */
.hd-dados dt { font-size: 12px; color: #777; font-weight: 400; text-transform: uppercase; letter-spacing: .03em; }
.hd-dados dd { margin-bottom: 10px; word-wrap: break-word; }
.hd-acao-form { margin-bottom: 10px; }
.hd-acao-form label { font-size: 12px; color: #777; font-weight: 400; text-transform: uppercase; letter-spacing: .03em; }
.hd-historico { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.hd-historico li { padding: 6px 0; border-bottom: 1px solid #f0f0f0; }
.hd-historico li:last-child { border-bottom: 0; }

/* ---------- Login ---------- */
.hd-login { background: #ecf0f5; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px 12px; font-size: 14px; }
.hd-login-box { width: 100%; max-width: 400px; }
.hd-login-logo { text-align: center; margin-bottom: 18px; }
.hd-login-logo img { width: 230px; max-width: 70%; height: auto; }
.hd-login-card { background: #fff; border-top: 3px solid #3c8dbc; border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); padding: 24px 22px 20px; }
.hd-login-card h1 { font-size: 22px; margin: 0 0 4px; font-weight: 600; color: #333; }
.hd-login-card .hd-login-sub { color: #777; margin: 0 0 18px; }
.hd-login-card .form-control { height: 44px; font-size: 16px; }
.hd-login-card .input-group-addon { min-width: 44px; }
.hd-login-card .btn-lg { min-height: 46px; font-size: 16px; }
.hd-login-rodape { text-align: center; margin-top: 16px; font-size: 13px; color: #777; }
.hd-login-rodape a { display: inline-block; padding: 10px 6px; }
.hd-login-selo { display: inline-block; font-size: 12px; font-weight: 600; color: #3c8dbc; background: #ecf4f9; border-radius: 3px; padding: 3px 8px; margin-bottom: 10px; }
.hd-login-selo.hd-equipe { color: #fff; background: #605ca8; }

/* ---------- Celular e tablet ---------- */
@media (max-width: 767px) {
    .hd-fechado-xs { display: none; }
    .hd-app .content-header { padding: 12px 12px 0; }
    .hd-app .content-header > h1 { font-size: 20px; }
    .hd-app .content-header > .breadcrumb { display: none; }
    .hd-app .content { padding: 10px; }
    .hd-app .btn { min-height: 40px; }
    .hd-app .btn-xs, .hd-app .btn-sm { min-height: 40px; min-width: 40px; }
    .hd-app .form-control { height: 42px; font-size: 16px; }
    .hd-app textarea.form-control { height: auto; }
    .hd-app .hd-acoes-topo { justify-content: stretch; }
    .hd-app .hd-acoes-topo .btn { flex: 1; justify-content: center; }
    .hd-contadores { grid-template-columns: repeat(2, 1fr); }
    .hd-msg-corpo { max-width: 86%; }
    .hd-msg-avatar { width: 28px; height: 28px; font-size: 11px; }
    .hd-abas .btn { flex: 1 1 auto; }
    .hd-ia-feedback > span { flex-basis: 100%; }
    .hd-ia-feedback .btn { flex: 1; }
    .hd-app .main-footer { padding: 10px; }
    .hd-app .sidebar-menu > li > a { padding-top: 13px; padding-bottom: 13px; }
    .hd-app .table-responsive { border: 0; }
}
@media (min-width: 768px) and (max-width: 1280px) {
    .hd-app .btn { min-height: 36px; }
    .hd-app .form-control { height: 36px; }
    .hd-app textarea.form-control { height: auto; }
    .hd-app .box-header .box-tools .btn { display: inline-flex; align-items: center; }
    .hd-app .btn-xs { min-height: 30px; }
}
@media (max-width: 400px) {
    .hd-contador-numero { font-size: 20px; }
    .hd-app .hd-navbar-titulo { font-size: 15px; }
}
.hd-login-ajuda { text-align: center; margin: 14px 0 0; font-size: 13px; color: #777; }

/* Painel da equipe: KPIs (box branco, número grande, faixa colorida; mesma altura) */
.hd-saudacao { margin: 0 0 10px; }
.hd-kpis { display: flex; flex-wrap: wrap; }
.hd-kpis > [class*="col-"] { display: flex; margin-bottom: 15px; }
.hd-kpi { flex: 1; display: flex; flex-direction: column; background: #fff; border-radius: 3px; border-top: 3px solid #d2d6de;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .1); padding: 12px 14px; color: #333; text-decoration: none; position: relative; min-height: 112px; }
.hd-kpi:hover, .hd-kpi:focus { color: #333; text-decoration: none; background: #f9fbfc; }
.hd-kpi.hd-cor-primary { border-top-color: #3c8dbc; } .hd-kpi.hd-cor-warning { border-top-color: #f39c12; }
.hd-kpi.hd-cor-info { border-top-color: #00c0ef; } .hd-kpi.hd-cor-default { border-top-color: #d2d6de; }
.hd-kpi-icone { position: absolute; right: 14px; top: 12px; font-size: 26px; color: #d2d6de; }
.hd-kpi-numero { font-size: 30px; font-weight: 700; line-height: 1.1; }
.hd-kpi-rotulo { color: #666; }
.hd-kpi-link { margin-top: auto; padding-top: 6px; font-size: 13px; color: #3c8dbc; }
@media (max-width: 400px) { .hd-kpi-numero { font-size: 24px; } .hd-kpi-icone { font-size: 20px; } }

.hd-acoes-linha { display: inline-flex; gap: 6px; justify-content: flex-end; align-items: center; }
.hd-acoes-linha form, .hd-acoes-chamado form { margin: 0; }
.hd-acoes-chamado { justify-content: flex-start; margin-top: 12px; }
.hd-ajuda-texto { font-size: 12px; margin-bottom: 0; }
.hd-btn-novo-xs { margin-bottom: 12px; }
.hd-explicacao { margin: 8px 0 0; }
.hd-resolveu .hd-acoes-topo { justify-content: flex-start; }
.hd-filtros-botoes .hd-acoes-topo { justify-content: flex-start; }

/* cores da faixa lateral nos cards (depois de .hd-card-item para prevalecer) */
.hd-card-item.hd-cor-primary { border-left-color: #3c8dbc; } .hd-card-item.hd-cor-info { border-left-color: #00c0ef; }
.hd-card-item.hd-cor-warning { border-left-color: #f39c12; } .hd-card-item.hd-cor-success { border-left-color: #00a65a; }
.hd-card-item.hd-cor-danger { border-left-color: #dd4b39; } .hd-card-item.hd-cor-default { border-left-color: #d2d6de; }
.hd-form-inline { display: inline-block; margin: 0; }
.hd-label-vazio { display: block; }

/* fila: 8 contadores = 2 linhas de 4 (sem card sozinho); celular 2 colunas */
@media (min-width: 768px) { .hd-contadores-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .hd-contadores-6 { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 768px) and (max-width: 1199px) { .hd-contadores-6 { grid-template-columns: repeat(3, 1fr); } }

/* celular: a .wrapper do AdminLTE tem overflow e anula o sticky -> rodapé de resposta fixo de verdade */
@media (max-width: 767px) {
    .hd-responder { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 1030; max-height: 60vh; overflow-y: auto;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
    .hd-pg-conversa .main-footer, .hd-pg-conversa-equipe .main-footer { padding-bottom: 130px; }
    .hd-responder textarea { max-height: 30vh; }
}

/* X da pré-visualização: área de toque 40x40, círculo visível de 26px */
.hd-previa-remover { top: -16px; right: -16px; width: 40px; height: 40px; background: transparent; box-shadow: none; padding: 0; }
.hd-previa-remover i { width: 26px; height: 26px; border-radius: 50%; background: #dd4b39; color: #fff; display: inline-flex;
    align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.hd-previa-remover:focus-visible { outline: 2px solid #3c8dbc; outline-offset: -4px; }
