/* Protótipo do Monitoramento de atendimento (assets/js/prototipos/atendimento.js).
   Usa as classes de prototipo.css; aqui só o que é novo. Prefixo pt-at-. */
.pt-at .pt-main { max-height: 760px; overflow-y: auto; }
.pt-at button:focus-visible, .pt-at select:focus-visible, .pt-at tr:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pt-at-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.pt-at-kpis3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pt-kpi.is-warn b { color: #A35A00; }
.pt-at-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 10px; }
.pt-at-grid .pt-panel h4 small { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 400; color: var(--subtle); }
.pt-at-chart { display: block; width: 100%; height: auto; }
.pt-at-chart rect { fill: var(--ink); }
.pt-at-chart rect.is-alto { fill: #F59E0B; }
.pt-at-chart text { font-size: 11px; fill: var(--muted); }
.pt-at-chart text.pt-at-warn { font-weight: 700; fill: #A35A00; }

/* Sentimento */
.pt-at-stack { display: flex; height: 14px; overflow: hidden; border-radius: 7px; background: var(--surface); }
.pt-at-stack i { display: block; width: var(--w); height: 100%; }
.pt-at-stack .is-pos, .pt-at-leg .is-pos { background: #16A34A; }
.pt-at-stack .is-neu, .pt-at-leg .is-neu { background: var(--line-strong); }
.pt-at-stack .is-neg, .pt-at-leg .is-neg { background: #DC2626; }
.pt-at-leg { display: grid; gap: 6px; margin: 12px 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); }
.pt-at-leg li { display: flex; align-items: center; gap: 8px; }
.pt-at-leg i { width: 10px; height: 10px; border-radius: 3px; }
.pt-at-leg b { margin-left: auto; color: var(--ink); }
.pt-at-sent { display: inline-block; padding: 1px 8px; border-radius: var(--pill); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pt-at-sent.is-pos { background: var(--success-bg); color: var(--success); }
.pt-at-sent.is-neu { background: var(--surface-2); color: var(--muted); }
.pt-at-sent.is-neg { background: var(--danger-bg); color: var(--danger); }

/* Pede atenção */
.pt-at-insights { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pt-at-insights li { display: flex; gap: 10px; align-items: flex-start; }
.pt-at-insights b { display: block; font-size: 13px; color: var(--ink); }
.pt-at-insights small { display: block; margin: 2px 0 4px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.pt-at-dot { flex-shrink: 0; width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; }
.pt-at-dot.is-neg { background: #DC2626; }
.pt-at-dot.is-warn { background: #F59E0B; }

/* Atendentes */
.pt-at-table tbody tr { cursor: pointer; }
.pt-at-table tbody tr:hover { background: var(--surface); }
.pt-at-sort { display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.pt-at-sort[aria-pressed="true"] { color: var(--ink); }
.pt-at-sort .icon { width: 12px; height: 12px; }
.pt-at-pessoa { display: inline-flex; align-items: center; gap: 8px; }
.pt-at-pessoa b { font-size: 13px; }
.pt-at-alto { font-weight: 700; color: #A35A00; }
.pt-at-reg { display: inline-flex; align-items: center; gap: 8px; min-width: 110px; }
.pt-at-reg .pt-track { flex: 1; height: 6px; }
.pt-at-reg .pt-track i { height: 6px; }
.pt-bar i.is-low, .pt-at-reg i.is-low { background: #F59E0B; }
.pt-at-mini { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.pt-at-mini li { display: flex; align-items: center; gap: 6px; }
.pt-at-mini b { margin-left: auto; }
.pt-at-crit { padding: 0 6px; border-radius: var(--pill); background: var(--danger-bg); font-size: 10.5px; font-style: normal; font-weight: 700; color: var(--danger); }
.pt-at-convbtn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin-bottom: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.pt-at-convbtn:hover { border-color: var(--ink); }
.pt-at-convbtn b { display: block; font-size: 13px; color: var(--ink); }
.pt-at-convbtn small { font-size: 11.5px; color: var(--muted); }
.pt-at-nota { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface); font-size: 12.5px; line-height: 1.45; }

/* Conversas */
.pt-at-convs { display: grid; gap: 8px; }
.pt-at-conv {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; text-align: left; cursor: pointer;
}
.pt-at-conv:hover { border-color: var(--ink); }
.pt-at-conv__main b { display: block; font-size: 14px; color: var(--ink); }
.pt-at-conv__main small { display: block; font-size: 12px; color: var(--muted); }
.pt-at-resumo { margin-top: 4px; line-height: 1.45; color: var(--text) !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pt-at-conv__side { display: grid; justify-items: end; gap: 4px; }
.pt-at-conv__side small { font-size: 11.5px; color: var(--subtle); }
.pt-at-flag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: var(--pill); background: var(--warning-bg); font-size: 11.5px; font-weight: 700; color: var(--warning); white-space: nowrap; }
.pt-at-flag.is-crit { background: var(--danger-bg); color: var(--danger); }
.pt-at-flag.is-ok { background: var(--success-bg); color: var(--success); }
.pt-at-flag .icon { width: 11px; height: 11px; }

.pt-at-voltar { margin-bottom: 12px; }
.pt-at-detalhe { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.pt-at-transcricao { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.pt-at-transcricao header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.pt-at-transcricao header b { display: block; font-size: 14px; color: var(--ink); }
.pt-at-transcricao header small { font-size: 12px; color: var(--muted); }
.pt-at-msgs { display: grid; gap: 8px; padding: 14px; background: #EFEAE2; }
.pt-at-msg { max-width: 82%; padding: 8px 10px; border-radius: 10px; background: #fff; font-size: 13px; line-height: 1.45; color: var(--ink); box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.pt-at-msg--a, .pt-at-msg--b { justify-self: end; background: #D9FDD3; }
.pt-at-msg small { display: block; margin-top: 3px; font-size: 10.5px; color: var(--muted); }
.pt-at-msg em { display: flex; gap: 4px; align-items: flex-start; margin-top: 6px; padding-top: 6px; border-top: 1px dashed #F59E0B; font-size: 11.5px; font-style: normal; font-weight: 600; color: #A35A00; }
.pt-at-msg em .icon { width: 12px; height: 12px; margin-top: 2px; flex-shrink: 0; }
.pt-at-msg.is-marcada { box-shadow: 0 0 0 2px #F59E0B; }
.pt-at-msg.is-pisca { animation: pt-at-pisca 1.2s ease 2; }
@keyframes pt-at-pisca { 50% { box-shadow: 0 0 0 5px #F59E0B; } }
.pt-at-espera { display: flex; align-items: center; gap: 6px; justify-self: center; padding: 3px 10px; border-radius: var(--pill); background: #FEF3C7; font-size: 11.5px; font-weight: 600; color: #A35A00; }
.pt-at-espera .icon { width: 12px; height: 12px; }
.pt-at-analise { padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.pt-at-analise h4 { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); }
.pt-at-analise h5 { margin: 14px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.pt-at-resumo2 { margin: 8px 0 12px; font-size: 13px; line-height: 1.5; color: var(--text); }
.pt-at-dl2 { grid-template-columns: repeat(2, 1fr); margin-top: 8px; }
.pt-at-sentbar { display: grid; gap: 2px; padding: 8px; border-radius: 8px; background: var(--surface); }
.pt-at-sentbar > span { font-size: 11px; color: var(--muted); }
.pt-at-sentbar div { display: flex; align-items: center; gap: 6px; }
.pt-at-sentbar small { font-size: 11px; color: var(--subtle); }
.pt-at-regras { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; }
.pt-at-regras li { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 7px; }
.pt-at-regras li > span { flex: 1; min-width: 0; }
.pt-at-regras .icon { width: 14px; height: 14px; flex-shrink: 0; }
.pt-at-regras .is-ok .icon { color: var(--success); }
.pt-at-regras .is-q { background: #FFFBEB; }
.pt-at-regras .is-q .icon { color: #DC2626; }
.pt-at-regras .is-na { color: var(--subtle); }

/* Auditoria */
.pt-at-fila { display: grid; gap: 8px; }
.pt-at-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pt-at-item.is-feita { background: var(--surface); }
.pt-at-item header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pt-at-item header b { font-size: 13.5px; color: var(--ink); }
.pt-at-item header small { width: 100%; font-size: 12px; color: var(--muted); }
.pt-at-item blockquote { margin: 8px 0; padding: 8px 10px; border-left: 3px solid #F59E0B; border-radius: 0 8px 8px 0; background: #FFFBEB; font-size: 13px; color: var(--text); }
.pt-at-acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Alertas */
.pt-at-wa { max-width: 560px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #EFEAE2; }
.pt-at-wa__head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.pt-at-wa__head b { display: block; font-size: 14px; color: var(--ink); }
.pt-at-wa__head small { font-size: 12px; color: var(--muted); }
.pt-at-wa ol { display: grid; gap: 8px; margin: 0; padding: 14px; list-style: none; }
.pt-at-wa li { padding: 10px 12px; border-radius: 10px; background: #fff; font-size: 13px; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.pt-at-wa li.is-novo { box-shadow: 0 0 0 2px #F59E0B; }
.pt-at-wa li small { font-size: 11px; color: var(--subtle); }
.pt-at-wa li b { display: block; color: var(--ink); }
.pt-at-wa li p { margin: 2px 0 6px; line-height: 1.45; color: var(--text); }

@media (max-width: 1100px) {
  .pt-at-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .pt-at .pt-main { max-height: none; }
  .pt-at-grid, .pt-at-detalhe { grid-template-columns: minmax(0, 1fr); }
  .pt-at-kpis, .pt-at-kpis3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-at-conv { grid-template-columns: minmax(0, 1fr) auto; }
  .pt-at-conv > .pt-av { display: none; }
}
.pt-at-espera.is-marcada { box-shadow: 0 0 0 2px #F59E0B; }
.pt-at-espera.is-pisca { animation: pt-at-pisca 1.2s ease 2; }
.pt-at-grid .pt-bar { grid-template-columns: 158px minmax(0, 1fr) auto; }
@media (max-width: 520px) { .pt-at-grid .pt-bar { grid-template-columns: 120px minmax(0, 1fr) auto; } }
