* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #f4f5f7; color: #1f2328; }
main { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
h1 { font-size: 1.4rem; margin: 0 0 12px; }
a { color: #0b6e4f; }
.sutil { color: #6b7280; font-size: .85rem; font-weight: normal; }

.topo { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: #0b6e4f; color: #fff; flex-wrap: wrap; gap: 8px; }
.topo nav { display: flex; gap: 18px; align-items: center; }
.topo a, .topo .link { color: #fff; text-decoration: none; }
.badge { background: #e5484d; color: #fff; border-radius: 10px; padding: 1px 7px; font-size: .75rem; }

.cartao { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.login { max-width: 360px; margin: 80px auto; }

label { display: block; margin-bottom: 14px; font-weight: 600; }
label.check { font-weight: normal; display: flex; gap: 8px; align-items: center; }
input:not([type=checkbox]), textarea { display: block; width: 100%; margin-top: 6px; padding: 10px; border: 1px solid #d0d7de; border-radius: 6px; font: inherit; }
textarea { resize: vertical; }
.duas-colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

button { background: #0b6e4f; color: #fff; border: 0; border-radius: 6px; padding: 10px 18px; font: inherit; cursor: pointer; }
button:hover { filter: brightness(1.1); }
button.secundario { background: #fff; color: #0b6e4f; border: 1px solid #0b6e4f; }
button.perigo { background: #fff; color: #c62828; border: 1px solid #c62828; }
button.link { background: none; padding: 0; }
form.inline { display: inline; }

.aviso { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; background: #e8f0fe; }
.aviso.ok { background: #e6f4ea; }
.aviso.erro { background: #fdecea; }

.lista { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.lista th, .lista td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eee; }
.lista tbody tr { cursor: pointer; }
.lista tbody tr:hover { background: #f8faf9; }
.lista tr.destaque { background: #fff7e6; }
.corta { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: .75rem; padding: 2px 8px; border-radius: 10px; background: #eee; white-space: nowrap; }
.tag.ok { background: #e6f4ea; color: #0b6e4f; }
.tag.alerta { background: #e5484d; color: #fff; }

.cabecalho-conversa { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.acoes { display: flex; gap: 8px; }

.chat { background: #efeae2; border-radius: 10px; padding: 16px; height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 75%; padding: 8px 12px; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.msg .autor { font-size: .75rem; font-weight: 600; margin-bottom: 2px; }
.msg .texto { white-space: pre-wrap; }
.msg.cliente { background: #fff; align-self: flex-start; }
.msg.robo { background: #d9fdd3; align-self: flex-end; }
.msg.atendente { background: #cfe3ff; align-self: flex-end; }
.msg.sistema { background: #fdecea; align-self: center; max-width: 90%; font-size: .85rem; }

.enviar { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.enviar textarea { margin: 0; }
.anexo { margin: 0; padding: 10px 14px; border: 1px solid #0b6e4f; border-radius: 6px; color: #0b6e4f; cursor: pointer; font-weight: normal; white-space: nowrap; }
.anexo input { display: none; }
.anexo.com-arquivo { background: #0b6e4f; color: #fff; }

.foto { display: block; max-width: 260px; max-height: 260px; border-radius: 6px; margin: 4px 0; }
.midia-aviso { font-style: italic; color: #555; }
.msg audio { display: block; width: 260px; max-width: 100%; margin: 4px 0; }

@media (max-width: 640px) {
  .duas-colunas { grid-template-columns: 1fr; }
  .msg { max-width: 90%; }
  .corta { max-width: 140px; }
}
