/* Zap Mágico · tema "SaaS" do painel (barra lateral verde-escura, cartões
 * arredondados, cabeçalho com título da aba e barra de conta ativa).
 * Carregado depois de theme-light.css e antes de responsive.css.
 * Os elementos extras (título, barra de conta, faixa de benefícios, ícones)
 * são criados por theme-saas.js sem trocar nenhum id usado pelo app.js. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --zm-green: #16a34a;
  --zm-green-2: #22c55e;
  --zm-green-dark: #15803d;
  --zm-green-soft: #ecfdf3;
  --zm-forest: #052e16;
  --zm-forest-2: #0b3d1e;
  --zm-ink: #0f172a;
  --zm-muted: #64748b;
  --zm-line: #e6ece8;
  --zm-bg: #f5f7f6;
  --zm-red: #e11d48;
  --zm-radius: 20px;
  --zm-shadow: 0 10px 30px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --text-main: var(--zm-ink);
  --text-muted: var(--zm-muted);
  --border-color: var(--zm-line);
  --primary: var(--zm-green);
  --primary-hover: var(--zm-green-dark);
  --primary-light: var(--zm-green-soft);
}

body.light-theme { background: var(--zm-bg); font-family: var(--font-family); color: var(--zm-ink); }
body.light-theme .content-body { background: var(--zm-bg); padding: 22px 28px 32px; }

/* ===== Barra lateral ===== */
body.light-theme .sidebar {
  width: 270px;
  border-right: 0;
  color: #e7f5ec;
  background:
    radial-gradient(420px 220px at 10% 82%, rgba(34, 197, 94, .38), transparent 70%),
    radial-gradient(300px 160px at 90% 95%, rgba(34, 197, 94, .22), transparent 70%),
    linear-gradient(180deg, #04220f 0%, var(--zm-forest) 55%, var(--zm-forest-2) 100%);
  position: relative;
  overflow: hidden;
}
body.light-theme .sidebar::after {
  content: "";
  position: absolute;
  left: -40%;
  right: -40%;
  bottom: 120px;
  height: 160px;
  border-radius: 50%;
  border-top: 2px solid rgba(74, 222, 128, .35);
  filter: blur(.4px);
  pointer-events: none;
}
body.light-theme .brand { border-bottom: 0; padding: 24px 22px 18px; }
body.light-theme .brand-text { display: flex; align-items: center; gap: 8px; }
body.light-theme .brand-text h1 { color: #fff; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.zm-badge { font-size: 11px; font-weight: 600; color: #c8f0d5; border: 1px solid rgba(200, 240, 213, .35); border-radius: 999px; padding: 2px 8px; }
body.light-theme .logo-icon.zm-logo { width: 42px; height: 42px; border-radius: 11px; box-shadow: 0 0 0 1px rgba(74, 222, 128, .35), 0 0 22px rgba(34, 197, 94, .35); }

body.light-theme .nav-menu { padding: 8px 16px; gap: 6px; position: relative; z-index: 1; }
body.light-theme .nav-item {
  color: #d5eadc;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
}
body.light-theme .nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
body.light-theme .nav-item.active {
  color: #fff;
  font-weight: 600;
  background: linear-gradient(90deg, #15a046 0%, #22c55e 100%);
  border-color: rgba(134, 239, 172, .55);
  box-shadow: 0 6px 20px rgba(34, 197, 94, .35), inset 0 1px 0 rgba(255, 255, 255, .2);
}
body.light-theme .nav-item .icon { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; font-size: 0; }
body.light-theme .nav-item .icon svg { width: 21px; height: 21px; }

/* Cartão de IA no rodapé da barra lateral */
.zm-promo {
  position: relative;
  z-index: 1;
  margin: 12px 16px 16px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
  border: 1px solid rgba(134, 239, 172, .25);
  backdrop-filter: blur(6px);
}
.zm-promo .zm-crown { font-size: 22px; line-height: 1; }
.zm-promo strong { display: block; color: #fff; font-size: 16px; line-height: 1.3; margin: 8px 0 6px; }
.zm-promo p { color: #c9e7d3; font-size: 13px; line-height: 1.45; margin-bottom: 14px; }
.zm-promo button {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 10px 16px;
  background: linear-gradient(90deg, #4ade80, #86efac);
  color: #052e16; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
  font-family: inherit;
}
.zm-promo button:hover { filter: brightness(1.05); }
body.light-theme .sidebar-footer { display: none; }

/* ===== Cabeçalho ===== */
body.light-theme .topbar {
  background: var(--zm-bg);
  border-bottom: 0;
  height: auto;
  padding: 22px 28px 4px;
  align-items: flex-start;
}
.zm-page-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--zm-ink); margin: 0; }
.zm-page-head p { color: var(--zm-muted); font-size: 14.5px; margin-top: 4px; }
body.light-theme .topbar-actions { gap: 10px; }
.zm-icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--zm-line); color: var(--zm-ink);
  cursor: pointer; text-decoration: none;
}
.zm-icon-btn:hover { background: var(--zm-green-soft); }
.zm-icon-btn svg { width: 20px; height: 20px; }

/* ===== Barra da conta ativa ===== */
.zm-account-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--zm-line); border-radius: 18px;
  box-shadow: var(--zm-shadow);
  padding: 14px 18px; margin-bottom: 22px;
}
body.light-theme .zm-account-bar .account-selector-wrapper { gap: 14px; flex-wrap: wrap; }
body.light-theme .zm-account-bar .account-selector-wrapper label { color: var(--zm-ink); font-weight: 600; font-size: 15px; }
.zm-select-wrap { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.zm-select-wrap svg { position: absolute; z-index: 1; left: 14px; width: 22px; height: 22px; color: var(--zm-green); pointer-events: none; }
body.light-theme .zm-account-bar .form-select {
  min-width: 320px; max-width: 100%;
  padding: 11px 40px 11px 46px; border-radius: 12px; font-weight: 500; font-size: 14.5px;
  border: 1px solid #dfe6e2; background-color: #fff;
}
.zm-bar-right { display: flex; align-items: center; gap: 10px; }
.zm-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px;
  background: #f1f5f9; color: #475569;
}
.zm-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.zm-status.connected { background: var(--zm-green-soft); color: var(--zm-green-dark); }
.zm-status.connecting { background: #fff7e6; color: #9a6700; }
.zm-status.disconnected { background: #fff1f2; color: #be123c; }

/* ===== Botões ===== */
body.light-theme .btn {
  border-radius: 12px; font-weight: 700; font-size: 14.5px; padding: 11px 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  font-family: inherit;
}
body.light-theme .btn svg { width: 18px; height: 18px; flex: none; }
body.light-theme .btn:hover { transform: translateY(-1px); }
body.light-theme .btn-primary {
  background: linear-gradient(90deg, #15803d, #22c55e); color: #fff; border: 0;
  box-shadow: 0 8px 20px rgba(22, 163, 74, .28);
}
body.light-theme .btn-primary:hover { background: linear-gradient(90deg, #166534, #16a34a); }
body.light-theme .btn-secondary {
  background: linear-gradient(90deg, #15803d, #22c55e); color: #fff; border: 0;
  box-shadow: 0 8px 20px rgba(22, 163, 74, .25);
}
body.light-theme .btn-outline { background: #fff; color: var(--zm-ink); border: 1px solid #dfe6e2; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
body.light-theme .btn-outline:hover { background: #f8fafc; }
body.light-theme .btn-danger {
  background: linear-gradient(90deg, #be123c, #e11d48); color: #fff; border: 0;
  box-shadow: 0 8px 20px rgba(225, 29, 72, .28);
}

/* ===== Cartões ===== */
body.light-theme .card-grid { gap: 22px; }
body.light-theme .card {
  border: 1px solid var(--zm-line);
  border-radius: var(--zm-radius);
  box-shadow: var(--zm-shadow);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.zm-card-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; text-align: left; width: 100%; }
.zm-card-head .zm-tile {
  width: 52px; height: 52px; flex: none; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--zm-green-soft); color: var(--zm-green);
}
.zm-card-head .zm-tile svg { width: 28px; height: 28px; }
.zm-card-head h2 { font-size: 21px !important; font-weight: 800 !important; letter-spacing: -.015em; margin: 0 0 4px !important; color: var(--zm-ink); }
.zm-card-head .subtitle { margin: 0; font-size: 14px; }
body.light-theme .card .form-group label { color: var(--zm-ink); font-weight: 600; font-size: 14px; }
body.light-theme .card .form-input { padding: 12px 14px; border-radius: 12px; border: 1px solid #dfe6e2; font-size: 14.5px; }
.zm-input-icon { position: relative; display: flex; }
.zm-input-icon svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: #94a3b8; pointer-events: none; }
.zm-input-icon .form-input { width: 100%; padding-left: 44px !important; }
body.light-theme #tab-connection .card:not(.card-qr)::after {
  content: ""; position: absolute; right: -60px; bottom: -60px; width: 320px; height: 200px;
  background: radial-gradient(closest-side, rgba(34, 197, 94, .12), transparent);
  pointer-events: none;
}

/* Cartão do QR */
body.light-theme .card-qr { align-items: stretch; text-align: left; }
body.light-theme .card-qr .qr-container {
  align-self: center; position: relative; z-index: 1;
  border: 0; border-radius: 22px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .10), 0 0 0 1px var(--zm-line);
  margin: 18px auto 24px;
}
body.light-theme .card-qr::before {
  content: ""; position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%);
  width: 520px; height: 300px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(34, 197, 94, .14), rgba(34, 197, 94, .05) 60%, transparent);
  pointer-events: none;
}
body.light-theme .card-qr.zm-connected .qr-container { width: 310px; height: auto; min-height: 210px; padding: 26px 20px; }
.zm-ok { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.zm-ok svg { width: 64px; height: 64px; color: var(--zm-green); }
.zm-ok strong { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; color: var(--zm-ink); }
.zm-ok strong i { width: 22px; height: 22px; border-radius: 50%; background: var(--zm-green); color: #fff; font-style: normal; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.zm-ok span { font-size: 16px; color: #334155; }
body.light-theme .qr-actions { justify-content: center; gap: 14px; position: relative; z-index: 1; }

/* ===== Faixa de benefícios ===== */
.zm-benefits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.zm-benefit {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--zm-line); border-radius: 16px;
  box-shadow: var(--zm-shadow); padding: 18px 20px;
}
.zm-benefit svg { width: 30px; height: 30px; color: var(--zm-green); flex: none; }
.zm-benefit strong { display: block; font-size: 15px; color: var(--zm-ink); }
.zm-benefit span { font-size: 13px; color: var(--zm-muted); }

/* Outras abas acompanham o visual */
body.light-theme .inbox-layout, body.light-theme .agent-card { border-radius: 16px; border-color: var(--zm-line); }
body.light-theme .inbox-layout { box-shadow: var(--zm-shadow); }

@media (max-width: 1200px) {
  .zm-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Celular: a gaveta, o botão de menu e o "voltar" vêm de responsive.css/js */
@media (max-width: 900px) {
  body.light-theme .sidebar { position: fixed; width: min(84vw, 300px); overflow-y: auto; }
  body.light-theme .topbar { padding: 8px 12px; align-items: center; background: #fff; border-bottom: 1px solid var(--zm-line); }
  .zm-page-head { display: none; }
  body.light-theme .content-body { padding: 14px 12px 24px; }
  .zm-page-title-m { display: block; font-size: 20px; font-weight: 800; margin: 2px 2px 12px; color: var(--zm-ink); }
  .zm-account-bar { padding: 12px; border-radius: 16px; margin-bottom: 14px; }
  body.light-theme .zm-account-bar .account-selector-wrapper { flex: 1 1 100%; }
  body.light-theme .zm-account-bar .account-selector-wrapper label { display: none; }
  .zm-select-wrap { flex: 1; }
  body.light-theme .zm-account-bar .form-select { min-width: 0; width: 100%; }
  .zm-bar-right { width: 100%; justify-content: space-between; }
  body.light-theme .card { padding: 18px; }
  .zm-card-head { gap: 12px; }
  .zm-card-head .zm-tile { width: 44px; height: 44px; }
  .zm-card-head h2 { font-size: 18px !important; }
  body.light-theme .card-qr::before { width: 320px; height: 220px; }
  body.light-theme .card-qr.zm-connected .qr-container { width: 100%; max-width: 310px; }
  .zm-benefits { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
@media (min-width: 901px) { .zm-page-title-m { display: none; } }

body.light-theme .chat-search .form-input { width: 100%; }

/* ===== Menu da conta ===== */
.zm-account { position: relative; }
.zm-account-btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 46px; padding: 4px 12px 4px 4px; border-radius: 999px;
  background: #fff; border: 1px solid var(--zm-line); cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 14.5px; color: var(--zm-ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.zm-account-btn:hover { background: #f8fafc; }
.zm-avatar {
  width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #052e16, #15803d); color: #fff; font-size: 13.5px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(34, 197, 94, .45);
}
.zm-account-btn .zm-chev { width: 16px; height: 16px; color: var(--zm-muted); }
.zm-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 80; width: 270px;
  background: #fff; border: 1px solid var(--zm-line); border-radius: 16px; padding: 8px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .16);
}
.zm-menu[hidden] { display: none; }
.zm-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--zm-line); margin-bottom: 6px; }
.zm-menu-head strong { display: block; font-size: 15px; color: var(--zm-ink); }
.zm-menu-head span { display: block; font-size: 13px; color: var(--zm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zm-menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; font-family: inherit; font-size: 14.5px; font-weight: 500; color: var(--zm-ink); text-align: left;
}
.zm-menu-item svg { width: 19px; height: 19px; color: var(--zm-green); flex: none; }
.zm-menu-item:hover, .zm-menu-item:focus-visible { background: var(--zm-green-soft); outline: none; }
.zm-menu-item.danger, .zm-menu-item.danger svg { color: #be123c; }
.zm-menu-item.danger:hover { background: #fff1f2; }
.zm-menu-sep { height: 1px; background: var(--zm-line); margin: 6px 4px; }
@media (max-width: 900px) {
  .zm-account-btn { padding: 3px; height: 44px; gap: 0; }
  .zm-account-name, .zm-account-btn .zm-chev { display: none; }
  .zm-menu { width: min(280px, calc(100vw - 24px)); }
}

/* ===== Estados dos botões (hover, foco, clique, desabilitado) =====
 * O theme-light.css deixava o .btn-secondary com fundo cinza-claro no hover,
 * e o texto branco do tema novo sumia. Aqui cada variante tem o próprio hover. */
body.light-theme .btn-primary:hover,
body.light-theme .btn-secondary:hover {
  background: linear-gradient(90deg, #166534, #16a34a);
  color: #fff;
  box-shadow: 0 10px 26px rgba(22, 163, 74, .38);
}
body.light-theme .btn-danger:hover {
  background: linear-gradient(90deg, #9f1239, #be123c);
  color: #fff;
  box-shadow: 0 10px 26px rgba(190, 18, 60, .34);
}
body.light-theme .btn-outline:hover {
  background: var(--zm-green-soft);
  color: var(--zm-green-dark);
  border-color: rgba(22, 163, 74, .45);
}
body.light-theme .btn:active { transform: translateY(0); box-shadow: none; }
body.light-theme .btn:focus-visible { outline: 3px solid rgba(34, 197, 94, .45); outline-offset: 2px; }
body.light-theme .btn:disabled,
body.light-theme .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
body.light-theme .btn:disabled:hover { filter: none; }

/* ===== Oferta da versão PC (pagamento único) ===== */
.zm-upgrade {
  display: flex; align-items: center; gap: 18px; margin-top: 22px; padding: 20px 24px;
  border-radius: 18px; color: #e7f5ec; position: relative; overflow: hidden;
  background: radial-gradient(420px 200px at 90% 0%, rgba(74, 222, 128, .28), transparent 70%), linear-gradient(120deg, #052e16 0%, #0b4a1f 60%, #15803d 100%);
  box-shadow: 0 14px 34px rgba(5, 46, 22, .25);
}
.zm-upgrade-ico { width: 54px; height: 54px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(134, 239, 172, .3); }
.zm-upgrade-text { flex: 1; min-width: 0; }
.zm-upgrade-tag { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #052e16; background: #4ade80; border-radius: 999px; padding: 3px 10px; margin-bottom: 6px; }
.zm-upgrade strong { display: block; font-size: 17px; color: #fff; margin-bottom: 4px; }
.zm-upgrade p { color: #c9e7d3 !important; font-size: 14px; margin: 0; }
body.light-theme .zm-upgrade .zm-upgrade-cta { flex: none; white-space: nowrap; text-decoration: none; background: #fff; color: #14532d; box-shadow: none; }
body.light-theme .zm-upgrade .zm-upgrade-cta:hover { background: #ecfdf3; color: #14532d; box-shadow: 0 8px 22px rgba(0, 0, 0, .2); }
.zm-menu-item.upgrade { font-weight: 600; }
@media (max-width: 900px) {
  .zm-upgrade { flex-direction: column; align-items: flex-start; padding: 18px; }
  body.light-theme .zm-upgrade .zm-upgrade-cta { width: 100%; }
}

/* ===== Vários números e caixa de entrada unificada ===== */
body.client-mode #btnNewAccount { display: inline-flex !important; }
body.light-theme #btnNewAccount { background: var(--zm-green-soft); color: var(--zm-green-dark); border: 1px dashed rgba(22, 163, 74, .55); box-shadow: none; }
body.light-theme #btnNewAccount:hover { background: #dcfce7; color: var(--zm-green-dark); }
body.light-theme .zm-remove-acc { color: #be123c; border-color: #fecdd3; }
body.light-theme .zm-remove-acc:hover { background: #fff1f2; color: #9f1239; border-color: #fda4af; }
.zm-remove-acc[hidden] { display: none !important; }
.zm-acc-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 160px;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.6;
  color: var(--chip, #16a34a); background: color-mix(in srgb, var(--chip, #16a34a) 12%, #fff);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.zm-acc-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.zm-conv-meta { margin-top: 6px; }
.zm-via { font-size: 12px; }
.zm-inbox-filter { display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto; border-bottom: 1px solid var(--zm-line); background: #fff; }
.zm-filter-btn {
  flex: none; border: 1px solid var(--zm-line); background: #fff; color: #334155; cursor: pointer;
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; font-family: inherit;
}
.zm-filter-btn:hover { background: #f8fafc; }
.zm-filter-btn.on { background: var(--chip, var(--zm-green)); border-color: var(--chip, var(--zm-green)); color: #fff; }
.zm-modal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(4, 34, 15, .55); backdrop-filter: blur(3px); }
.zm-modal-card { width: 100%; max-width: 440px; background: #fff; border-radius: 20px; padding: 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.zm-modal-card h3 { font-size: 20px; font-weight: 800; color: var(--zm-ink); margin-bottom: 6px; }
.zm-modal-card p { color: var(--zm-muted); font-size: 14px; margin-bottom: 14px; }
.zm-modal-card .form-input { width: 100%; }
.zm-modal-err { color: #be123c; font-size: 13.5px; min-height: 18px; margin: 6px 0; }
.zm-modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* Estado inicial do QR: ainda não conectado */
.zm-idle { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 8px 10px; }
.zm-idle::before { content: ""; width: 56px; height: 56px; border-radius: 16px; background: var(--zm-green-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Cpath d='M14 14h3v3h-3zM20 14v.01M14 20h.01M17 20h4v-3'/%3E%3C/svg%3E") center / 30px no-repeat; }
.zm-idle strong { color: var(--zm-ink); font-size: 15px; }
.zm-idle span { color: var(--zm-muted); font-size: 13.5px; line-height: 1.45; }

/* ===== Configuração guiada do robô ===== */
.zm-wizard { margin-bottom: 22px; border-color: rgba(22, 163, 74, .35); }
.zmw-head { margin-bottom: 18px; }
.zmw-head h2 { font-size: 21px !important; font-weight: 800 !important; margin: 6px 0 4px !important; }
.zmw-badge { display: inline-block; background: #4ade80; color: #052e16; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 3px 10px; }
.zmw-step { display: flex; gap: 16px; padding: 18px 0; border-top: 1px solid var(--zm-line); }
.zmw-step > b { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #15803d, #22c55e); color: #fff; font-size: 14px; }
.zmw-step > div { flex: 1; min-width: 0; }
.zmw-step h3 { font-size: 16px; font-weight: 700; margin: 4px 0 12px; color: var(--zm-ink); }
.zmw-goals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.zmw-goal { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px; border-radius: 14px; border: 1.5px solid var(--zm-line); background: #fff; cursor: pointer; font-family: inherit; }
.zmw-goal span { font-size: 22px; }
.zmw-goal strong { font-size: 14.5px; color: var(--zm-ink); }
.zmw-goal small { font-size: 12.5px; color: var(--zm-muted); line-height: 1.4; }
.zmw-goal:hover { border-color: rgba(22, 163, 74, .5); }
.zmw-goal.on { border-color: var(--zm-green); background: var(--zm-green-soft); box-shadow: 0 0 0 3px rgba(34, 197, 94, .15); }
.zmw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.zmw-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--zm-ink); }
.zmw-grid .zmw-wide { grid-column: 1 / -1; }
.zmw-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.zmw-row > span { width: 72px; font-size: 13.5px; font-weight: 600; color: var(--zm-muted); }
.zmw-chip { border: 1px solid var(--zm-line); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13.5px; font-weight: 600; color: #334155; cursor: pointer; font-family: inherit; }
.zmw-chip:hover { background: #f8fafc; }
.zmw-chip.on { background: var(--zm-green-dark); border-color: var(--zm-green-dark); color: #fff; }
.zmw-prompt { margin-top: 8px; }
.zmw-prompt summary { cursor: pointer; color: var(--zm-green-dark); font-weight: 600; font-size: 14px; }
.zmw-prompt textarea { width: 100%; margin-top: 10px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.5; }
.zmw-test { display: flex; gap: 10px; }
.zmw-test .form-input { flex: 1; min-width: 0; }
.zmw-answer { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: #d9fdd3; color: var(--zm-ink); font-size: 14px; white-space: pre-wrap; max-width: 640px; }
.zmw-answer.loading { background: #f1f5f9; color: var(--zm-muted); }
.zmw-answer.error { background: #fff1f2; color: #9f1239; }
.zmw-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.zmw-status { margin-top: 10px; font-size: 14px; min-height: 18px; }
.zmw-status.ok { color: var(--zm-green-dark); font-weight: 600; }
.zmw-status.error { color: #be123c; }
@media (max-width: 1100px) { .zmw-goals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .zmw-step { gap: 10px; }
  .zmw-grid { grid-template-columns: minmax(0, 1fr); }
  .zmw-test { flex-direction: column; }
}

/* ===== Caixa de entrada (estilo Chatwoot) ===== */
body.light-theme .inbox-layout { height: calc(100vh - 210px); min-height: 520px; position: relative; }
body.light-theme .chat-list-sidebar { width: 360px; flex: none; display: flex; flex-direction: column; min-height: 0; }
.zm-ib-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.zm-ib-head strong { font-size: 17px; font-weight: 800; color: var(--zm-ink); }
.zm-ib-head span { font-size: 12px; font-weight: 700; color: var(--zm-muted); background: #f1f5f9; border-radius: 999px; padding: 2px 9px; }
body.light-theme .chat-search { border-bottom: 0; padding: 6px 12px 8px; }
.zm-ib-tabs { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--zm-line); }
.zm-ib-tabs button { flex: 1; border: 0; background: none; padding: 10px 4px 9px; font-weight: 600; font-size: 13px; font-family: inherit; color: var(--zm-muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.zm-ib-tabs button:hover { color: var(--zm-ink); }
.zm-ib-tabs button.on { color: var(--zm-green-dark); border-bottom-color: var(--zm-green); }
.zm-ib-n { font-size: 11px; color: inherit; opacity: .75; }
body.light-theme .chat-conversations { flex: 1; min-height: 0; overflow-y: auto; }
body.light-theme .chat-conv-item.zm-ib-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid #f1f5f3; border-left: 3px solid transparent; }
body.light-theme .chat-conv-item.zm-ib-item:hover { background: #f8faf9; }
body.light-theme .chat-conv-item.zm-ib-item.active { background: var(--zm-green-soft); border-left-color: var(--zm-green); }
.zm-ib-body { flex: 1; min-width: 0; }
.zm-ib-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.zm-ib-item .chat-conv-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zm-ib-item .chat-conv-time { font-size: 11.5px; flex: none; }
.zm-ib-item .chat-conv-last-msg { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.zm-ib-item.has-unread .chat-conv-name { font-weight: 800; }
.zm-ib-item.has-unread .chat-conv-last-msg { color: var(--zm-ink); font-weight: 600; }
.zm-ib-item.has-unread .chat-conv-time { color: var(--zm-green-dark); font-weight: 700; }
.zm-ib-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--zm-green); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.zm-ib-meta { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.zm-ib-kind { font-size: 11px; font-weight: 700; color: #475569; background: #f1f5f9; border-radius: 6px; padding: 2px 7px; }
.zm-av { flex: none; width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; background: var(--av, #16a34a); }
.zm-av.zm-av-group { border-radius: 12px; }
.zm-av svg { width: 22px; height: 22px; }
.zm-av.sm { width: 38px; height: 38px; font-size: 13px; }
.zm-av.lg { width: 72px; height: 72px; font-size: 24px; }
.zm-av.lg svg { width: 36px; height: 36px; }
.zm-ib-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 48px 24px; color: var(--zm-muted); font-size: 13.5px; }
.zm-ib-empty strong { color: var(--zm-ink); font-size: 15px; }

/* Cabeçalho e ações da conversa */
body.light-theme .chat-header { height: auto; min-height: 64px; padding: 10px 16px; gap: 12px; background: #fff; }
.zm-ib-head-av:empty { display: none; }
body.light-theme .chat-contact-info { flex: 1; min-width: 0; }
body.light-theme #currentContactName { font-size: 15.5px; font-weight: 700; }
body.light-theme #currentContactPhone { font-size: 12.5px; color: var(--zm-muted); }
.zm-ib-actions { display: none; gap: 6px; }
.zm-ib-actions.on { display: flex; }
.zm-ib-act { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--zm-line); background: #fff; color: #334155; border-radius: 10px; padding: 7px 10px; font-weight: 600; font-size: 12.5px; font-family: inherit; cursor: pointer; text-decoration: none; }
.zm-ib-act:hover { background: var(--zm-green-soft); color: var(--zm-green-dark); }
.zm-ib-act[hidden] { display: none; }

/* Mensagens */
body.light-theme .chat-messages { padding: 18px 22px; gap: 4px; background: #efeae2; }
.zm-day { display: flex; justify-content: center; margin: 12px 0 8px; }
.zm-day span { background: #fff; color: #54656f; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 8px; box-shadow: 0 1px 1px rgba(11, 20, 26, .08); text-transform: capitalize; }
body.light-theme .chat-bubble { max-width: 68%; margin-top: 6px; padding: 7px 10px 6px; }
body.light-theme .chat-bubble.zm-cont { margin-top: 1px; }
.zm-sender { font-size: 12.5px; font-weight: 700; margin-bottom: 2px; }
body.light-theme .chat-bubble-text { white-space: pre-wrap; word-break: break-word; }
.chat-bubble-text a { color: #027eb5; text-decoration: underline; }
.zm-media { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #54656f; background: rgba(0, 0, 0, .04); border-radius: 8px; padding: 6px 9px; }

/* Campo de resposta */
body.light-theme .chat-input-area { flex-wrap: wrap; align-items: flex-end; padding: 8px 14px 12px; position: relative; background: #fff; }
.zm-ib-tools { flex-basis: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.zm-ib-tool { border: 0; background: #f1f5f3; color: #334155; border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: 12.5px; font-family: inherit; cursor: pointer; }
.zm-ib-tool:hover { background: var(--zm-green-soft); color: var(--zm-green-dark); }
.zm-ib-tool:disabled { opacity: .6; cursor: wait; }
.zm-ib-hint { margin-left: auto; font-size: 11.5px; color: #94a3b8; }
body.light-theme .chat-input-area .chat-input { flex: 1; height: auto; min-height: 44px; max-height: 160px; resize: none; background: #f8faf9; border: 1px solid var(--zm-line) !important; border-radius: 12px; padding: 11px 12px; }
.zm-qr-pop { position: absolute; left: 14px; bottom: calc(100% + 6px); width: min(420px, calc(100% - 28px)); max-height: 320px; overflow: auto; background: #fff; border: 1px solid var(--zm-line); border-radius: 14px; box-shadow: 0 18px 44px rgba(15, 23, 42, .16); padding: 8px; z-index: 30; }
.zm-qr-pop[hidden] { display: none; }
.zm-qr-title { font-size: 12px; font-weight: 700; color: var(--zm-muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; }
.zm-qr-item { display: flex; align-items: stretch; border-radius: 10px; }
.zm-qr-item:hover { background: var(--zm-green-soft); }
.zm-qr-use { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 8px; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; gap: 2px; }
.zm-qr-use b { color: var(--zm-green-dark); font-size: 13px; }
.zm-qr-use span { color: #475569; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zm-qr-del { border: 0; background: none; color: #94a3b8; font-size: 18px; cursor: pointer; padding: 0 10px; }
.zm-qr-del:hover { color: #be123c; }
.zm-qr-empty { padding: 10px 8px; color: var(--zm-muted); font-size: 13px; }
.zm-qr-new { width: 100%; margin-top: 4px; border: 1px dashed rgba(22, 163, 74, .5); background: #fff; color: var(--zm-green-dark); border-radius: 10px; padding: 9px; font-weight: 600; font-size: 13px; font-family: inherit; cursor: pointer; }

/* Painel do contato */
.zm-ib-panel { display: none; width: 300px; flex: none; border-left: 1px solid var(--zm-line); background: #fff; overflow-y: auto; padding: 18px 16px; position: relative; }
.inbox-layout.zm-panel-open .zm-ib-panel { display: block; }
.zm-ib-close { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 22px; color: #94a3b8; cursor: pointer; }
.zm-ib-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding-bottom: 14px; border-bottom: 1px solid var(--zm-line); }
.zm-ib-card strong { font-size: 16px; color: var(--zm-ink); }
.zm-ib-card span { font-size: 13px; color: var(--zm-muted); }
.zm-ib-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; padding: 14px 0; border-bottom: 1px solid var(--zm-line); font-size: 13px; }
.zm-ib-facts dt { color: var(--zm-muted); }
.zm-ib-facts dd { margin: 0; text-align: right; color: var(--zm-ink); font-weight: 600; }
.zm-ib-panel h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--zm-muted); margin: 14px 0 8px; }
.zm-ib-people { list-style: none; display: grid; gap: 6px; font-size: 13px; color: #334155; }
.zm-ib-people li { display: flex; align-items: center; gap: 8px; }
.zm-ib-people span { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.zm-ib-panel textarea { width: 100%; font-size: 13px; }
.zm-ib-note-hint { display: block; margin-top: 6px; font-size: 11.5px; color: #94a3b8; }
@media (max-width: 1280px) {
  .zm-ib-panel { position: absolute; right: 0; top: 0; bottom: 0; z-index: 20; box-shadow: -14px 0 34px rgba(15, 23, 42, .12); }
  .zm-ib-act span { display: none; }
}
@media (max-width: 900px) {
  body.light-theme .chat-list-sidebar { width: 100%; }
  .zm-ib-panel { width: 100%; }
  .zm-ib-hint { display: none; }
  body.light-theme .chat-bubble { max-width: 86%; }
}
