:root {
  --bg: #eef1f4; --panel: #ffffff; --ink: #1b2330; --muted: #5f6b7a; --line: #d9dee5;
  --brand: #0f5e78; --brand-ink: #ffffff; --brand-soft: #e1eef3;
  --ok: #1f8a5b; --ok-soft: #e3f3eb; --wait: #b7800f; --wait-soft: #fbf1dc; --off: #9aa3ae;
  --danger: #b3261e; --danger-soft: #fbe6e4;
  --radius-lg: 14px; --radius-sm: 8px;
  --sans: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12171e; --panel: #1a212b; --ink: #e6ebf1; --muted: #93a0b1; --line: #2b3542;
    --brand: #3aa7c9; --brand-ink: #0b1a21; --brand-soft: #173340;
    --ok: #3cc488; --ok-soft: #173427; --wait: #e2b04a; --wait-soft: #3a2f16; --off: #6b7684;
    --danger: #f07167; --danger-soft: #3d1f1d;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
a { color: var(--brand); }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
h1, h2, h3 { letter-spacing: -0.02em; }

label { display: block; font-weight: 500; font-size: 14px; margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
input[type=text], input[type=password], input[type=url], input[type=tel], input[type=email], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
}
textarea { resize: vertical; min-height: 72px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

.btn { border: 1px solid var(--line); background: var(--panel); padding: 9px 14px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; text-decoration: none; display: inline-block; color: var(--ink); }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Tela de entrada */
.gate { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; }
.gate .box { width: min(520px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; }
.gate h1 { font-size: 26px; margin: 0 0 4px; }
.gate p.lead { margin: 0 0 22px; color: var(--muted); }
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; margin-bottom: 22px; }
.tabs button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 7px; cursor: pointer; font-weight: 500; color: var(--muted); }
.tabs button[aria-selected=true] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Escolha de plano */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
@media (max-width: 520px) { .plans { grid-template-columns: 1fr; } }
.plan-opt { position: relative; }
.plan-opt input { position: absolute; opacity: 0; }
.plan-opt > span { display: block; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; font-weight: 400; }
.plan-opt b { display: block; font-size: 15px; }
.plan-opt .n { font-size: 26px; border: 0; padding: 0; font-weight: 700; line-height: 1.1; display: block; margin: 6px 0 0; }
.plan-opt .p { display: block; font-size: 13px; color: var(--muted); }
.plan-opt input:checked + span { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-soft); }
.plan-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Layout do app */
.app { display: grid; grid-template-columns: 280px 1fr; min-height: 100%; background: linear-gradient(90deg, var(--panel) 0 279px, var(--line) 279px 280px, var(--bg) 280px); }
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }
aside { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 100vh; position: sticky; top: 0; max-height: 100vh; }
.brand { padding: 20px 20px 4px; }
.brand strong { font-size: 17px; display: block; }
.brand small { color: var(--muted); font-size: 13px; }
nav.menu { padding: 12px 8px; display: grid; gap: 2px; }
nav.menu button { text-align: left; border: 0; background: none; padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; color: var(--muted); }
nav.menu button:hover { background: var(--bg); color: var(--ink); }
nav.menu button[aria-current=true] { background: var(--bg); color: var(--ink); box-shadow: inset 3px 0 0 var(--brand); }
.aside-foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--line); font-size: 14px; }
.aside-foot button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
main { padding: 28px clamp(16px, 4vw, 44px) 60px; max-width: 1120px; width: 100%; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; background: var(--bg); }
  aside { position: static; min-height: 0; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
  nav.menu { grid-auto-flow: column; overflow-x: auto; }
}

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h2 { font-size: 30px; margin: 0; line-height: 1.1; }
.page-head .sub { margin-top: 6px; color: var(--muted); }

