/* VETTA IA — painel da plataforma (/admin) e portal do cliente (/portal).
   Uma folha, dois apps. Mesma família do site: Bricolage Grotesque nos títulos, Sora no
   resto, azul-noite na navegação. O fundo é frio (névoa), não creme: aqui é ferramenta
   de trabalho, e o que precisa chamar atenção é o estado do atendimento. */

:root {
  --ink: #0d1326;          /* navegação, texto forte */
  --ink-2: #172039;
  --mist: #eef1f7;         /* fundo da página */
  --paper: #ffffff;
  --paper-2: #f6f8fc;
  --line: #dde2ee;
  --line-soft: #e9edf5;
  --text: #121a33;
  --text-muted: #5b6585;
  --text-faint: #8d95b0;

  --brand: #3355ff;        /* ação principal */
  --brand-dark: #2440d6;
  --brand-tint: #e8ecff;
  --cyan: #17b8d9;         /* sinal na navegação escura */
  --go: #12a150;           /* conectado, no ar */
  --go-tint: #e2f6ea;
  --hold: #b87503;         /* em teste, atenção */
  --hold-tint: #fdf0d6;
  --stop: #c2321f;         /* erro, pausado */
  --stop-tint: #fde7e3;

  /* nomes antigos, ainda usados em templates */
  --bg: var(--mist); --surface: var(--paper); --surface-2: var(--paper-2);
  --border: var(--line); --border-soft: var(--line-soft);
  --success-bg: var(--go-tint); --success-fg: #0b7038;
  --warning-bg: var(--hold-tint); --warning-fg: #855404;
  --danger-bg: var(--stop-tint); --danger-fg: #a52718;
  --info-bg: var(--brand-tint); --info-fg: var(--brand-dark);

  --r-lg: 14px; --r: 10px; --r-sm: 7px;
  --radius: var(--r-lg); --radius-sm: var(--r);
  --rail: 232px;
  --display: 'Bricolage Grotesque', Sora, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--mist); color: var(--text);
  font: 400 14.5px/1.55 Sora, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.015em; margin: 0; }
h1 { font-size: 27px; line-height: 1.15; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; color: var(--text-muted); max-width: 72ch; }
code { font: 12.5px/1.5 ui-monospace, "SF Mono", Consolas, monospace; background: var(--paper-2); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---------- estrutura: trilho + conteúdo ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--rail); flex: 0 0 var(--rail); position: sticky; top: 0; height: 100vh;
  background: var(--ink); color: #c9d0e6; display: flex; flex-direction: column; padding: 20px 12px 14px;
}
.brand-mark { display: inline-flex; align-items: center; gap: 9px; }
.brand-mark svg { flex: none; }
.brand-mark .wordmark { font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.brand-mark .tag-ia { margin-left: 5px; padding: 1px 6px; border-radius: 5px; font-size: 10.5px; font-weight: 700; background: var(--brand-tint); color: var(--brand-dark); vertical-align: middle; }
.sidebar .brand-mark { padding: 0 10px; color: #fff; }
.sidebar .brand-mark .tag-ia { background: rgba(23,184,217,.16); color: var(--cyan); }
.sidebar .scope { font-size: 12px; color: #7d86a6; padding: 6px 10px 18px; }

.tenant-card { display: flex; align-items: center; gap: 10px; margin: 16px 0 14px; padding: 10px; background: rgba(255,255,255,.05); border-radius: var(--r); }
.tenant-avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; }
.tenant-avatar.placeholder, .avatar-lg.placeholder { display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; text-transform: uppercase; }
.tenant-card .tenant-name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; font-size: 24px; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: var(--r);
  text-decoration: none; color: #b4bcd6; font-size: 13.5px; font-weight: 500;
}
.sidebar nav a svg { flex: none; opacity: .8; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: #fff; color: var(--ink); font-weight: 600; }
.sidebar nav a.active svg { opacity: 1; color: var(--brand); }
.sidebar nav .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--cyan); color: var(--ink); font-size: 11.5px; font-weight: 700; text-align: center; }