.banner { border-radius: var(--radius-lg); padding: 14px 18px; margin-bottom: 22px; display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.banner.info { background: var(--brand-soft); }
.banner.warn { background: var(--wait-soft); }
.banner.bad { background: var(--danger-soft); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
section.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
section.card h3 { margin: 0 0 14px; font-size: 16px; }

.meter { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.meter.full i { background: var(--wait); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--off); flex: none; }
.dot.open { background: var(--ok); }
.dot.connecting { background: var(--wait); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot.connecting { animation: none; } }

.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 500; background: var(--bg); color: var(--muted); white-space: nowrap; }
.pill.trial { background: var(--brand-soft); color: var(--brand); }
.pill.active { background: var(--ok-soft); color: var(--ok); }
.pill.past_due { background: var(--wait-soft); color: var(--wait); }
.pill.suspended, .pill.blocked { background: var(--danger-soft); color: var(--danger); }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: var(--bg); }
.scroll-x { overflow-x: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.token { display: flex; gap: 8px; align-items: center; }
.token code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--bg); padding: 9px 12px; border-radius: var(--radius-sm); font-family: var(--mono); font-size: 13px; }
pre.code { background: var(--bg); padding: 14px; border-radius: var(--radius-sm); overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.6; margin: 0; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-sm); font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; z-index: 50; }
.toast.show { opacity: 1; }
.toast.err { background: var(--danger); color: #fff; }

.empty { color: var(--muted); padding: 28px 0; }

/* Mensagens não lidas */
.unread-pill { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; color: #fff; background: var(--danger); vertical-align: 2px; }
nav.menu button { display: flex; align-items: center; gap: 8px; }
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--danger); }

/* Campo de senha com o botão "olho" */
.pw-wrap { position: relative; display: block; flex: 1 1 auto; min-width: 0; }
.pw-wrap > input { width: 100%; padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none;
  border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: #374151; }
.pw-eye:hover { background: rgba(0, 0, 0, .06); color: #000; }
.pw-eye:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pw-eye svg { width: 20px; height: 20px; }
.pw-eye[aria-pressed=true] { color: var(--brand); }

/* ===== Conta de agência ===== */
.ag-switch { padding: 0 16px 10px; }
.ag-switch label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; margin: 0 0 6px; color: var(--navy-muted, #9fb0cf); }
.ag-switch select { width: 100%; background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 10px 12px; font: inherit; }
.ag-switch select option { color: #111; }
.ag-switch .ag-note { font-size: 12px; margin: 6px 2px 0; color: var(--navy-muted, #9fb0cf); }
.agency-bar { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: -28px calc(-1 * clamp(16px, 4vw, 44px)) 20px; padding: 12px clamp(16px, 4vw, 44px); background: #7a3e00; color: #fff; border-bottom: 3px solid #f59e0b; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.agency-bar b { font-weight: 700; }
.agency-bar .btn { background: #fff; color: #7a3e00; border-color: #fff; font-weight: 600; }
.agency-bar small { display: block; margin-top: 2px; color: #fff !important; opacity: .92; }
.ag-levels { display: grid; gap: 12px; margin: 14px 0; }
.ag-level { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel); }
.ag-level label { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.ag-level ul { margin: 8px 0 0 28px; padding: 0; font-size: 14px; color: var(--muted); font-weight: 400; }
.ag-level ul.no li::marker { content: "✕  "; color: var(--danger); }
.ag-level ul.yes li::marker { content: "✓  "; color: var(--ok); }
.ag-consent { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 12px 0; }
.ag-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.ag-row:first-of-type { border-top: 0; }
.ag-row .ag-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sentby { font-size: 11px; opacity: .85; margin-right: 8px; font-style: italic; }
/* Agência com leitura apenas: some o que serviria para alterar (o servidor também bloqueia tudo) */
body.ag-readonly .cp-composer, body.ag-readonly .reply-bar, body.ag-readonly .att-preview, body.ag-readonly .reply-btn,
body.ag-readonly .cp [data-p=meet], body.ag-readonly .cp [data-p=pin], body.ag-readonly .cp [data-p=endAtt],
body.ag-readonly [data-el=newChat] { display: none !important; }
body.ag-readonly .cp [data-p=stage] { pointer-events: none; opacity: .75; }
/* os campos ficam só para ler; as abas Vendas/Notas/Tarefas continuam abrindo */
body.ag-readonly .cp-info :is(input, select, textarea) { pointer-events: none; opacity: .75; }
body.ag-readonly .cp-info button:not([data-sub]) { display: none !important; }
body.ag-readonly .lead-card { cursor: pointer; }
/* Na conta de um cliente: nada de WhatsApp (QR), token, webhook, configurações técnicas */
body.ag-on #btnRestart, body.ag-on #btnLogout, body.ag-on #btnDelete, body.ag-on #pairCard, body.ag-on .settings, body.ag-on #createForm,
body.ag-on #addCard { display: none !important; }

/* Atendente comum não mexe na ligação do WhatsApp nem em integrações (o servidor também bloqueia) */
body.is-member:not(.is-admin) #btnRestart, body.is-member:not(.is-admin) #btnLogout, body.is-member:not(.is-admin) #btnDelete,
body.is-member:not(.is-admin) #pairCard, body.is-member:not(.is-admin) .settings { display: none !important; }

/* ===== Avaliação por IA ===== */
.ai-tabs { display: flex; gap: 6px; margin: 4px 0 14px; border-bottom: 1px solid var(--line); }
.ai-tabs button { background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted, #64748b); cursor: pointer; border-bottom: 3px solid transparent; }
.ai-tabs button[aria-selected=true] { color: var(--accent, #1d4ed8); border-bottom-color: var(--accent, #1d4ed8); }
.ai-filters { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.ai-filters label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.ai-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ai-kpis .card { padding: 14px 16px; } .ai-kpis small { display: block; color: var(--muted, #64748b); } .ai-kpis b { font-size: 26px; } .ai-kpis em { font-size: 14px; font-style: normal; color: var(--muted, #64748b); font-weight: 500; }
.ai-score { display: inline-block; min-width: 38px; text-align: center; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.ai-good { background: #dcfce7; color: #166534; } .ai-mid { background: #fef3c7; color: #92400e; } .ai-low { background: #fee2e2; color: #991b1b; } .ai-na { background: #e5e7eb; color: #4b5563; }
.ai-row { cursor: pointer; } .ai-row:hover, .ai-row:focus-visible { background: #f1f5ff; outline: none; }
.ai-ok { color: #166534; font-size: 12px; font-weight: 600; } .ai-warn { color: #92400e; font-size: 12px; font-weight: 600; }
.ai-script { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); } .ai-script:first-of-type { border-top: 0; } .ai-script.off { opacity: .6; }
.ai-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 95; display: grid; place-items: center; padding: 16px; overflow: auto; }
.ai-modal { position: relative; background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; } .ai-modal.wide { max-width: 760px; }
.ai-x { position: absolute; top: 8px; right: 12px; background: none; border: 0; font-size: 26px; cursor: pointer; line-height: 1; color: #475569; }
.ai-top { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.ai-big { font-size: 40px; font-weight: 800; border-radius: 16px; padding: 10px 18px; } .ai-big small { font-size: 15px; font-weight: 600; opacity: .7; }
.ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 18px; margin-bottom: 8px; }
.ai-crit-head { display: flex; justify-content: space-between; font-size: 14px; } .ai-crit p { margin: 4px 0 0; font-size: 13px; color: #475569; }
.ai-bar { height: 8px; background: #e5e7eb; border-radius: 99px; overflow: hidden; margin-top: 4px; } .ai-bar i { display: block; height: 100%; } .ai-bar .ai-good { background: #22c55e; } .ai-bar .ai-mid { background: #f59e0b; } .ai-bar .ai-low { background: #ef4444; }
.ai-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; } .ai-two h4, .ai-modal h4 { margin: 12px 0 4px; font-size: 14px; } .ai-modal ul { margin: 0; padding-left: 18px; font-size: 14px; }
.ai-quote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid #cbd5e1; background: #f8fafc; font-size: 14px; }
.ai-alert { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.ai-err { background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.ai-wait { display: flex; align-items: center; gap: 10px; padding: 20px 4px; } .ai-spin { width: 18px; height: 18px; border: 3px solid #cbd5e1; border-top-color: #1d4ed8; border-radius: 50%; animation: aispin 1s linear infinite; } @keyframes aispin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-spin { animation: none; } }

/* ===== IA de Atendimento ===== */
.agent-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 8px 18px; font-size: 14px; border-bottom: 1px solid var(--line); border-left: 4px solid #94a3b8; background: #f8fafc; }
.agent-bar[data-mode=ai] { border-left-color: #2563eb; background: #eff6ff; } .agent-bar[data-mode=paused] { border-left-color: #f59e0b; background: #fffbeb; } .agent-bar[data-mode=human] { border-left-color: #16a34a; background: #f0fdf4; }
.agent-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.agent-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.agent-chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 6px; overflow-x: auto; }
.agent-col { position: relative; flex: 0 0 34px; height: 100%; display: flex; flex-direction: column-reverse; justify-content: flex-start; align-items: stretch; gap: 1px; }
.agent-col i { display: block; border-radius: 3px; } .agent-col i.r, .agent-key.r { background: #2563eb; } .agent-col i.h, .agent-key.h { background: #f59e0b; }
.agent-col span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted, #64748b); }
.agent-chart { padding-bottom: 22px; } .agent-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.agent-ev { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e5e7eb; color: #374151; }
.agent-ev.reply { background: #dbeafe; color: #1e40af; } .agent-ev.handoff { background: #fef3c7; color: #92400e; } .agent-ev.blocked, .agent-ev.error { background: #fee2e2; color: #991b1b; } .agent-ev.returned, .agent-ev.taken { background: #dcfce7; color: #166534; }
.ag-chk { display: flex; gap: 8px; align-items: center; font-weight: 400; }

/* IA de Atendimento: memória do lead dentro da conversa e aba Conhecimento */
.agent-bar { flex-direction: column; align-items: stretch; gap: 6px; }
.agent-main { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.agent-mem summary { cursor: pointer; font-weight: 600; font-size: 13px; color: #334155; }
.agent-mem-body { padding-top: 8px; }
.agent-mem-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 12px; }
.agent-mem-grid label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; font-weight: 600; } .agent-mem-grid input { font-weight: 400; }

/* IA de Atendimento: aba Ferramentas */
.ag-tool { padding: 12px 0; border-top: 1px solid #e2e8f0; } .ag-tool:first-of-type { border-top: 0; }
.ag-tool-cfg { margin: 10px 0 0 26px; padding: 12px; background: #f8fafc; border-radius: 10px; }
.ag-tags { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0; }

/* IA de Atendimento: resultados, funil e relatórios */
.ag-funnel { display: grid; gap: 8px; }
.ag-flabel { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.ag-fbar { height: 12px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-top: 3px; } .ag-fbar i { display: block; height: 100%; background: #2563eb; border-radius: 99px; }
.ag-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; } h4 { margin: 0 0 6px; font-size: 14px; }
.agent-col i.h { background: #f59e0b; } .agent-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: #2563eb; vertical-align: middle; } .agent-key.h { background: #f59e0b; }

/* Criar grupo ou comunidade (assistente) */
.gw-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 90; display: grid; place-items: center; padding: 14px; }
.gw-modal { background: #fff; border-radius: 16px; width: min(640px, 100%); max-height: calc(100vh - 28px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(15, 23, 42, .35); }
.gw-head { padding: 16px 20px 10px; border-bottom: 1px solid #e2e8f0; position: relative; } .gw-head h2 { margin: 0 36px 8px 0; font-size: 20px; }
.gw-x { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: #64748b; }
.gw-steps { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; font-size: 12px; } .gw-steps li { padding: 3px 10px; border-radius: 99px; background: #f1f5f9; color: #64748b; } .gw-steps li.on { background: #2563eb; color: #fff; font-weight: 600; } .gw-steps li.done { background: #dcfce7; color: #166534; }
.gw-body { padding: 16px 20px; overflow: auto; flex: 1; } .gw-foot { padding: 12px 20px; border-top: 1px solid #e2e8f0; display: flex; justify-content: space-between; gap: 8px; }
.gw-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; } @media (max-width: 520px) { .gw-cards { grid-template-columns: 1fr; } }
.gw-card { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 2px solid #e2e8f0; border-radius: 12px; cursor: pointer; } .gw-card.on { border-color: #2563eb; background: #eff6ff; } .gw-card input { position: absolute; opacity: 0; } .gw-card span { font-size: 13px; color: #475569; }
.gw-set { border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px 12px; margin: 0 0 10px; } .gw-set legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
.gw-opt { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; } .gw-opt small { display: block; color: #64748b; font-size: 12px; font-weight: 400; }
.gw-found { max-height: 230px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 12px; padding: 4px; margin-bottom: 8px; }
.gw-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; } .gw-row:hover { background: #f8fafc; } .gw-tx { display: flex; flex-direction: column; min-width: 0; } .gw-tx small { color: #64748b; font-size: 12px; }
.gw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; } .gw-chip { display: inline-flex; align-items: center; gap: 4px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 99px; padding: 2px 4px 2px 10px; font-size: 13px; } .gw-chip button { border: 0; background: transparent; cursor: pointer; font-size: 16px; color: #475569; }
.gw-subs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; } .gw-sub { border: 1px solid #cbd5e1; background: #fff; border-radius: 99px; padding: 4px 12px; cursor: pointer; font: inherit; font-size: 13px; } .gw-sub.on { background: #2563eb; color: #fff; border-color: #2563eb; } .gw-sub.add { border-style: dashed; }
.gw-review { list-style: none; padding: 0; margin: 0 0 10px; } .gw-review li { padding: 5px 0; border-bottom: 1px solid #f1f5f9; }
.gw-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 8px 12px; border-radius: 10px; font-size: 13px; } .gw-err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 8px 12px; border-radius: 10px; margin-bottom: 10px; font-size: 14px; }
.gw-warnlist { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 8px 12px 8px 28px; border-radius: 10px; font-size: 13px; }
.gw-small { font-size: 12px; } .gw-res { border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; margin-bottom: 12px; } .gw-res h3 { margin: 0 0 6px; } .gw-res h4 { margin: 10px 0 4px; font-size: 14px; }
.gw-list { list-style: none; padding: 0; margin: 4px 0; font-size: 14px; } .gw-list li { padding: 3px 0; } .gw-why { color: #92400e; }
.gw-link { display: flex; gap: 6px; margin: 8px 0; } .gw-link input { flex: 1; min-width: 0; }

/* Ajuda */
.help-head h1 { margin: 0 0 4px; } .help-search input { width: 100%; max-width: 560px; margin-top: 8px; }
.help-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; } .help-chip { border: 1px solid #cbd5e1; background: #fff; border-radius: 99px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; } .help-chip:hover { background: #eff6ff; border-color: #93c5fd; }
.help-topic { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; margin-bottom: 10px; } .help-topic > summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; } .help-topic > summary::-webkit-details-marker { display: none; }
.help-ico { font-size: 24px; } .help-sum { display: flex; flex-direction: column; flex: 1; min-width: 0; } .help-sum small { color: #64748b; } .help-who { white-space: nowrap; font-size: 11px; }
.help-body { padding: 0 18px 14px 52px; } .help-body h4 { margin: 14px 0 6px; font-size: 15px; } .help-steps { margin: 0; padding-left: 20px; } .help-steps li { margin: 6px 0; line-height: 1.5; }
.help-ui { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 6px; padding: 0 5px; font-weight: 600; white-space: nowrap; }
.help-tips { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 8px 14px; margin: 12px 0; font-size: 14px; } .help-tips ul { margin: 4px 0 0; padding-left: 18px; }
.help-faq dt { font-weight: 600; margin-top: 8px; } .help-faq dd { margin: 2px 0 0 0; color: #334155; } .help-foot { margin-top: 18px; } .help-foot a { color: var(--brand); font-weight: 600; text-decoration: underline; }
@media (max-width: 640px) { .help-body { padding-left: 18px; } .help-who { display: none; } }
.gw-body .field input:not([type=checkbox]):not([type=radio]), .gw-body .field textarea, .gw-body .field select { width: 100%; box-sizing: border-box; }


/* Acesso de suporte (superadmin): faixa fixa no topo e o que fica escondido porque o servidor bloqueia */
.support-bar { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: -28px calc(-1 * clamp(16px, 4vw, 44px)) 20px; padding: 12px clamp(16px, 4vw, 44px); background: #7f1d1d; color: #fff; border-bottom: 3px solid #f59e0b; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.support-bar b { font-weight: 700; } .support-bar small { display: block; margin-top: 2px; color: #fff !important; opacity: .92; } .support-bar .btn { background: #fff; color: #7f1d1d; border-color: #fff; font-weight: 600; }
body.support-on [data-no-support], body.support-on #btnDelete, body.support-on #btnRotate, body.support-on #pushOn, body.support-on [data-i=lgpd], body.support-on [data-export], body.support-on [data-ag-export], body.support-on [data-reset2fa], body.support-on #tmOwnerOnly { display: none !important; }

/* Catálogo do WhatsApp, transcrição de áudio e etiquetas */
.cat-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.cat-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.cat-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .cat-main small { display: block; }
.cat-price { color: #166534; font-weight: 600; margin-left: 6px; } .cat-actions { display: flex; gap: 6px; flex-shrink: 0; }
.pill.warn { background: #fef3c7; color: #92400e; } .hint.err, .err { color: #b91c1c; }

/* Menu de IA quando o plano da empresa não inclui a IA: continua visível (a tela explica e leva a Plano), com cadeado */
#menu button.locked{opacity:.65}
#menu button.locked::after{content:"\1F512";margin-left:6px;font-size:12px}