.sidebar .foot { border-top: 1px solid rgba(255,255,255,.1); padding: 12px 6px 0; display: flex; align-items: center; gap: 8px; }
.sidebar .foot .who { flex: 1; min-width: 0; font-size: 12.5px; color: #c9d0e6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.sidebar .foot a.who:hover { color: #fff; text-decoration: underline; }
.sidebar .foot form { margin: 0; }
.sidebar .foot button { background: none; border: 1px solid rgba(255,255,255,.16); color: #c9d0e6; border-radius: var(--r-sm); padding: 6px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.sidebar .foot button:hover { background: rgba(255,255,255,.1); color: #fff; }

main.content { flex: 1; min-width: 0; padding: 32px 36px 64px; }
main.content > * { max-width: 1120px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 5px 0 0; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 13px; color: var(--text-muted); text-decoration: none; }
.back:hover { color: var(--brand); }

/* ---------- blocos ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 16px; }
.card:has(> table) { overflow-x: auto; }
.card > h3 { margin-bottom: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow, form.card { max-width: 620px; }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.cols > .card { margin-bottom: 0; }
.cols { margin-bottom: 16px; }

/* números: uma faixa com divisórias, não uma pilha de caixinhas */
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; background: var(--line-soft); }
.stat { background: var(--paper); padding: 14px 16px; margin: 0 -1px -1px 0; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.stat b { display: block; font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--text-muted); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; font-size: 13.5px; vertical-align: middle; }
thead th { font-size: 12.5px; font-weight: 600; color: var(--text-muted); background: var(--paper-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr + tr, table > tr + tr { border-top: 1px solid var(--line-soft); }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover { background: var(--paper-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td a.rowlink, a.rowlink { text-decoration: none; color: var(--text); font-weight: 500; }
a.rowlink:hover { color: var(--brand); }
.muted { color: var(--text-faint); font-variant-numeric: tabular-nums; }
small.muted { font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--paper-2); color: var(--text-muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live, .badge.active, .badge.enviado, .badge.on { background: var(--go-tint); color: #0b7038; }
.badge.sandbox { background: var(--hold-tint); color: #855404; }
.badge.paused, .badge.no_credit, .badge.suspended, .badge.erro, .badge.off { background: var(--stop-tint); color: #a52718; }
.badge.info { background: var(--brand-tint); color: var(--brand-dark); }
.badge.info::before, .badge.plain::before { display: none; }

/* ---------- formulários ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin: 16px 0 6px; }
label:first-child, input[type=hidden] + label { margin-top: 0; }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=email], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r);
  font: inherit; background: var(--paper); color: var(--text); min-height: 42px;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { resize: vertical; font: 13px/1.6 ui-monospace, "SF Mono", Consolas, monospace; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.field-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; max-width: 64ch; }
.fields-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
fieldset { border: 0; padding: 0; margin: 26px 0 0; }
fieldset:first-of-type { margin-top: 0; }
legend { font-family: var(--display); font-size: 16px; font-weight: 600; padding: 0; margin-bottom: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
  min-height: 40px; padding: 9px 16px; border-radius: var(--r); border: 1px solid transparent;
  font: inherit; font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: var(--paper); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: #b9c1d8; background: var(--paper-2); }
.btn-danger { background: var(--paper); border-color: #f0c4bc; color: var(--stop); }
.btn-danger:hover { background: var(--stop-tint); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

/* escolha entre duas ou três opções (no ar / em teste) */
.seg { display: inline-flex; padding: 3px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); gap: 2px; }
.seg button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-muted); padding: 7px 14px; border-radius: var(--r-sm); cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--paper); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.seg button.on.go { color: #0b7038; box-shadow: 0 0 0 1px #9fdcb7; background: var(--go-tint); }
.seg button.on.hold { color: #855404; box-shadow: 0 0 0 1px #f0d28f; background: var(--hold-tint); }
.seg button.on.stop { color: #a52718; box-shadow: 0 0 0 1px #f0c4bc; background: var(--stop-tint); }

.flash { display: flex; gap: 10px; padding: 12px 15px; border-radius: var(--r); margin-bottom: 16px; font-size: 13.5px; font-weight: 500; border: 1px solid transparent; overflow-wrap: anywhere; }
.flash.ok { background: var(--go-tint); color: #0b5c2e; border-color: #b9e6cb; }
.flash.error { background: var(--stop-tint); color: #8f2012; border-color: #f3c9c1; }

/* abas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
  border: 0; background: none; font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap;
  padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs a.active, .tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; background: #c5cbdc; border-radius: 999px; cursor: pointer; transition: background .15s; }
.switch .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + .slider { background: var(--go); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--brand); outline-offset: 2px; }

/* lista de pares rótulo/valor */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- conexão do WhatsApp ---------- */
.wa { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; align-items: center; }
.wa-line { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.wa-dot { width: 11px; height: 11px; border-radius: 50%; background: #b3bbd1; flex: none; }
.wa[data-phase=connected] .wa-dot { background: var(--go); box-shadow: 0 0 0 4px var(--go-tint); }
.wa[data-phase=qr] .wa-dot, .wa[data-phase=starting] .wa-dot { background: var(--hold); animation: wa-pulse 1.4s ease-in-out infinite; }
.wa[data-phase=error] .wa-dot { background: var(--stop); }
@keyframes wa-pulse { 50% { box-shadow: 0 0 0 6px rgba(184,117,3,.18); } }
.wa-help { margin: 8px 0 14px; font-size: 13.5px; color: var(--text-muted); max-width: 52ch; }
.wa-steps { margin: 0 0 14px; padding-left: 20px; font-size: 13.5px; color: var(--text-muted); }
.wa-steps li + li { margin-top: 3px; }
.wa-qr { width: 232px; height: 232px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); display: grid; place-items: center; }
.wa-qr img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.wa-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: wa-rot .9s linear infinite; }
@keyframes wa-rot { to { transform: rotate(360deg); } }

/* ---------- conversas ---------- */
.chat { max-height: 560px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; background: var(--paper-2); display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 9px 13px; border-radius: 14px; max-width: min(78%, 60ch); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { background: var(--paper); border: 1px solid var(--line); border-top-left-radius: 4px; align-self: flex-start; }
.msg.assistant, .msg.model { background: var(--brand); color: #fff; border-top-right-radius: 4px; align-self: flex-end; }
.msg .meta { font-size: 11px; opacity: .7; margin-top: 4px; font-variant-numeric: tabular-nums; }
.contact-list { list-style: none; padding: 0; margin: 0; max-height: 560px; overflow-y: auto; }
.contact-list li + li { border-top: 1px solid var(--line-soft); }
.contact-list a { display: block; padding: 10px; text-decoration: none; color: var(--text); border-radius: var(--r-sm); font-weight: 500; overflow-wrap: anywhere; }
.contact-list a.active { background: var(--brand-tint); color: var(--brand-dark); }
.contact-list a:hover:not(.active) { background: var(--paper-2); }
.contact-list small { color: var(--text-faint); font-weight: 400; font-variant-numeric: tabular-nums; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 44px 20px; color: var(--text-muted); }
.empty svg { opacity: .35; margin-bottom: 12px; }
.empty b { font-family: var(--display); font-size: 16px; color: var(--text); margin-bottom: 4px; }
.empty span { font-size: 13.5px; max-width: 42ch; }
.empty .btn { margin-top: 14px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); background: var(--paper); }
.login-aside { position: relative; overflow: hidden; padding: 44px 52px; color: #e9edf8; background: var(--ink); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.login-aside::after { content: ""; position: absolute; right: -180px; bottom: -220px; width: 520px; height: 520px; border-radius: 50%; border: 1px solid rgba(255,255,255,.07); box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 150px rgba(255,255,255,.018); pointer-events: none; }
.login-aside > * { position: relative; z-index: 1; }
.login-aside .stars { display: none; }
.login-aside .brand-mark .wordmark { color: #fff; }
.login-aside .brand-mark .tag-ia { background: rgba(23,184,217,.16); color: var(--cyan); }
.login-aside h2 { font-size: 34px; line-height: 1.12; color: #fff; max-width: 16ch; margin-bottom: 14px; }
.login-aside .aside-lead { font-size: 15px; color: #a9b2ce; max-width: 44ch; margin: 0; }
.login-aside .aside-list { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.login-aside .aside-list li { display: flex; gap: 10px; font-size: 14px; color: #c6cde2; }
.login-aside .aside-list svg { flex: none; margin-top: 3px; }
.login-aside .aside-foot { font-size: 12.5px; color: #7d86a6; margin: 0; }
.login-panel { display: grid; place-items: center; padding: 40px 24px; }
.login-box { width: 100%; max-width: 380px; }
.login-box h1 { font-size: 26px; margin-bottom: 6px; }
.login-box .sub { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.login-box .btn-primary { width: 100%; margin-top: 20px; min-height: 46px; font-size: 14.5px; }
.login-box .help { margin: 22px 0 0; font-size: 13px; color: var(--text-muted); }
.login-box .only-mobile { display: none; margin-bottom: 28px; }
.pw-field { position: relative; }
.pw-field input { padding-right: 84px; }
.pw-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-muted); padding: 7px 10px; border-radius: var(--r-sm); }
.pw-toggle:hover { background: var(--paper-2); color: var(--text); }

/* ---------- celular ---------- */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { position: sticky; top: 0; z-index: 20; width: 100%; height: auto; flex: none; flex-direction: row; align-items: center; padding: 10px 14px; gap: 10px; }
  .sidebar .scope, .tenant-card .tenant-name { display: none; }
  .tenant-card { margin: 0; padding: 0; background: none; }
  .tenant-avatar { width: 28px; height: 28px; font-size: 13px; }
  .sidebar .brand-mark { padding: 0; }
  .sidebar .foot { border: 0; padding: 0; margin-left: auto; }
  .sidebar .foot .who { max-width: 110px; }
  .sidebar nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; flex-direction: row; gap: 0;
    background: var(--ink); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.1);
    overflow-x: auto; scrollbar-width: none;
  }
  .sidebar nav a { flex: 1 0 auto; flex-direction: column; gap: 3px; padding: 7px 10px; font-size: 11px; min-width: 64px; text-align: center; }
  .sidebar nav a.active { background: rgba(255,255,255,.12); color: #fff; }
  .sidebar nav a.active svg { color: var(--cyan); }
  .sidebar nav .count { position: absolute; margin: -4px 0 0 26px; }
  main.content { padding: 20px 16px 96px; }
  h1 { font-size: 23px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr) !important; }
  .card { padding: 16px; }
  .wa { grid-template-columns: minmax(0, 1fr); }
  .wa-qr { margin: 0 auto; }
  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-aside { display: none; }
  .login-box .only-mobile { display: inline-flex; }
  .msg { max-width: 90%; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- caixa de atendimento ---------- */
.inbox-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.inbox-bar .inbox-search { flex: 1; min-width: 180px; max-width: 320px; }
.seg a { font-size: 13px; font-weight: 600; color: var(--text-muted); padding: 7px 14px; border-radius: var(--r-sm); text-decoration: none; }
.seg a:hover { color: var(--text); }
.seg a.on { background: var(--paper); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.inbox { display: grid; grid-template-columns: 280px minmax(0, 1fr); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; min-height: 460px; }
.inbox > .contact-list { border-right: 1px solid var(--line); max-height: 720px; padding: 6px; }
.contact-list a .who { display: block; }
.contact-list a small { display: block; }
.chip { display: inline-block; margin: 2px 0; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--paper-2); color: var(--text-muted); border: 1px solid var(--line); }
.chip.warn { background: var(--hold-tint); color: #855404; border-color: #f0d28f; }
.inbox-main { display: flex; flex-direction: column; padding: 14px 16px 16px; min-width: 0; }
.inbox-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inbox-head b { display: block; font-family: var(--display); font-size: 17px; }
.inbox-head .back { margin: 0; }
.only-narrow { display: none; }
.state-line { margin: 10px 0; padding: 8px 12px; border-radius: var(--r); font-size: 13px; background: var(--brand-tint); color: var(--brand-dark); }
.state-line.human { background: var(--hold-tint); color: #855404; }
.inbox-main .chat { flex: 1; min-height: 260px; max-height: 480px; }
.msg.equipe { background: var(--ink); color: #fff; }
.msg.system { align-self: center; background: var(--hold-tint); color: #855404; font-size: 12.5px; border-radius: var(--r); text-align: center; max-width: 90%; }
.composer { display: flex; gap: 10px; align-items: flex-end; margin-top: 10px; }
.composer textarea { flex: 1; font: inherit; min-height: 46px; }
.contact-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.contact-form label { margin-top: 0; }
.contact-form .grow { flex: 1; min-width: 200px; }
.sim .chat { min-height: 300px; max-height: 460px; }

.alert { background: var(--stop-tint); border: 1px solid #f3c9c1; color: #8f2012; border-radius: var(--r-lg); padding: 14px 18px; margin-bottom: 16px; font-size: 13.5px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert li + li { margin-top: 3px; }
.notice { background: var(--hold-tint); border: 1px solid #f0d28f; color: #6b4403; border-radius: var(--r-lg); padding: 14px 18px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.danger-zone { border-color: #f0c4bc; }

@media (max-width: 860px) {
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox > .contact-list { border-right: 0; max-height: none; }
  .inbox.has-open > .contact-list { display: none; }
  .inbox:not(.has-open) > .inbox-main { display: none; }
  .only-narrow { display: inline-flex; }
  .composer { flex-direction: column; align-items: stretch; }
  .inbox-bar .inbox-search { max-width: none; flex-basis: 100%; }
}
@media (max-width: 860px) {
  .sidebar > div:first-child { display: flex; align-items: center; gap: 10px; }
}

/* lista de ativação e mensalidades */
.checklist { list-style: none; margin: 4px 0 0; padding: 0; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.checklist li:first-child { border-top: 0; }
.checklist li > div { flex: 1; min-width: 0; }
.checklist b { font-weight: 600; font-size: 14px; }
.checklist small { display: block; color: var(--text-muted); font-size: 12.5px; margin-top: 2px; max-width: 62ch; }
.checklist .check { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; color: #fff; }
.checklist li.done .check { background: var(--go); border-color: var(--go); }
.checklist li.done b { color: var(--text-muted); font-weight: 500; }
.badge.paga { background: var(--go-tint); color: #0b7038; }
.badge.aberta { background: var(--hold-tint); color: #855404; }
.badge.vencida { background: var(--stop-tint); color: #a52718; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.test-out { margin-top: 12px; font-size: 13.5px; }
.test-out div { padding: 6px 0; }
.test-out .ok { color: #0b7038; } .test-out .bad { color: #a52718; }

.memory-note { margin: 0 0 10px; font-size: 13px; color: var(--text-muted); }
.memory-note summary { cursor: pointer; font-weight: 600; }
.memory-note div { margin-top: 6px; padding: 10px 12px; background: var(--paper-2); border-radius: var(--r); white-space: pre-wrap; color: var(--text); }
