/* ==========================================================================
   ZapMatrix — design system (verde futurista · Apple-like · dark + light)
   ========================================================================== */

:root {
  --bg: #040706;
  --bg-2: #071009;
  --panel: rgba(255, 255, 255, 0.036);
  --panel-2: rgba(255, 255, 255, 0.058);
  --panel-solid: #0b1310;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9f5ee;
  --text-2: #c3d6cb;
  --muted: #7f9c8d;
  --faint: #55705f;
  --green: #00e58a;
  --green-2: #7dffc4;
  --green-deep: #04a567;
  --lime: #b6ff3d;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --amber: #fbbf24;
  --red: #fb7185;
  --blue: #60a5fa;
  --glow: rgba(0, 229, 138, 0.22);
  --glow-soft: rgba(0, 229, 138, 0.08);
  --shadow: 0 24px 70px -30px rgba(0, 0, 0, 0.85);
  --shadow-sm: 0 10px 30px -18px rgba(0, 0, 0, 0.7);
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --sidebar: 252px;
  /* --bbh = altura da barra inferior do celular (58px + safe-area do iPhone)
     --topbar = altura da barra de cima · --vvh = altura REAL visível em px,
     medida pelo JS (visualViewport) para o teclado não cobrir o composer */
  --bbh: 0px;
  --topbar: 64px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
}

html[data-theme="light"] {
  --bg: #f3f8f5;
  --bg-2: #eaf4ee;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-2: #ffffff;
  --panel-solid: #ffffff;
  --line: rgba(4, 42, 27, 0.09);
  --line-strong: rgba(4, 42, 27, 0.18);
  --text: #061710;
  --text-2: #254336;
  --muted: #5c7a6b;
  --faint: #8aa295;
  --green: #00a86a;
  --green-2: #05c47c;
  --green-deep: #067a4e;
  --lime: #4f9d00;
  --glow: rgba(0, 168, 106, 0.2);
  --glow-soft: rgba(0, 168, 106, 0.07);
  --shadow: 0 30px 70px -38px rgba(4, 42, 27, 0.35);
  --shadow-sm: 0 14px 34px -22px rgba(4, 42, 27, 0.28);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.011em;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 82% -10%, rgba(0, 229, 138, 0.13), transparent 62%),
    radial-gradient(700px 520px at -10% 88%, rgba(34, 211, 238, 0.07), transparent 60%),
    radial-gradient(600px 500px at 45% 115%, rgba(125, 255, 196, 0.06), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 78%);
  pointer-events: none;
  opacity: 0.8;
}
html[data-theme="light"] body::after {
  background-image:
    linear-gradient(to right, rgba(4, 42, 27, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(4, 42, 27, 0.035) 1px, transparent 1px);
}
::selection { background: rgba(0, 229, 138, 0.32); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
svg { width: 16px; height: 16px; flex: 0 0 auto; }
svg.chart { width: 100%; height: 168px; }
.flow-edges { width: 100%; height: 100%; }
.brand-mark svg, .mark svg { width: 21px; height: 21px; }
.empty .ico svg { width: 25px; height: 25px; }
.stat-ic svg { width: 17px; height: 17px; }
.auth-point svg { width: 17px; height: 17px; flex: 0 0 17px; }
.msg-media video, .msg-media img { width: 100%; }

[hidden] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(127, 156, 141, 0.28); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------- tipografia */
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.035em; line-height: 1.12; }
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: 22px; }
h3 { font-size: 16px; letter-spacing: -0.02em; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.green { color: var(--green); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0; }
.tiny { font-size: 11.5px; }
.small { font-size: 12.5px; }
.strong { font-weight: 650; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--green);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: var(--green); box-shadow: 0 0 12px var(--green); }
.grad-text {
  background: linear-gradient(100deg, var(--text) 10%, var(--green-2) 55%, var(--green) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ----------------------------------------------------------------- layout */
html { --sbw: var(--sidebar); }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sbw); flex: 0 0 var(--sbw);
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  display: flex; flex-direction: column; gap: 8px;
  padding: 22px 14px 16px;
  background: linear-gradient(180deg, rgba(9, 16, 13, 0.92), rgba(4, 7, 6, 0.94));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(22px);
}
html[data-theme="light"] .sidebar { background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(240,248,244,.96)); }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 18px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 38px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #062a1d, #0a3d29 55%, #052018);
  border: 1px solid rgba(0, 229, 138, 0.35);
  box-shadow: 0 0 24px -6px rgba(0, 229, 138, 0.55), inset 0 0 18px rgba(0, 229, 138, 0.12);
}
.brand-mark svg { width: 21px; height: 21px; color: var(--green); filter: drop-shadow(0 0 7px rgba(0,229,138,.6)); }
.brand-name { font-size: 17px; font-weight: 750; letter-spacing: -0.04em; }
.brand-name span { color: var(--green); }
.brand-sub { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint); margin-top: 1px; }
.nav-wrap { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.nav {
  display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1 1 auto; min-height: 0;
  scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 6px;
}
.nav::-webkit-scrollbar { width: 0; height: 0; display: none; }
/* chevron discreto: indica que existe mais navegação abaixo */
.nav-more {
  position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%) translateY(6px);
  width: 26px; height: 22px; border-radius: 999px; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(4,7,6,0), rgba(4,7,6,.92) 55%);
  color: var(--muted); border: 0; cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
}
html[data-theme="light"] .nav-more { background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.95) 55%); }
.nav-more.on { opacity: .9; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.nav-more:hover { color: var(--green); }
.nav-more svg { width: 15px; height: 15px; animation: navNudge 1.9s ease-in-out infinite; }
@keyframes navNudge { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(2px); } }
.nav-label { font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); padding: 16px 12px 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; color: var(--muted);
  font-size: 13.5px; font-weight: 550; transition: 0.16s ease; border: 1px solid transparent;
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.85; flex: 0 0 18px; }
.nav-item:hover { color: var(--text-2); background: rgba(255, 255, 255, 0.035); }
.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(0, 229, 138, 0.15), rgba(0, 229, 138, 0.03) 70%, transparent);
  border-color: rgba(0, 229, 138, 0.16);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 4px 4px 0; background: var(--green); box-shadow: 0 0 14px var(--green);
}
.nav-item.active svg { color: var(--green); opacity: 1; filter: drop-shadow(0 0 6px rgba(0,229,138,.5)); }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--green); color: #032015; font-size: 10.5px; font-weight: 800;
  display: grid; place-items: center;
}
.sidebar-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 14px; }
.user-chip:hover { background: rgba(255,255,255,.04); }
.user-chip .avatar { width: 34px; height: 34px; }
.user-chip-name { font-size: 12.5px; font-weight: 650; }
.user-chip-plan { font-size: 10.5px; color: var(--faint); }
.icon-row { display: flex; gap: 2px; margin-left: auto; }

.main { flex: 1; min-width: 0; margin-left: var(--sbw); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: 64px; flex: 0 0 64px;
  display: flex; align-items: center; gap: 14px; padding: 0 clamp(16px, 3vw, 34px);
  background: rgba(4, 7, 6, 0.72); backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
html[data-theme="light"] .topbar { background: rgba(247, 251, 249, 0.78); }
.topbar .crumbs { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.topbar .crumbs b { color: var(--text); font-weight: 600; }
.topbar-spacer { flex: 1; }
.menu-btn { display: none; }
.page { padding: clamp(18px, 3vw, 34px); max-width: 1560px; width: 100%; margin: 0 auto; }
/* Inbox ocupa a área toda (sem o padding do .page).
   Classe e não `style` inline: inline sobrevivia à navegação e a próxima
   tela ficava sem padding, colada no menu lateral. */
.page.page-flush { padding: 0; max-width: none; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .grow { flex: 1; min-width: 220px; }
.page-sub { color: var(--muted); margin-top: 7px; font-size: 13.5px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 17px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--text); font-size: 13px; font-weight: 600;
  transition: 0.16s ease; white-space: nowrap; letter-spacing: -0.01em;
}
.btn:hover { background: var(--panel-2); border-color: rgba(255,255,255,.26); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(180deg, #16f09a, #00cf7d); border-color: rgba(0, 229, 138, 0.6);
  color: #022116; box-shadow: 0 10px 34px -14px rgba(0, 229, 138, 0.75), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary:hover { background: linear-gradient(180deg, #2bffab, #06dd87); box-shadow: 0 14px 40px -12px rgba(0, 229, 138, 0.9); }
.btn-soft { background: rgba(0, 229, 138, 0.1); border-color: rgba(0, 229, 138, 0.22); color: var(--green); }
.btn-soft:hover { background: rgba(0, 229, 138, 0.16); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel); color: var(--text); }
.btn-danger { background: rgba(251, 113, 133, 0.1); border-color: rgba(251, 113, 133, 0.25); color: var(--red); }
.btn-danger:hover { background: rgba(251, 113, 133, 0.18); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; filter: grayscale(.35); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 12px; }
.btn-icon.btn-sm { width: 30px; height: 30px; border-radius: 9px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- inputs */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: -0.005em; }
.hint { font-size: 11.5px; color: var(--faint); line-height: 1.45; }
.input, .textarea, .select {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  color: var(--text); outline: none; transition: 0.15s ease; font-size: 13.5px;
}
html[data-theme="light"] .input, html[data-theme="light"] .textarea, html[data-theme="light"] .select {
  background: #fff; border-color: rgba(4,42,27,.13);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus, .select:focus {
  border-color: rgba(0, 229, 138, 0.55); box-shadow: 0 0 0 3px rgba(0, 229, 138, 0.11);
  background: rgba(0, 229, 138, 0.03);
}
/* erro preso ao campo (modal continua aberto para corrigir) */
.field-err {
  font-size: 11.5px; line-height: 1.45; color: var(--red, #fb7185);
  display: flex; align-items: flex-start; gap: 5px;
}
.field-err[hidden] { display: none; }
.input-err, .input-err:focus {
  border-color: rgba(251, 113, 133, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.11) !important;
  background: rgba(251, 113, 133, 0.04) !important;
}
.textarea { height: auto; min-height: 100px; padding: 11px 13px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237f9c8d' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
select option { background: var(--panel-solid); color: var(--text); }
/* ------------------------------------------- dropdown de múltipla escolha */
.dd { position: relative; }
.dd-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; cursor: pointer; font-size: 13px;
}
.dd-btn svg { width: 15px; height: 15px; color: var(--faint); flex: 0 0 15px; transition: transform .16s ease; }
.dd.open .dd-btn svg { transform: rotate(180deg); }
.dd.open .dd-btn { border-color: rgba(0,229,138,.55); box-shadow: 0 0 0 3px rgba(0,229,138,.11); }
.dd-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.dd-value.faint { color: var(--faint); }
.dd-menu {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 224px; overflow-y: auto; padding: 6px;
  background: var(--panel-solid, #0b120e); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 18px 45px -14px rgba(0,0,0,.7);
}
.dd-menu[hidden] { display: none; }
.dd-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 8px;
  cursor: pointer; font-size: 12.5px; color: var(--text-2, var(--text)); user-select: none;
}
.dd-item:hover { background: rgba(255,255,255,.05); }
.dd-item input { width: 15px; height: 15px; accent-color: #00c47c; cursor: pointer; flex: 0 0 15px; }
.dd-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.dd-empty { padding: 12px 10px; font-size: 12px; color: var(--faint); text-align: center; }

/* rodapé do wizard de contato */
.cw-steps { margin-bottom: 18px; }
.cw-foot { align-items: center; gap: 8px; flex-wrap: wrap; }
.cw-count { white-space: nowrap; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 0; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid-auto { display: flex; flex-direction: column; gap: 14px; }

.switch { position: relative; width: 42px; height: 24px; flex: 0 0 42px; border-radius: 99px; background: rgba(127,156,141,.28); border: 1px solid var(--line); cursor: pointer; transition: .18s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 99px; background: #fff; transition: .18s; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch.on { background: var(--green); border-color: transparent; box-shadow: 0 0 18px -4px var(--green); }
.switch.on::after { left: 21px; background: #032015; }

/* ----------------------------------------------------------------- cards */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
html[data-theme="light"] .card { background: #fff; box-shadow: 0 18px 40px -30px rgba(4,42,27,.3); }
.card-pad { padding: 20px; }
.card-hover { transition: .2s ease; }
.card-hover:hover { transform: translateY(-3px); border-color: rgba(0, 229, 138, 0.3); box-shadow: 0 28px 60px -34px rgba(0, 229, 138, 0.45); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { flex: 1; }
.card-title { font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; }
.card-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 20px; }
.card-glow::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -70px; top: -110px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 65%); pointer-events: none;
}
.stat { padding: 19px 20px; }
.stat-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.stat-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(0, 229, 138, 0.09); border: 1px solid rgba(0,229,138,.18); color: var(--green); }
.stat-ic svg { width: 17px; height: 17px; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 550; }
.stat-value { font-size: 31px; font-weight: 750; letter-spacing: -0.045em; line-height: 1; }
.stat-foot { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.delta { font-size: 11px; font-weight: 700; color: var(--green); background: rgba(0,229,138,.1); padding: 2px 7px; border-radius: 99px; }

/* --------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 9px;
  border-radius: 99px; font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); white-space: nowrap;
}
.badge.green { background: rgba(0,229,138,.1); border-color: rgba(0,229,138,.25); color: var(--green-2); }
.badge.amber { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.25); color: var(--amber); }
.badge.red { background: rgba(251,113,133,.1); border-color: rgba(251,113,133,.25); color: var(--red); }
.badge.blue { background: rgba(96,165,250,.1); border-color: rgba(96,165,250,.25); color: var(--blue); }
.badge.violet { background: rgba(167,139,250,.1); border-color: rgba(167,139,250,.25); color: var(--violet); }
.badge.gray { color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 99px; background: var(--green); box-shadow: 0 0 8px var(--green); flex: 0 0 7px; }
.dot.amber { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.dot.red { background: var(--red); box-shadow: 0 0 8px var(--red); }
.dot.gray { background: var(--faint); box-shadow: none; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 7px; font-size: 10.5px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); }
.tag i { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px; display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(0,229,138,.22), rgba(34,211,238,.14));
  border: 1px solid rgba(0,229,138,.22); color: var(--green-2); font-weight: 700; font-size: 13px;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 11px; }
.avatar.lg { width: 54px; height: 54px; flex-basis: 54px; font-size: 18px; }

/* ---------------------------------------------------------------- tabela */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--faint); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: .13s; }
.table tbody tr:hover { background: rgba(255,255,255,.025); }
.table tbody tr.row-sel, .table tbody tr.row-sel:hover { background: rgba(0,229,138,.07); }
.cell-main { display: flex; align-items: center; gap: 11px; min-width: 180px; }
.cell-name { font-weight: 600; font-size: 13px; }
.cell-sub { font-size: 11.5px; color: var(--muted); }
.table-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* --------------------------------------------------------------- modais */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 500; background: rgba(2, 6, 4, 0.66);
  backdrop-filter: blur(10px); display: grid; place-items: center; padding: 18px;
  animation: fade .18s ease;
}
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: linear-gradient(180deg, #0c1611, #07100c); border: 1px solid var(--line-strong);
  border-radius: 26px; box-shadow: 0 40px 120px -30px rgba(0,0,0,.9);
  animation: pop .2s cubic-bezier(.2,.9,.3,1.2);
}
html[data-theme="light"] .modal { background: #fff; }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 0; }
.modal-head h2 { font-size: 20px; flex: 1; }
.modal-body { padding: 20px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 0 24px 22px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(2,6,4,.6); backdrop-filter: blur(6px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 101; width: min(560px, 100%);
  background: linear-gradient(180deg, #0b1510, #060d09); border-left: 1px solid var(--line);
  box-shadow: -30px 0 90px -30px rgba(0,0,0,.8); overflow-y: auto; animation: slidein .22s ease;
}
html[data-theme="light"] .drawer { background: #fff; }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); background: inherit; }
.drawer-body { padding: 22px; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98) } }
@keyframes slidein { from { transform: translateX(30px); opacity: .4 } }

/* ---------------------------------------------------------------- toasts */
.toast-wrap { position: fixed; z-index: 600; right: 18px; top: 18px; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px;
  padding: 12px 15px; border-radius: 14px; background: #0e1a14; border: 1px solid rgba(0,229,138,.28);
  box-shadow: 0 20px 50px -18px rgba(0,0,0,.8); font-size: 13px; animation: toastin .22s ease;
}
html[data-theme="light"] .toast { background: #fff; }
.toast.err { border-color: rgba(251,113,133,.4); }
.toast svg { width: 17px; height: 17px; color: var(--green); flex: 0 0 17px; }
.toast.err svg { color: var(--red); }
@keyframes toastin { from { opacity: 0; transform: translateY(-8px) } }
.toast.out { animation: toastout .2s forwards; }
@keyframes toastout { to { opacity: 0; transform: translateX(20px) } }

/* ----------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); width: fit-content; }
.tab { height: 32px; padding: 0 13px; border: 0; background: transparent; border-radius: 9px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tab.active { background: var(--panel-2); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.segmented button { border: 0; background: transparent; padding: 7px 13px; font-size: 12px; color: var(--muted); }
.segmented button.active { background: var(--green); color: #032015; font-weight: 700; }
.segmented .seg.on, .segmented button.on { background: var(--green); color: #032015; font-weight: 700; }
@media (max-width: 640px) {
  .segmented { display: flex; flex-wrap: wrap; width: 100%; }
  .segmented .seg, .segmented button { flex: 1 1 auto; padding: 8px 10px; font-size: 11.5px; }
}

/* ============================ página: novo envio ===================== */
.nb-grid { display: flex; flex-direction: column; gap: 14px; }
.nb-estimate {
  display: flex; align-items: center; gap: 12px; margin-top: 16px;
  padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--panel);
}
.nb-estimate-ic {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(0,229,138,.1); border: 1px solid rgba(0,229,138,.2); color: var(--green);
}
.nb-estimate-ic svg { width: 17px; height: 17px; }
.nb-template-preview {
  padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px;
  background: rgba(0,0,0,.25); font-size: 12.5px; line-height: 1.6; color: var(--text-2);
  white-space: pre-wrap; max-height: 160px; overflow: auto;
}
html[data-theme="light"] .nb-template-preview { background: #f6faf8; }
.nb-vars { display: grid; gap: 8px; }
.nb-var { display: flex; align-items: center; gap: 10px; }
.nb-var > span {
  flex: 0 0 46px; text-align: center; font-size: 11px; padding: 5px 0;
  border-radius: 8px; background: rgba(0,229,138,.1); color: var(--green);
  border: 1px solid rgba(0,229,138,.2);
}
.nb-buttons { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.nb-btnrow {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); gap: 10px;
  align-items: center; margin-bottom: 8px;
}
.nb-btnlabel {
  display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600;
  padding: 8px 11px; border: 1px dashed var(--line); border-radius: 10px; color: var(--text-2);
  min-width: 0;
}
.nb-btnlabel span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-btnlabel svg { width: 14px; height: 14px; color: var(--faint); flex: 0 0 14px; }
.nb-notice {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 14px; margin-top: 14px; border-radius: 12px;
  border: 1px solid rgba(96,165,250,.28); background: rgba(96,165,250,.07);
  font-size: 12px; color: var(--text-2);
}
.nb-notice > svg, .nb-notice svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--blue); margin-top: 2px; }
.nb-notice .hint { margin-top: 3px; }
@media (max-width: 640px) {
  .nb-btnrow { grid-template-columns: minmax(0,1fr); }
}

/* -------------------------------------------------------------- progresso */
.progress { height: 7px; border-radius: 99px; background: rgba(127,156,141,.16); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green-deep), var(--green)); box-shadow: 0 0 14px var(--glow); transition: width .5s ease; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 58px 20px; color: var(--muted); }
.empty .ico { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--green); }
.empty .ico svg { width: 25px; height: 25px; }
.empty h3 { color: var(--text); }
.empty p { max-width: 360px; font-size: 13px; }

/* ---------------------------------------------------------------- charts */
.chart { width: 100%; height: 168px; display: block; overflow: visible; }
.chart-legend { display: flex; gap: 16px; font-size: 11px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 6px; }

/* ------------------------------------------------------------ auth/landing */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; }
.auth-aside {
  position: relative; overflow: hidden; padding: 44px; display: flex; flex-direction: column; justify-content: space-between;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(700px 500px at 20% 0%, rgba(0,229,138,.16), transparent 60%),
    radial-gradient(600px 500px at 100% 100%, rgba(34,211,238,.08), transparent 60%),
    linear-gradient(160deg, #061009, #040706);
}
.auth-aside::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: radial-gradient(ellipse at 30% 20%, #000, transparent 70%);
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-quote { font-size: clamp(26px, 3.4vw, 42px); font-weight: 750; letter-spacing: -0.045em; line-height: 1.08; max-width: 560px; }
.auth-quote em { font-style: normal; color: var(--green); }
.auth-points { display: grid; gap: 12px; margin-top: 26px; }
.auth-point { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; color: var(--text-2); }
.auth-point svg { width: 17px; height: 17px; color: var(--green); flex: 0 0 17px; margin-top: 2px; }
.auth-main { display: grid; place-items: center; padding: 32px 22px; }
.auth-card { width: min(400px, 100%); }
.auth-card h1 { font-size: 30px; margin-bottom: 6px; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; }
.auth-switch { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 18px; }
.auth-switch a { color: var(--green); font-weight: 600; cursor: pointer; }
.auth-err { background: rgba(251,113,133,.1); border: 1px solid rgba(251,113,133,.28); color: #ffc3cc; font-size: 12.5px; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; }
.auth-orbs { position: absolute; inset: 0; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 12s ease-in-out infinite; }
.orb.a { width: 260px; height: 260px; background: rgba(0,229,138,.5); top: -60px; right: -40px; }
.orb.b { width: 200px; height: 200px; background: rgba(34,211,238,.35); bottom: 10%; left: -60px; animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-18px) } }

/* ------------------------------------------------------------------ inbox */
.inbox { display: grid; grid-template-columns: 342px 1fr; height: calc(100vh - 64px); min-height: 500px; }
.convos { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; background: rgba(255,255,255,.012); }
.convos-head { padding: 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 11px; min-width: 0; }
/* 4 segmentos no mobile: sem min-width:0 o flex/grid calculava a largura pelo
   conteúdo e a coluna estourava (os botões ficavam sem texto visível) */
.convos-head .row, .convos-head .segmented, .convos-head .segmented .seg { min-width: 0; }
/* quatro filtros na coluna estreita: aperta o texto para caber em uma linha */
.convos-head .segmented .seg { padding: 6px 5px; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convos-list { overflow-y: auto; flex: 1; }
.convo {
  display: flex; gap: 11px; padding: 12px 15px; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: .12s; position: relative;
}
.convo:hover { background: rgba(255,255,255,.03); }
.convo.active { background: linear-gradient(90deg, rgba(0,229,138,.11), rgba(0,229,138,.02)); }
.convo.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--green); }
/* seleção múltipla de conversas (apagar histórico em massa) */
.convo-pick { display: grid; place-items: center; flex: 0 0 16px; opacity: 0; transition: opacity .12s ease; }
.convo:hover .convo-pick, .convo.picked .convo-pick { opacity: 1; }
.convo-pick input { pointer-events: none; width: 15px; height: 15px; accent-color: #00c47c; cursor: pointer; }
.convo.picked { background: rgba(0,229,138,.07); }
.cv-all { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); cursor: pointer; user-select: none; }
.cv-all input { width: 14px; height: 14px; accent-color: #00c47c; }
.cv-bulk {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px;
  background: rgba(0,229,138,.07); border: 1px solid rgba(0,229,138,.22);
}
.cv-bulk #cv-bulk-count { flex: 1; }
@media (hover: none) { .convo-pick { opacity: 1; } }
.convo-body { flex: 1; min-width: 0; }
.convo-top { display: flex; align-items: center; gap: 7px; }
.convo-name { font-size: 13px; font-weight: 600; flex: 1; }
.convo-time { font-size: 10.5px; color: var(--faint); }
.convo-preview { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.unread-dot { min-width: 18px; height: 18px; border-radius: 99px; background: var(--green); color: #032015; font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }
.chat { display: flex; flex-direction: column; min-height: 0; background: radial-gradient(700px 500px at 70% 0%, rgba(0,229,138,.04), transparent 60%); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); min-height: 64px; }
.chat-head-main { flex: 1; min-width: 0; }
.chat-head-main.cp-open { background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; border-radius: 10px; }
.chat-head-main.cp-open:hover .chat-head-name { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.chat-head-name { font-size: 14px; font-weight: 650; }
.chat-head-sub { font-size: 11px; color: var(--muted); }
.back-chat { display: none; }

/* ------------------------------------------- painel do contato (Inbox) */
.inbox.with-panel { grid-template-columns: 342px minmax(0, 1fr) 340px; }
.contact-panel {
  border-left: 1px solid var(--line); background: rgba(255,255,255,.022);
  display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
  animation: cpIn .16s ease;
}
.contact-panel[hidden] { display: none; }
@keyframes cpIn { from { opacity: 0; transform: translateX(12px); } }
.cp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2; background: var(--bg);
}
.cp-head b { font-size: 13px; }
.cp-loading { padding: 22px 16px; color: var(--muted); font-size: 12.5px; }
.cp-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.cp-hero { display: flex; gap: 12px; align-items: center; }
.cp-hero-txt { min-width: 0; }
.cp-name { font-size: 15px; font-weight: 700; }
.cp-phone { font-size: 12px; color: var(--muted); }
.cp-copy {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  background: none; border: 0; padding: 0; color: var(--green);
  font-size: 11.5px; cursor: pointer;
}
.cp-copy svg { width: 13px; height: 13px; }
.cp-window {
  display: flex; gap: 9px; align-items: flex-start; padding: 11px 12px;
  border-radius: 12px; border: 1px solid var(--line); font-size: 11.5px;
}
.cp-window svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
.cp-window b { display: block; font-size: 12px; }
.cp-window span { color: var(--muted); }
.cp-window.open { border-color: rgba(0,229,138,.3); background: rgba(0,229,138,.07); color: var(--green); }
.cp-window.closed { border-color: rgba(251,191,36,.28); background: rgba(251,191,36,.07); color: var(--amber); }
.cp-sec { display: flex; flex-direction: column; gap: 8px; }
.cp-sec-title {
  display: flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--faint);
}
.cp-sec-title svg { width: 14px; height: 14px; }
.cp-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; padding: 2px 0; }
/* sequências de robô no painel do contato: execução em andamento + pausados */
.cp-run { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.cp-run-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cp-run-txt b { font-size: 12px; }
.cp-run-txt span { font-size: 11px; color: var(--muted); }
.cp-run-btn { flex: 0 0 auto; }
.cp-run.paused { border-style: dashed; opacity: .85; }
.cp-run-sep { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-top: 2px; }
/* Atendente IA no painel do contato: aviso de pausa por atendimento humano */
.cp-ai-pause { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; }
.cp-ai-pause span { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cp-ai-pause svg { width: 13px; height: 13px; flex: 0 0 13px; }
.cp-ai-pause .btn { flex: 0 0 auto; }
.cp-ai-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cp-ai-txt { min-width: 0; }
.cp-ai-txt b { font-size: 12px; display: block; }
.cp-ai-txt span { font-size: 11px; color: var(--muted); }
.switch.busy { opacity: .55; pointer-events: none; }
.cp-k { color: var(--muted); flex: 0 0 auto; }
.cp-v { text-align: right; min-width: 0; word-break: break-word; }
.cp-notes { font-size: 12px; color: var(--text-2); line-height: 1.55; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.cp-foot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px; }
.cp-backdrop { display: none; }
/* prévia do texto do template no envio */
.tp-preview {
  font-size: 12.5px; line-height: 1.55; white-space: normal; color: var(--text-2);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 14px; max-height: 150px; overflow-y: auto;
}
.tp-preview b { color: var(--green); }
.msgs { flex: 1; overflow-y: auto; padding: 22px 20px 12px; display: flex; flex-direction: column; gap: 7px; }
.msgs-day { align-self: center; font-size: 10.5px; color: var(--faint); background: var(--panel); padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); margin: 8px 0; }
.msg { max-width: min(460px, 78%); padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.45; position: relative; animation: msgin .16s ease; }
@keyframes msgin { from { opacity: 0; transform: translateY(4px) } }
.msg-in { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg-out { align-self: flex-end; background: linear-gradient(140deg, #00d987, #00bf78); color: #022116; border-bottom-right-radius: 5px; box-shadow: 0 6px 20px -10px rgba(0,229,138,.6); }
.msg-out .msg-time { color: rgba(2,33,22,.6); }
.msg-time { font-size: 9.5px; opacity: .6; margin-top: 3px; text-align: right; }
/* lixeira da mensagem: só aparece ao passar o mouse (no toque, sempre visível mas discreta) */
.msg { position: relative; }
.msg-del {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; padding: 0;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: var(--panel); color: var(--red, #fb7185); border: 1px solid var(--line);
  box-shadow: 0 3px 10px rgba(0,0,0,.35); opacity: 0; transform: scale(.85);
  transition: opacity .14s ease, transform .14s ease, background .14s ease;
  z-index: 2;
}
.msg-del svg { width: 12px; height: 12px; }
.msg:hover .msg-del, .msg-del:focus-visible { opacity: 1; transform: scale(1); }
.msg-del:hover { background: rgba(251,113,133,.16); border-color: rgba(251,113,133,.5); }
@media (hover: none) {
  .msg-del { opacity: .55; transform: scale(1); }
}
.msg-status { font-size: 9.5px; margin-left: 5px; }
.msg-media { border-radius: 10px; overflow: hidden; margin-bottom: 5px; max-width: 260px; }
.msg-media { position: relative; display: block; }
.msg-media img { display: block; cursor: zoom-in; }
.msg-audio { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.msg-audio audio { max-width: 230px; height: 34px; }
.msg-file { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; padding: 8px 10px; border-radius: 10px; background: rgba(127,156,141,.1); border: 1px solid var(--line); text-decoration: none; color: inherit; max-width: 260px; }
.msg-file span { flex: 1; font-size: 12.5px; text-decoration: underline; word-break: break-word; }
.msg-file svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--muted); }
.msg-dl { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; color: var(--muted); background: rgba(127,156,141,.12); flex: 0 0 26px; }
.msg-dl svg { width: 14px; height: 14px; }
.msg-dl:hover { color: var(--green); background: rgba(0,229,138,.14); }
.msg-caption { margin-top: 2px; }
.msg-lost {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 260px;
  padding: 8px 10px; margin-bottom: 4px; border-radius: 10px;
  border: 1px dashed rgba(251,191,36,.4); background: rgba(251,191,36,.07);
  color: var(--amber); font-size: 12px;
}
.msg-lost svg { width: 15px; height: 15px; flex: 0 0 15px; }
.msg-lost span { flex: 1 1 100px; word-break: break-word; }
.msg-lost .btn { height: 26px; padding: 0 9px; font-size: 11px; }
.msg-media .msg-dl {
  position: absolute; right: 7px; top: 7px; z-index: 2;
  background: rgba(4,7,6,.62); color: #fff; backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .15s ease;
}
.msg-media:hover .msg-dl, .msg-media .msg-dl:focus-visible { opacity: 1; }
@media (hover: none) { .msg-media .msg-dl { opacity: .9; } }
/* visualizador em tela cheia (imagem/vídeo do Inbox) */
.lb {
  position: fixed; inset: 0; z-index: 950; display: grid; place-items: center;
  padding: 24px; background: rgba(2,6,4,.88); backdrop-filter: blur(6px);
  cursor: zoom-out; animation: lbIn .16s ease;
}
.lb img, .lb video { max-width: min(1100px, 96vw); max-height: 92vh; border-radius: 14px; box-shadow: 0 30px 90px -30px rgba(0,0,0,.9); }
.lb img { cursor: zoom-out; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.window-note { margin: 12px 20px 0; padding: 10px 14px; border-radius: 12px; background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.22); color: var(--amber); font-size: 12px; display: flex; gap: 9px; align-items: center; }
.window-note svg { width: 16px; height: 16px; flex: 0 0 16px; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.composer .textarea { min-height: 44px; max-height: 140px; border-radius: 14px; }
.composer-actions { display: flex; gap: 4px; }
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }

/* ----------------------------------------------------------------- kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 18px; align-items: flex-start; }
.kcol { width: 300px; flex: 0 0 300px; background: rgba(255,255,255,.022); border: 1px solid var(--line); border-radius: 20px; display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.kcol.drag-over { border-color: rgba(0,229,138,.5); background: rgba(0,229,138,.05); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 14px 15px; border-bottom: 1px solid var(--line); }
.kcol-head .dot { box-shadow: none; }
.kcol-name { font-size: 12.5px; font-weight: 650; flex: 1; }
.kcol-count { font-size: 10.5px; color: var(--muted); background: var(--panel); padding: 2px 7px; border-radius: 99px; }
.kcol-body { padding: 9px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 80px; }
.kcard { background: var(--panel-2); border: 1px solid var(--line); border-radius: 13px; padding: 11px; cursor: grab; transition: .15s; }
html[data-theme="light"] .kcard { background: #fff; }
.kcard:hover { border-color: rgba(0,229,138,.3); transform: translateY(-1px); }
.kcard.dragging { opacity: .4; }
.kcard-top { display: flex; align-items: center; gap: 9px; }
.kcard-name { font-size: 12.5px; font-weight: 600; flex: 1; min-width: 0; }
.kcard-meta { font-size: 10.5px; color: var(--faint); margin-top: 7px; display: flex; gap: 8px; flex-wrap: wrap; }
.kcard-acts { display: flex; gap: 6px; margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--line); }
.kcard-act {
  flex: 1 1 0; height: 27px; padding: 0 6px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; color: var(--muted); text-decoration: none;
  border: 1px solid var(--line); background: rgba(255,255,255,.02); cursor: pointer;
  transition: .14s;
}
.kcard-act svg { width: 13px; height: 13px; flex: 0 0 13px; }
.kcard-act:hover { color: var(--green); border-color: rgba(0,229,138,.4); background: rgba(0,229,138,.08); }
html[data-theme="light"] .kcard-act { background: rgba(0,0,0,.02); }

/* ------------------------------------------------------------------- robô */
.flow-wrap { display: block; height: calc(100vh - 150px); min-height: 520px; }
/* o quadro do fluxo ocupa a altura toda: a barra de tipos em cima, o canvas
   rolando por dentro (antes quem segurava a altura era a coluna da barra) */
.flow-wrap > div { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.flow-wrap .flow-canvas { flex: 1 1 auto; min-height: 0; }
.flow-canvas {
  position: relative; overflow: auto; border-radius: 22px; border: 1px solid var(--line);
  background-color: rgba(255,255,255,.016);
  background-image: radial-gradient(rgba(127,156,141,.22) 1px, transparent 1px);
  background-size: 22px 22px; box-shadow: var(--shadow-sm);
}
.flow-inner { position: relative; min-width: 700px; min-height: 700px; }
.flow-viewport { position: relative; transform-origin: 0 0; }
.flow-zoom { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.flow-zoom-label { font-size: 11px; font-weight: 650; color: var(--muted); min-width: 38px; text-align: center; cursor: pointer; }
.flow-zoom-label:hover { color: var(--green); }

/* tela cheia do diagrama */
.flow-canvas.fullscreen {
  position: fixed; inset: 0 0 0 0; z-index: 300; border-radius: 0; border: 0;
  background-color: var(--bg, #040706);
  padding: 0; height: auto !important; min-height: 0; width: auto !important;
}
html[data-theme="light"] .flow-canvas.fullscreen { background-color: #f3f8f5; }
html.flow-full, html.flow-full body { overflow: hidden; }
html.flow-full .topbar,
html.flow-full .page-head,
html.flow-full .flow-toolbar { display: none !important; }
html.flow-full .page { padding: 0; }
.flow-canvas.fullscreen .flow-viewport { margin: 0; }
html.flow-full .flow-canvas.fullscreen { padding-right: 0; }
/* barra flutuante da tela cheia (zoom + sair) */
.flow-full-bar {
  position: fixed; top: 14px; right: 14px; z-index: 320;
  display: flex; align-items: center; gap: 6px; padding: 5px 8px;
  background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 14px; box-shadow: 0 18px 44px -26px rgba(0,0,0,.85);
}
.flow-full-sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.flow-full-bar .flow-zoom-label { min-width: 40px; }
.flow-full-bar .btn { white-space: nowrap; flex: 0 0 auto; }
@media (max-width: 899px) {
  .flow-full-bar { right: 14px; left: 14px; justify-content: center; }
}

/* tags dentro do bloco do robô */
.node-tags { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 9px; }
.node-tags .tag { height: 19px; padding: 0 7px; font-size: 10px; }
.flow-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.flow-edges path.hit { pointer-events: stroke; cursor: pointer; }
.node {
  position: absolute; width: 250px; border-radius: 16px; background: #0b1511;
  border: 1px solid var(--line-strong); box-shadow: 0 16px 36px -22px rgba(0,0,0,.9);
  transition: box-shadow .15s, border-color .15s; user-select: none;
}
html[data-theme="light"] .node { background: #fff; }
.node.selected { border-color: rgba(0,229,138,.65); box-shadow: 0 0 0 3px rgba(0,229,138,.12), 0 20px 50px -24px rgba(0,229,138,.45); }
.node-head { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-bottom: 1px solid var(--line); cursor: grab; border-radius: 16px 16px 0 0; }
.node-head:active { cursor: grabbing; }
.node-badge { font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 6px; border-radius: 6px; background: rgba(0,229,138,.12); color: var(--green); }
.node-badge.img { background: rgba(96,165,250,.12); color: var(--blue); }
.node-badge.vid { background: rgba(167,139,250,.12); color: var(--violet); }
.node-badge.aud { background: rgba(251,191,36,.12); color: var(--amber); }
.node-badge.cta { background: rgba(34,211,238,.12); color: var(--cyan); }
.node-badge.btn { background: rgba(251,113,133,.12); color: var(--red); }
.node-badge.delay { background: rgba(127,156,141,.14); color: var(--muted); }
.node-title { font-size: 11.5px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* lápis e lixeira no canto superior direito do card do bloco */
.node-head { position: relative; padding-right: 72px; }
.node-acts { position: absolute; top: 5px; right: 5px; display: flex; gap: 1px; }
.nact {
  width: 21px; height: 21px; border-radius: 7px; display: grid; place-items: center;
  border: 1px solid transparent; background: transparent; color: var(--faint); cursor: pointer;
  transition: .13s;
}
.nact svg { width: 12.5px; height: 12.5px; }
.nact:hover { color: var(--green); border-color: rgba(0,229,138,.35); background: rgba(0,229,138,.1); }
.nact.danger:hover { color: var(--red); border-color: rgba(251,113,133,.4); background: rgba(251,113,133,.1); }
.node-body { padding: 10px 12px; font-size: 11.5px; color: var(--text-2); line-height: 1.45; max-height: 76px; overflow: hidden; }
.node-body img { border-radius: 8px; max-height: 60px; width: 100%; object-fit: cover; margin-bottom: 5px; }
.node-foot { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-top: 1px solid var(--line); font-size: 10px; color: var(--faint); }
.node-port {
  position: absolute; right: -8px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; border-radius: 50%;
  background: var(--green); border: 3px solid #06100b; box-shadow: 0 0 12px var(--green); cursor: crosshair; z-index: 3;
}
.node-port:hover { transform: translateY(-50%) scale(1.25); }
.node-add {
  position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 8px;
  background: var(--green); color: #032015; border: 0; font-size: 15px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 14px var(--glow); z-index: 3;
}
.inspector { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); display: flex; flex-direction: column; overflow: hidden; }
.inspector-head { padding: 15px 17px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
.inspector-body { padding: 16px 17px; overflow-y: auto; }

/* ---- modal de edição do bloco (substitui a barra lateral) ---- */
.modal:has(.node-edit-body) { width: min(860px, 100%); }
.node-edit-head { align-items: center; }
.node-edit-head h2 { font-size: 18px; }
.node-edit-body { padding-top: 16px; }
.node-edit-foot {
  align-items: center; position: sticky; bottom: 0; z-index: 3;
  padding-top: 14px; padding-bottom: 16px; border-top: 1px solid var(--line);
  background: #0a130f;
}
html[data-theme="light"] .node-edit-foot { background: #fff; }
.node-edit-body .field + .field { margin-top: 2px; }
.node-edit-body .textarea { min-height: 92px; }
@media (min-width: 760px) {
  .node-edit-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* ---- lista suspensa com check (tags e listas do bloco) ---- */
.pick { position: relative; scroll-margin-top: 10px; }
.pick-sum {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(255,255,255,.02);
  cursor: pointer; list-style: none; font-size: 12.5px; color: var(--text-2);
}
.pick-sum::-webkit-details-marker { display: none; }
.pick-sum:hover { border-color: rgba(0,229,138,.35); }
.pick[open] .pick-sum { border-color: rgba(0,229,138,.5); box-shadow: 0 0 0 3px rgba(0,229,138,.08); }
.pick-sum svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--faint); transition: .15s; }
.pick[open] .pick-sum svg { transform: rotate(180deg); color: var(--green); }
.pick-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-val.is-empty { color: var(--faint); }
.pick-pop {
  /* na altura do modal a lista pode passar da borda: ela abre no próprio
     fluxo, empurrando o formulário e rolando junto com ele */
  margin-top: 6px; max-height: 200px; overflow-y: auto;
  padding: 6px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.02);
}
html[data-theme="light"] .pick-pop { background: rgba(0,0,0,.02); }
.pick-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 9px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer;
}
.pick-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
html[data-theme="light"] .pick-item:hover { background: rgba(0,0,0,.04); }
.pick-item input {
  appearance: none; position: relative; width: 16px; height: 16px; flex: 0 0 16px; cursor: pointer;
  border: 1.5px solid var(--line-strong); border-radius: 5px; background: rgba(255,255,255,.03);
  transition: .13s; margin: 0;
}
.pick-item input:hover { border-color: rgba(0,229,138,.55); }
.pick-item input:checked { background: var(--green); border-color: var(--green); }
.pick-item input:checked::after {
  content: ""; position: absolute; left: 4.5px; top: 1px; width: 4px; height: 8.5px;
  border: solid #032015; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.pick-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.flow-toolbar { display: flex; gap: 6px; flex-wrap: wrap; }
.flow-toolbar .btn { height: 34px; font-size: 11.5px; padding: 0 11px; }

/* ------------------------------------------------------------------ listas */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item-title { font-size: 12.5px; font-weight: 600; }
.list-item-sub { font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------------- landing */
.lp { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.lp-nav { display: flex; align-items: center; gap: 22px; padding: 20px 0; }
.lp-nav .links { display: flex; gap: 20px; font-size: 13px; color: var(--muted); margin-left: 14px; }
.lp-nav .links a:hover { color: var(--text); }
.lp-hero { padding: clamp(40px, 8vw, 100px) 0 70px; text-align: center; position: relative; }
.lp-hero h1 { font-size: clamp(40px, 7vw, 76px); letter-spacing: -0.05em; line-height: 0.98; }
.lp-hero p { max-width: 620px; margin: 20px auto 0; color: var(--muted); font-size: clamp(14px, 2vw, 17px); }
.lp-cta { display: flex; gap: 10px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.lp-mock { margin-top: 54px; border-radius: 24px; border: 1px solid var(--line-strong); box-shadow: var(--shadow); overflow: hidden; background: #07100c; }
.lp-mock img { width: 100%; }
.lp-section { padding: 70px 0; }
.lp-section h2 { font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.045em; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 30px; }
.lp-feat { padding: 22px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); }
.lp-feat .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(0,229,138,.09); border: 1px solid rgba(0,229,138,.2); color: var(--green); margin-bottom: 14px; }
.lp-feat h3 { margin-bottom: 6px; }
.lp-feat p { color: var(--muted); font-size: 13px; }
.lp-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 28px; }
.lp-plan { padding: 26px; border-radius: 24px; border: 1px solid var(--line); background: var(--panel); position: relative; }
.lp-plan.featured { border-color: rgba(0,229,138,.45); box-shadow: 0 30px 70px -40px rgba(0,229,138,.5); }
.lp-plan .price { font-size: 36px; font-weight: 750; letter-spacing: -0.05em; margin: 14px 0 4px; }
.lp-plan ul { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 10px; font-size: 13px; color: var(--text-2); }
.lp-plan li { display: flex; gap: 9px; }
.lp-plan li svg { width: 15px; height: 15px; color: var(--green); flex: 0 0 15px; margin-top: 3px; }
.lp-foot { border-top: 1px solid var(--line); padding: 30px 0 50px; color: var(--faint); font-size: 12px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* --------------------------------------------------------------- helpers */
.fade-in { animation: fade .25s ease; }
.pulse-dot { position: relative; }
.pulse-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid rgba(0,229,138,.5); animation: ring 2.2s infinite; }
@keyframes ring { 0% { transform: scale(.7); opacity: .9 } 100% { transform: scale(1.7); opacity: 0 } }
.scroll-x { overflow-x: auto; }
.hide-mobile { display: initial; }
.mobile-only { display: none !important; }
.card-stack { display: flex; flex-direction: column; gap: 10px; }

/* --------------------------------------------------------------- responsivo */
@media (max-width: 1280px) {
  .flow-wrap { height: auto; }
  .flow-canvas { height: 520px; }
  .flow-toolbar { gap: 4px; }
  .flow-toolbar .btn { height: 31px; font-size: 11px; padding: 0 9px; }
}
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-wrap { height: auto; }
  .flow-canvas { height: 520px; }
  .inbox { grid-template-columns: 300px minmax(0, 1fr); }
  .inbox.with-panel { grid-template-columns: 288px minmax(0, 1fr) 320px; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* minmax(0,1fr): sem isso o min-content de uma imagem/mensagem larga
     empurrava a coluna e a conversa passava da borda da tela */
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox.with-panel { grid-template-columns: minmax(0, 1fr); }
  .inbox .chat { display: none; }
  .inbox.chat-open .convos { display: none; }
  .inbox.chat-open .chat { display: flex; }
  .back-chat { display: inline-flex !important; }
  /* no celular o painel do contato vira gaveta sobre a conversa */
  .contact-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(92vw, 380px);
    z-index: 96; background: var(--bg); border-left: 1px solid var(--line);
    box-shadow: -30px 0 80px rgba(0, 0, 0, .6);
  }
  .cp-backdrop { display: block; position: fixed; inset: 0; background: rgba(2, 6, 4, .62); z-index: 95; }
  .cp-backdrop[hidden] { display: none; }
}
@media (max-width: 820px) {
  .sidebar { width: var(--sidebar); flex-basis: var(--sidebar); transform: translateX(-104%); transition: transform .22s ease; box-shadow: 30px 0 80px rgba(0,0,0,.6); }
  html { --sbw: 0px; }
  /* a regra base da barra vem DEPOIS nesta folha (display:none), então o
     celular precisa de !important para a barra aparecer de fato */
  .bottombar { left: 0; display: flex !important; }
  .page { padding-bottom: calc(clamp(18px,3vw,34px) + 62px); }
  /* A barra inferior, no iPhone, mede 58px + env(safe-area-inset-bottom)
     (~34px do indicador de home). Antes o Inbox descontava só 58px e o
     composer ficava escondido atrás da barra. */
  html:not(.phone-lock) { --bbh: calc(58px + env(safe-area-inset-bottom, 0px)); }
  /* membro/colaborador (html.phone-lock): sem barra inferior, o Inbox ocupa a tela toda.
     O admin navega por todas as áreas e mantém a barra. */
  html.phone-lock { --bbh: 0px; }
  html.phone-lock .bottombar { display: none !important; }
  html.phone-lock .page { padding-bottom: 16px; }
  /* no celular o Inbox nunca deve ter piso de altura: com o teclado aberto a
     área visível fica menor que 500px e o composer sairia da tela */
  .inbox { min-height: 0; }
  html.phone-lock [data-phone-hide],
  html.phone-lock .topbar .hud { display: none !important; }
  /* no celular o HUD dos limites rouba o topbar: fica só no desktop */
  .topbar .hud { display: none !important; }
  .sidebar.open { transform: translateX(0); z-index: 92; }
  /* a gaveta do menu tem de ficar ACIMA do fundo escurecido (era o
     contrário: o fundo com blur tapava o próprio menu no celular) */
  #sb-backdrop { z-index: 91; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .page { padding: 16px; }
  .g2 { grid-template-columns: 1fr; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hide-mobile { display: none !important; }
  .mobile-only { display: initial !important; }
  .topbar { padding: 0 14px; }
  .toast-wrap { left: 12px; right: 12px; top: 12px; }
  .toast { max-width: none; }
  .drawer { width: 100%; }
  .modal { border-radius: 22px; }
  .flow-inner { min-width: 700px; }
  .flow-zoom { width: 100%; justify-content: flex-end; }
}
@media (max-width: 560px) {
  .g3 { grid-template-columns: 1fr; }
  .stat-value { font-size: 27px; }
  .page-head { margin-bottom: 18px; }
  .btn { height: 38px; padding: 0 14px; font-size: 12.5px; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .kanban { gap: 10px; }
  .kcol { width: 84vw; flex-basis: 84vw; }
  .msg { max-width: 88%; }
  .convos { border-right: 0; }
}

/* ------------------------------------------------------- pacotes (admin) */
.lp-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.lp-plan { position: relative; border: 1px solid var(--line); border-radius: 24px; padding: 24px; background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012)); }
.lp-plan.featured { border-color: rgba(0,229,138,.45); box-shadow: 0 34px 80px -50px rgba(0,229,138,.55); }
.lp-plan h3 { font-size: 20px; }
.lp-plan .price { font-size: 34px; font-weight: 750; letter-spacing: -.05em; margin: 14px 0 2px; }
.lp-plan ul { list-style: none; padding: 0; margin: 18px 0 20px; display: grid; gap: 9px; font-size: 12.5px; color: var(--text-2); }
.lp-plan li { display: flex; gap: 8px; align-items: flex-start; }
.lp-plan li svg { width: 14px; height: 14px; color: var(--green); flex: 0 0 14px; margin-top: 3px; }

@media (max-width: 700px) { .stat-mini { grid-template-columns: repeat(2, minmax(0,1fr)) !important; } }
@media (max-width: 374px) { .g4 { grid-template-columns: 1fr; } .stat-value { font-size: 26px; } }


/* ================================ sidebar fixa + bottombar + HUD ==== */

.sidebar { transition: none; }

/* ---------------------------------------------------------------- HUD */
.hud { display: flex; align-items: center; gap: 4px; }
.hud-item {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border-radius: 12px; transition: .15s; border: 1px solid transparent; cursor: pointer;
}
.hud-item:hover { background: var(--panel); border-color: var(--line); }
.hud-ring { position: relative; width: 36px; height: 36px; flex: 0 0 36px; }
.hud-ring svg { width: 36px; height: 36px; transform: rotate(-90deg); }
.hud-ring circle { fill: none; stroke-width: 3; }
.hud-ring .track { stroke: rgba(127,156,141,.2); }
.hud-ring .val { stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.hud-ring .pct {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 10px; font-weight: 750; letter-spacing: -.03em; color: var(--text);
}
.hud-meta { line-height: 1.2; }
.hud-label { font-size: 9.5px; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; font-weight: 650; }
.hud-count { font-size: 11.5px; font-weight: 650; color: var(--text-2); }
.hud-sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }

/* ----------------------------------------------------------- bottombar */
.bottombar {
  display: none;
  position: fixed; left: var(--sbw); right: 0; bottom: 0; z-index: 55;
  height: calc(58px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(6,12,9,.92); backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid var(--line);
  align-items: stretch; justify-content: space-around;
}
html[data-theme="light"] .bottombar { background: rgba(250,253,251,.94); }
.bb-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 9.5px; font-weight: 600; color: var(--faint);
  position: relative; transition: .14s; letter-spacing: -.01em;
}
.bb-item svg { width: 19px; height: 19px; }
.bb-item.active { color: var(--green); }
.bb-item.active svg { filter: drop-shadow(0 0 7px rgba(0,229,138,.55)); }
.bb-item.active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 2px; border-radius: 0 0 3px 3px; background: var(--green);
  box-shadow: 0 0 12px var(--green);
}
.bb-item .bb-dot {
  position: absolute; top: 7px; right: 50%; margin-right: -19px;
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 99px;
  background: var(--green); color: #032015; font-size: 8.5px; font-weight: 800;
  display: grid; place-items: center;
}
/* altura do Inbox = área visível − topbar − barra inferior (quando existe).
   --vvh é atualizado pelo JS a partir do visualViewport: no celular ele encolhe
   quando o teclado abre e quando a barra de endereço aparece. */
.inbox { height: calc(100vh - var(--topbar, 64px) - var(--bbh, 0px)); }
.inbox { height: calc(var(--vvh, 100dvh) - var(--topbar, 64px) - var(--bbh, 0px)); }

@media (max-width: 900px) {
  .hud-meta { display: none; }
  .hud-item { padding: 3px; }
  .hud-sep { margin: 0 1px; }
}
@media (max-width: 560px) {
  .hud { gap: 0; }
  .hud-ring { width: 30px; height: 30px; flex-basis: 30px; }
  .hud-ring svg { width: 30px; height: 30px; }
  .hud-ring .pct { font-size: 8.5px; }
}


/* ===================== cards em coluna única (layout horizontal) ====== */
/* Uma coluna: identidade + ações na primeira linha, detalhes numa faixa
   própria abaixo (separada por fio), aproveitando a largura inteira. */
.rowcard .card-pad { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px 20px; align-items: start; }
.rowcard .rc-main { grid-area: main; min-width: 0; }
.rowcard .rc-meta { grid-area: meta; min-width: 0; padding-top: 13px; border-top: 1px solid var(--line); }
.rowcard .rc-actions { grid-area: acts; display: flex; align-items: center; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.rowcard .rc-actions .btn-icon { flex: 0 0 auto; }
.rowcard.is-active { border-color: rgba(0,229,138,.35); box-shadow: 0 0 0 1px rgba(0,229,138,.12); }
.rowcard .rc-title { font-size: 14.5px; font-weight: 650; letter-spacing: -.02em; }
.rowcard .rc-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.rowcard .rc-body { font-size: 12px; color: var(--text-2); line-height: 1.55; }
.rowcard .card-pad { grid-template-areas: "main acts" "meta meta"; }

/* faixa de fatos (detalhes técnicos) em colunas que se ajustam sozinhas */
.rc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 9px 24px; }
.rc-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 11.5px; min-width: 0; }
.rc-facts > div > span:first-child { color: var(--muted); flex: 0 0 auto; }
.rc-facts > div > span:last-child { min-width: 0; text-align: right; }
.rc-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 11.5px; color: var(--muted); }

/* contador de envios do robô, discreto no canto superior direito do card */
.rowcard.has-count .card-pad { grid-template-columns: minmax(0,1fr) auto auto; grid-template-areas: "main acts count" "meta meta meta"; }
.rc-sends {
  grid-area: count; align-self: start; display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,.03); color: var(--muted);
  font-size: 11px; font-weight: 550; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rc-sends svg { width: 12px; height: 12px; opacity: .75; }

@media (max-width: 700px) {
  .rowcard .card-pad { grid-template-columns: minmax(0,1fr); grid-template-areas: "main" "acts" "meta"; gap: 12px; }
  .rowcard .rc-actions { justify-content: flex-start; }
  .rc-facts { grid-template-columns: minmax(0,1fr); }
  .rowcard.has-count .card-pad { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "main count" "acts acts" "meta meta"; }
}

/* ====================== envios: wizard, card e estatísticas =========== */

/* ---- indicador de etapas ---- */
.nb-wizard { display: flex; flex-direction: column; gap: 14px; }
.nb-steps {
  display: flex; align-items: center; gap: 6px; list-style: none; margin: 0 0 2px;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--panel); overflow-x: auto; scrollbar-width: none;
}
.nb-steps::-webkit-scrollbar { display: none; }
.nb-step { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; opacity: .55; transition: .2s; }
.nb-step.on, .nb-step.done { opacity: 1; }
.nb-step-dot {
  position: relative; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 750;
  border: 1px solid var(--line-strong); color: var(--muted); background: rgba(255,255,255,.02);
  transition: .2s;
}
.nb-step-dot svg { width: 15px; height: 15px; display: none; }
.nb-step.on .nb-step-dot {
  border-color: rgba(0,229,138,.55); color: var(--green);
  background: rgba(0,229,138,.1); box-shadow: 0 0 0 4px rgba(0,229,138,.06);
}
.nb-step.done .nb-step-dot { background: var(--green); border-color: transparent; color: #032015; }
.nb-step.done .nb-step-dot .nb-step-n { display: none; }
.nb-step.done .nb-step-dot svg { display: block; }
.nb-step-text { display: flex; flex-direction: column; line-height: 1.25; }
.nb-step-text b { font-size: 12.5px; font-weight: 650; }
.nb-step-text small { font-size: 10.5px; color: var(--faint); }
.nb-step-line { flex: 1 1 26px; min-width: 18px; height: 1px; background: var(--line); list-style: none; }

.nb-panel { animation: nbIn .22s ease; }
@keyframes nbIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- escolha do tipo: botões grandes ---- */
.nb-types { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 6px; }
.nb-type {
  display: flex; align-items: flex-start; gap: 13px; text-align: left; cursor: pointer;
  padding: 16px 15px; border-radius: 16px; border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.02); color: var(--text); transition: .18s; position: relative;
  font: inherit;
}
.nb-type:hover { border-color: rgba(0,229,138,.35); transform: translateY(-1px); }
.nb-type.on {
  border-color: rgba(0,229,138,.6); background: linear-gradient(150deg, rgba(0,229,138,.12), rgba(0,229,138,.02));
  box-shadow: 0 0 0 3px rgba(0,229,138,.08), 0 24px 50px -34px rgba(0,229,138,.6);
}
.nb-type-ic {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--muted);
}
.nb-type-ic svg { width: 20px; height: 20px; }
.nb-type.on .nb-type-ic {
  background: rgba(0,229,138,.14); border-color: rgba(0,229,138,.28); color: var(--green);
  box-shadow: 0 0 22px -8px var(--green);
}
.nb-type-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nb-type-title { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.nb-type-sub { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.nb-type-check {
  position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; background: var(--green); color: #032015;
  opacity: 0; transform: scale(.6); transition: .18s;
}
.nb-type-check svg { width: 12px; height: 12px; }
.nb-type.on .nb-type-check { opacity: 1; transform: scale(1); }

/* ---- prévia estilo WhatsApp ---- */
.nb-preview-wa {
  border-radius: 16px; border: 1px solid var(--line); overflow: hidden;
  background: linear-gradient(160deg, rgba(6,20,15,.9), rgba(4,10,8,.9));
}
html[data-theme="light"] .nb-preview-wa { background: #eaf4ee; }
.nb-preview-bar {
  display: flex; align-items: center; gap: 7px; padding: 8px 12px;
  font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700;
  color: var(--faint); border-bottom: 1px solid var(--line);
}
.nb-preview-bar svg { width: 13px; height: 13px; color: var(--green); }
.nb-preview-bubble {
  margin: 12px 12px 0; padding: 11px 13px; border-radius: 12px 12px 12px 3px;
  background: rgba(255,255,255,.06); font-size: 12.5px; line-height: 1.55; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}
html[data-theme="light"] .nb-preview-bubble { background: #fff; color: #22302a; }
.nb-preview-btns { display: grid; gap: 5px; margin: 8px 12px 12px; }
.nb-preview-btns span {
  text-align: center; font-size: 12px; font-weight: 600; color: var(--green);
  padding: 8px; border-radius: 9px; border: 1px solid rgba(0,229,138,.28);
  background: rgba(0,229,138,.06);
}

/* ---- quando enviar ---- */
.nb-when { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 4px; }

/* ---- teste antes de enviar (etapa 3) ---- */

.nb-test {
  margin-bottom: 18px; padding: 14px 15px; border-radius: 14px;
  border: 1px dashed rgba(0,229,138,.34); background: rgba(0,229,138,.045);
}
.nb-test-head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 11px; }
.nb-test-head b { font-size: 13px; }
.nb-test-head .hint { margin: 2px 0 0; font-size: 11.5px; }
.nb-test-ic {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(0,229,138,.12); border: 1px solid rgba(0,229,138,.28); color: var(--green);
}
.nb-test-ic svg { width: 15px; height: 15px; }
.nb-test-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nb-test-row .input { flex: 1 1 190px; min-width: 0; font-family: var(--mono); letter-spacing: .02em; }
.nb-test-row .btn { flex: 0 0 auto; }
.nb-test-note {
  display: flex; align-items: flex-start; gap: 6px; margin-top: 9px;
  font-size: 11.5px; color: var(--muted); line-height: 1.5;
}
.nb-test-note svg { width: 13px; height: 13px; flex: 0 0 13px; margin-top: 2px; }
.nb-test-note.ok { color: var(--green); }
.nb-test-note.err { color: var(--red); }
.nb-when-btn {
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; font: inherit;
  padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.02); color: var(--text); transition: .16s;
}
.nb-when-btn:hover { border-color: rgba(0,229,138,.3); }
.nb-when-btn.on { border-color: rgba(0,229,138,.55); background: rgba(0,229,138,.08); }
.nb-when-btn > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.nb-when-btn b { font-size: 13px; }
.nb-when-btn small { font-size: 11px; color: var(--muted); }
.nb-when-ic {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,.03);
}
.nb-when-ic svg { width: 16px; height: 16px; }
.nb-when-btn.on .nb-when-ic { color: var(--green); border-color: rgba(0,229,138,.3); background: rgba(0,229,138,.1); }

/* ---- resumo ---- */
.nb-summary { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.nb-sum-head {
  display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 650;
  color: var(--muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: .06em;
}
.nb-sum-head svg { width: 14px; height: 14px; }
.nb-sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 22px; }
.nb-sum-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nb-sum-grid span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 650; }
.nb-sum-grid b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

/* ---- barra de navegação ---- */
.nb-nav {
  position: sticky; bottom: 14px; z-index: 5;
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: 16px;
  background: rgba(8,16,12,.92); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 24px 60px -34px rgba(0,0,0,.9);
}
html[data-theme="light"] .nb-nav { background: rgba(255,255,255,.94); }
.nb-nav-step { margin-right: 4px; }
.nb-nav .btn { height: 40px; padding: 0 18px; font-size: 13px; }

/* ---- confirmação em tela cheia ---- */
.modal-backdrop.fullscreen { padding: 0; background: rgba(2,6,4,.82); }
.modal.full {
  width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; border: 0;
  display: grid; place-items: center; overflow: auto;
  background: radial-gradient(120% 90% at 50% 0%, #0b1a13 0%, #040a07 55%, #020604 100%);
}
html[data-theme="light"] .modal.full { background: radial-gradient(120% 90% at 50% 0%, #eef8f2, #f7fbf9 60%, #fff); }
.modal.full { display: flex; align-items: center; justify-content: center; }
.nbc { position: relative; width: min(900px, 100%); padding: clamp(24px, 6vh, 64px) 24px; }
.nbc-title { font-size: clamp(26px, 4.4vw, 44px); }
.nbc-glow {
  position: absolute; inset: -30% 10% auto; height: 420px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0,229,138,.22), transparent 75%);
  filter: blur(10px);
}
.nbc-inner { position: relative; text-align: center; }
.nbc-ic {
  width: 84px; height: 84px; margin: 0 auto 24px; border-radius: 26px; display: grid; place-items: center;
  background: linear-gradient(150deg, rgba(0,229,138,.22), rgba(0,229,138,.05));
  border: 1px solid rgba(0,229,138,.4); color: var(--green);
  box-shadow: 0 0 60px -14px rgba(0,229,138,.75);
}
.nbc-ic svg { width: 38px; height: 38px; }
.nbc-title { font-size: clamp(22px, 3.4vw, 32px); letter-spacing: -.03em; margin-bottom: 10px; }
.nbc-sub { font-size: 14px; color: var(--muted); max-width: 560px; margin: 0 auto 34px; line-height: 1.6; }
.nbc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; text-align: left; }
.nbc-card {
  display: flex; flex-direction: column; gap: 5px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.03);
}
html[data-theme="light"] .nbc-card { background: #fff; }
.nbc-k { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 700; }
.nbc-card b { font-size: 16px; }
.nbc-card small { font-size: 11px; color: var(--muted); line-height: 1.4; }
.nbc-warn {
  display: flex; align-items: flex-start; gap: 9px; text-align: left;
  margin: 22px auto 0; max-width: 680px; padding: 11px 13px; border-radius: 12px;
  border: 1px solid rgba(251,191,36,.3); background: rgba(251,191,36,.07);
  font-size: 11.5px; color: var(--text-2); line-height: 1.5;
}
.nbc-warn svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--amber); margin-top: 1px; }
.nbc-actions { display: flex; justify-content: center; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 14px; border-radius: 14px; }

/* ---- flash + som de envio ---- */
.zm-flash { position: fixed; inset: 0; z-index: 400; pointer-events: none; overflow: hidden; }
.zm-flash-core {
  position: absolute; inset: 0;
  background: radial-gradient(closest-side, rgba(255,255,255,.92), rgba(0,229,138,.35) 45%, transparent 78%);
  animation: zmFlashCore .62s ease-out forwards;
}
.zm-flash-ring {
  position: absolute; left: 50%; top: 50%; width: 40vmax; height: 40vmax; margin: -20vmax 0 0 -20vmax;
  border-radius: 50%; border: 2px solid rgba(0,229,138,.65);
  animation: zmFlashRing .8s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes zmFlashCore {
  0% { opacity: 0; }
  12% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes zmFlashRing {
  0% { transform: scale(.1); opacity: .9; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ---- card de envio na lista ---- */
.bc-card .bc-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.bc-top { display: flex; align-items: flex-start; gap: 12px; }
.bc-ic {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
}
.bc-ic svg { width: 19px; height: 19px; }
.bc-head { flex: 1; min-width: 0; }
.bc-title { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.bc-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.bc-sub .truncate { max-width: 200px; }
.bc-dot { color: var(--faint); }
.bc-status { flex: 0 0 auto; }
.bc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.bc-stat {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
}
.bc-stat > div { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.bc-stat b { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.bc-stat span { font-size: 10.5px; color: var(--faint); }
.bc-stat-ic { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.04); color: var(--muted); }
.bc-stat-ic svg { width: 14px; height: 14px; }
.bc-stat-ic.ok { color: var(--green); background: rgba(0,229,138,.1); }
.bc-stat-ic.eye { color: var(--cyan); background: rgba(34,211,238,.1); }
.bc-stat.bad .bc-stat b { color: var(--red); }
.bc-stat.bad .bc-stat-ic { color: var(--red); background: rgba(251,113,133,.1); }
.bc-pct { font-size: 11px; color: var(--text-2); font-weight: 650; }
.bc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.bc-main-btn { height: 34px; padding: 0 14px; }
.bc-del { margin-left: auto; }
@media (max-width: 560px) {
  .bc-actions .bc-main-btn { flex: 1 1 100%; justify-content: center; }
  .bc-del { margin-left: 0; }
}

/* ---- estatísticas ---- */
.st-hero { overflow: hidden; }
.st-hero-top { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px 0; }
.st-hero-ic { width: 48px; height: 48px; flex-basis: 48px; border-radius: 14px; }
.st-hero-ic svg { width: 22px; height: 22px; }
.st-hero-title { font-size: 19px; font-weight: 750; letter-spacing: -.03em; }
.st-hero-sub { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.st-hero-sub span { display: inline-flex; align-items: center; gap: 5px; }
.st-hero-sub svg { width: 13px; height: 13px; }
.st-hero-bar { padding: 18px 20px 20px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 14px; }
.st-tile { padding: 15px 16px; }
.st-tile-top { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; font-weight: 650; }
.st-tile-ic { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.04); }
.st-tile-ic svg { width: 14px; height: 14px; }
.st-tile-value { font-size: 30px; font-weight: 780; letter-spacing: -.04em; margin-top: 10px; line-height: 1; }
.st-tile-foot { font-size: 11px; color: var(--muted); margin-top: 6px; }
.st-metric { margin-bottom: 16px; }
.st-metric-val { font-size: 12px; font-weight: 700; }
.st-formula {
  display: flex; gap: 9px; align-items: flex-start; margin-top: 4px; padding: 11px 13px;
  border-radius: 12px; border: 1px dashed var(--line); color: var(--muted);
  font-size: 11px; line-height: 1.55;
}
.st-formula svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 1px; }

/* ---- progresso do disparo: duas fatias (enviado / falha) + legenda ---- */
.st-progress { display: flex; }
.st-progress > i { transition: width .5s ease; }
.st-progress > i.ok { background: linear-gradient(90deg, var(--green-deep), var(--green)); box-shadow: 0 0 14px var(--glow); }
.st-progress > i.bad { background: linear-gradient(90deg, #8f1730, var(--red)); box-shadow: none; }
.st-prog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 11px; }
.st-prog-main { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--text-2); }
.st-prog-main b { font-size: 27px; font-weight: 780; letter-spacing: -.045em; color: var(--text); line-height: 1; }
.st-prog-main em { font-style: normal; font-weight: 650; color: var(--amber); }
.st-prog-pct { text-align: right; font-size: 22px; font-weight: 780; letter-spacing: -.035em; color: var(--text); line-height: 1; }
.st-prog-pct small { display: block; margin-top: 5px; font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.st-prog-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 10px; font-size: 12px; font-weight: 550; color: var(--text-2); }
.st-prog-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.st-prog-legend b { color: var(--text-2); font-weight: 700; }
.st-prog-legend .sw { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.st-prog-legend .sw.ok { background: var(--green); }
.st-prog-legend .sw.bad { background: var(--red); }
.st-prog-legend .sw.queue { background: rgba(127, 156, 141, .45); }
.st-prog-sync { margin-left: auto; color: var(--faint); }
.st-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.st-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--text-2); font-size: 11.5px;
}
.st-chip svg { width: 13px; height: 13px; opacity: .85; }
.st-chip.live { color: var(--green); border-color: rgba(0, 229, 138, .32); background: rgba(0, 229, 138, .08); }
.st-chip.warn { color: var(--amber); border-color: rgba(251, 191, 36, .3); background: rgba(251, 191, 36, .08); }
.st-tile.is-live { border-color: rgba(0, 229, 138, .3); }
.bc-live-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--green); }
.bc-live-tag svg { width: 12px; height: 12px; animation: bc-spin 2.4s linear infinite; }
@keyframes bc-spin { to { transform: rotate(360deg); } }

/* ---- barra de ferramentas da tela de envio (sem título repetido) ---- */
.st-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.st-crumb { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.st-crumb a { color: var(--muted); }
.st-crumb a:hover { color: var(--green); }
.st-crumb span { color: var(--faint); }
.st-crumb b { color: var(--text-2); font-weight: 700; }
.st-toolbar-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-danger { color: var(--red); }
.st-danger:hover { border-color: rgba(251, 113, 133, .4); background: rgba(251, 113, 133, .08); }

/* ---- mensagem e métricas recolhidas durante o envio ---- */
.st-more { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); overflow: hidden; }
.st-more > summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  padding: 13px 16px; font-size: 12.5px; font-weight: 650; color: var(--text-2);
}
.st-more > summary::-webkit-details-marker { display: none; }
.st-more > summary:hover { color: var(--text); }
.st-more > summary svg { width: 14px; height: 14px; color: var(--muted); }
.st-more > summary::after { content: "ver"; margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); }
.st-more[open] > summary::after { content: "ocultar"; }
.st-more > .st-cols { padding: 0 12px 12px; }
@media (max-width: 560px) {
  .st-toolbar-actions { width: 100%; }
  .st-toolbar-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---- estatísticas: mensagem + métricas lado a lado ---- */
.st-cols { display: grid; grid-template-columns: minmax(0,340px) minmax(0,1fr); gap: 14px; align-items: start; }

/* ---- miniatura da mensagem em um celular ---- */
.wa-phone-wrap { display: flex; justify-content: center; padding: 4px 0 8px; }
.wa-phone {
  width: 100%; max-width: 300px; border-radius: 30px; padding: 7px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.01));
  box-shadow: 0 26px 60px -32px rgba(0,0,0,.75), inset 0 0 0 1px rgba(255,255,255,.03);
}
html[data-theme="light"] .wa-phone { background: #f2f5f3; }
.wa-phone-bar { display: grid; place-items: center; padding: 3px 0 6px; }
.wa-phone-bar i { width: 62px; height: 5px; border-radius: 99px; background: var(--line-strong); display: block; }
.wa-phone-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  border-radius: 18px 18px 0 0; background: #075e54;
}
.wa-phone-head .wa-back, .wa-phone-head .wa-dots { color: rgba(255,255,255,.85); display: inline-flex; }
.wa-phone-head svg { width: 15px; height: 15px; }
.wa-ava {
  width: 27px; height: 27px; flex: 0 0 27px; border-radius: 999px; display: grid; place-items: center;
  background: rgba(255,255,255,.22); color: #fff; font-size: 12px; font-weight: 700;
}
.wa-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.wa-who b { font-size: 12.5px; font-weight: 650; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-who span { font-size: 10px; color: rgba(255,255,255,.72); }
.wa-phone-body {
  border-radius: 0 0 18px 18px; padding: 12px 10px 14px; min-height: 260px;
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 16px 16px;
}
html[data-theme="light"] .wa-phone-body { background-color: #ece5dd; background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px); }
.wa-day { text-align: center; margin-bottom: 9px; }
.wa-day span, .wa-day { font-size: 9.5px; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .06em; }
html[data-theme="light"] .wa-day { color: #7b8b83; }
.wa-bubble {
  position: relative; margin-left: auto; width: fit-content; max-width: 100%; min-width: 92px;
  padding: 6px 8px 5px; border-radius: 10px 10px 3px 10px;
  background: #005c4b; color: #e9edef; font-size: 12px; line-height: 1.45;
  box-shadow: 0 1px 1px rgba(0,0,0,.2); word-break: break-word;
}
html[data-theme="light"] .wa-bubble { background: #d9fdd3; color: #111b21; }
.wa-bubble b { font-weight: 700; }
.wa-var { color: #f5a524; font-family: var(--mono, monospace); font-size: 11px; }
.wa-media { display: block; width: 100%; max-height: 190px; object-fit: cover; border-radius: 7px; margin-bottom: 5px; }
.wa-media-empty {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 84px;
  border-radius: 7px; margin-bottom: 5px; font-size: 10.5px;
  background: rgba(255,255,255,.07); color: rgba(255,255,255,.65);
}
.wa-media-empty svg { width: 15px; height: 15px; }
html[data-theme="light"] .wa-media-empty { background: rgba(0,0,0,.06); color: #5b6b63; }
.wa-head-text { font-weight: 700; margin-bottom: 4px; }
.wa-footer { margin-top: 5px; font-size: 10.5px; opacity: .75; }
.wa-text { white-space: normal; }
.wa-meta {
  display: flex; align-items: center; justify-content: flex-end; gap: 4px;
  margin-top: 3px; font-size: 9px; opacity: .62;
}
.wa-tick svg { width: 12px; height: 12px; }
.wa-btns { display: grid; gap: 4px; margin-top: 6px; }
.wa-btns span {
  text-align: center; font-size: 11.5px; font-weight: 600; padding: 6px 8px; border-radius: 7px;
  background: rgba(255,255,255,.92); color: #0a7c66;
}
html[data-theme="light"] .wa-btns span { background: #fff; }
.wa-hint { margin-top: 10px; font-size: 10px; line-height: 1.5; color: rgba(255,255,255,.42); }
html[data-theme="light"] .wa-hint { color: #7b8b83; }
.wa-hint b { color: var(--green); }

/* ---- paginação da lista de contatos do envio ---- */
.st-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 11px 16px; border-top: 1px solid var(--line);
}
.st-per { display: inline-flex; align-items: center; gap: 4px; }
.st-per .seg {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 4px 9px; border-radius: 8px; font-size: 11px; font-weight: 550;
}
.st-per .seg.on { background: var(--green); border-color: var(--green); color: #032015; font-weight: 700; }
.live-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 999px; background: var(--green);
  margin: 0 2px 1px 2px; animation: live-pulse 1.4s ease-in-out infinite;
}
@keyframes live-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }

@media (max-width: 980px) {
  .st-cols { grid-template-columns: minmax(0,1fr); }
}

@media (max-width: 820px) {
  .nb-types, .nb-when { grid-template-columns: minmax(0,1fr); }
  .nb-steps { padding: 12px; gap: 4px; }
  .nb-step-text small { display: none; }
  .nb-nav { bottom: 66px; padding: 9px 11px; gap: 7px; }
  .nb-nav .btn { padding: 0 13px; font-size: 12px; }
  .nbc { padding: 28px 16px; }
  .modal.full { align-items: flex-start; }
}

/* ---- cabeçalho de mídia do template (upload no Envio) ---- */
.nb-media {
  border: 1px dashed var(--line-strong); border-radius: 14px; padding: 8px;
  background: rgba(255,255,255,.02); transition: .16s; position: relative;
}
.nb-media.has { border-style: solid; border-color: rgba(0,229,138,.32); background: rgba(0,229,138,.05); }
.nb-media.busy { opacity: .55; pointer-events: none; }
.nb-media.busy::after {
  content: "Enviando…"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--green);
}
.nb-media-drop {
  display: flex; align-items: center; gap: 14px; padding: 14px; cursor: pointer; border-radius: 10px;
}
.nb-media-drop:hover { background: rgba(0,229,138,.06); }
.nb-media-ic {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid rgba(0,229,138,.28); color: var(--green); background: rgba(0,229,138,.1);
}
.nb-media-ic svg { width: 19px; height: 19px; }
.nb-media-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.nb-media-txt b { font-size: 13px; font-weight: 650; }
.nb-media-txt small { font-size: 11.5px; color: var(--muted); }
.nb-media.has { display: flex; align-items: center; gap: 12px; padding: 10px; }
.nb-media-prev {
  width: 64px; height: 64px; flex: 0 0 64px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: #000; display: grid; place-items: center;
}
.nb-media-prev img { width: 100%; height: 100%; object-fit: cover; }
.nb-media-file { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; color: var(--green); }
.nb-media-file svg { width: 20px; height: 20px; }
.nb-media-file span { font-size: 8.5px; color: var(--muted); text-align: center; word-break: break-all; line-height: 1.2; }
.nb-media-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nb-media-acts { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

/* prévia dentro da bolha do WhatsApp */
.nb-preview-media { display: block; margin: -3px -5px 9px; border-radius: 9px; overflow: hidden; }
.nb-preview-media img { width: 100%; max-height: 190px; object-fit: cover; display: block; }
.nb-preview-media:not(:has(img)) {
  display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--green);
  padding: 9px 10px; border: 1px solid rgba(0,229,138,.25); border-radius: 9px;
}
.nb-preview-media svg { width: 14px; height: 14px; }
.nb-preview-text { display: block; }

/* card de mídia na confirmação final */
.nbc-media {
  margin: 0 auto 16px; max-width: 260px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line-strong); background: rgba(0,0,0,.35);
}
.nbc-media img { width: 100%; max-height: 190px; object-fit: cover; display: block; }
.nbc-media span {
  display: flex; align-items: center; gap: 6px; padding: 7px 10px; font-size: 11px;
  color: var(--muted); border-top: 1px solid var(--line);
}
.nbc-media svg { width: 13px; height: 13px; color: var(--green); }

/* ---- filtros de contatos: incluir / excluir ---- */
.fseg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px;
}
.fpane {
  border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px 12px;
  background: rgba(255,255,255,.015); position: relative;
}
.fpane::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--muted); border-radius: 13px 0 0 13px;
}
.fpane.open { z-index: 45; }
/* menu flutuante: escapa do overflow:hidden do card e do corpo do modal */
.dd-menu.floating {
  position: fixed; z-index: 900; max-height: min(320px, 60vh);
  scrollbar-width: thin; scrollbar-color: rgba(0,229,138,.45) transparent;
}
.dd-menu.floating::-webkit-scrollbar { width: 8px; }
.dd-menu.floating::-webkit-scrollbar-track { background: transparent; }
.dd-menu.floating::-webkit-scrollbar-thumb {
  background: rgba(0,229,138,.35); border-radius: 99px;
}
.dd-menu.floating::-webkit-scrollbar-thumb:hover { background: rgba(0,229,138,.6); }
.fpane.inc { border-color: rgba(0,229,138,.24); background: rgba(0,229,138,.035); }
.fpane.inc::before { background: linear-gradient(180deg, #00e58a, #00c47c); }
.fpane.exc { border-color: rgba(251,113,133,.24); background: rgba(251,113,133,.035); }
.fpane.exc::before { background: linear-gradient(180deg, #fb7185, #e11d48); }
.fpane-head {
  display: flex; align-items: center; gap: 7px; margin-bottom: 9px; flex-wrap: wrap;
}
.fpane-head b { font-size: 12.5px; letter-spacing: .01em; }
.fpane.inc .fpane-head b { color: #3ee5a3; }
.fpane.exc .fpane-head b { color: #fb8b9b; }
.fpane-head .hint { margin: 0; font-size: 11.5px; }
.fpane-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.fpane.inc .fpane-dot { background: #00e58a; box-shadow: 0 0 8px rgba(0,229,138,.7); }
.fpane.exc .fpane-dot { background: #fb7185; box-shadow: 0 0 8px rgba(251,113,133,.7); }
.fpane-body { display: flex; flex-direction: column; gap: 8px; }
.fpane .dd-menu { min-width: 200px; }
.frow { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.frow .select { min-width: 140px; flex: 1 1 140px; }
.fdate { display: flex; flex-direction: column; gap: 4px; flex: 1 1 118px; }
.fdate span { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.fdate .input { padding-top: 8px; padding-bottom: 8px; font-size: 12.5px; }
.fbottom {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--line);
}
.fsum {
  font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 100%;
}
.fsum:empty { display: none; }

/* Botão de destaque do filtro avançado (abre o modal) */
.btn-adv {
  position: relative; height: 38px; padding: 0 16px; font-size: 12.5px; font-weight: 700;
  border: 1px solid rgba(0,229,138,.55); color: #04120c;
  background: linear-gradient(180deg, #2bffab, #00c47c);
  box-shadow: 0 12px 28px -14px rgba(0,229,138,.85), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-adv:hover {
  border-color: rgba(0,229,138,.95); color: #04120c;
  background: linear-gradient(180deg, #59ffbe, #06d98a);
  box-shadow: 0 14px 34px -12px rgba(0,229,138,.95), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn-adv svg { width: 16px; height: 16px; }
.adv-badge {
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 750;
  background: #04120c; color: #6bf7bd;
}
.adv-seg { margin-top: 0; }
html[data-theme="light"] .btn-adv {
  color: #fff; border-color: rgba(0,140,88,.85);
  background: linear-gradient(180deg, #04b877, #008c58);
  box-shadow: 0 12px 26px -14px rgba(0,110,70,.95), inset 0 1px 0 rgba(255,255,255,.22);
}
html[data-theme="light"] .btn-adv:hover { color: #fff; border-color: rgba(0,120,75,1); background: linear-gradient(180deg, #06c983, #009a61); }
html[data-theme="light"] .adv-badge { background: #fff; color: #008c58; }
@media (max-width: 560px) { .btn-adv { width: 100%; justify-content: center; } }
.modal-body .fsum {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 14px;
  white-space: normal; background: rgba(0,0,0,.2); color: var(--text-2, var(--muted));
}
.lm-row {
  display: flex; align-items: center; gap: 8px; padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}
.lm-row:last-child { border-bottom: 0; }
.badge + .badge { margin-left: 4px; }

@media (max-width: 820px) {
  .fseg { grid-template-columns: 1fr; }
  .fbottom .row { width: 100%; }
  .fbottom .row .btn { flex: 1 1 auto; justify-content: center; }
}

/* ============================== Agente IA: pílula no menu + tela ========= */
.ai-pill {
  display: flex; align-items: center; gap: 9px; margin: -6px 2px 12px;
  padding: 8px 10px; border-radius: 13px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
  transition: .18s ease; user-select: none;
}
.ai-pill:hover { border-color: rgba(0,229,138,.3); background: rgba(0,229,138,.05); }
.ai-pill.busy { opacity: .6; pointer-events: none; }
.ai-pill-ic {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(127,156,141,.14); color: var(--muted); transition: .18s;
}
.ai-pill-ic svg { width: 14px; height: 14px; }
.ai-pill.on .ai-pill-ic {
  background: rgba(0,229,138,.14); color: var(--green);
  box-shadow: 0 0 14px -3px rgba(0,229,138,.7);
}
.ai-pill-txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.ai-pill-txt b { font-size: 11.5px; font-weight: 650; letter-spacing: .01em; }
.ai-pill-txt small { font-size: 10px; color: var(--faint); }
.ai-pill.on .ai-pill-txt small { color: #3ee5a3; }
.ai-pill-sw {
  position: relative; width: 32px; height: 18px; flex: 0 0 32px; border-radius: 99px;
  background: rgba(127,156,141,.28); border: 1px solid var(--line); transition: .18s;
}
.ai-pill-sw::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px;
  border-radius: 99px; background: #fff; transition: .18s;
}
.ai-pill.on .ai-pill-sw { background: var(--green); border-color: transparent; box-shadow: 0 0 14px -3px var(--green); }
.ai-pill.on .ai-pill-sw::after { left: 16px; background: #032015; }

/* ---- card do número ativo (menu lateral) ---- */
.num-card { position: relative; margin: -6px 2px 8px; }
.num-btn {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 9px; border-radius: 13px; cursor: pointer; text-align: left;
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
  color: inherit; font: inherit; transition: .18s ease;
}
.num-btn:hover { border-color: rgba(0,229,138,.3); background: rgba(0,229,138,.05); }
.num-ic {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(0,229,138,.14); color: var(--green);
}
.num-ic svg { width: 14px; height: 14px; }
.num-txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.25; }
.num-txt small { font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.num-txt b { font-size: 11.5px; font-weight: 650; }
.num-txt em { font-style: normal; font-size: 10px; color: var(--faint); }
.num-chev { color: var(--faint); display: grid; place-items: center; }
.num-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60;
  background: #0a1210; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 44px -12px rgba(0,0,0,.65); padding: 6px; max-height: 340px; overflow: auto;
}
html[data-theme="light"] .num-menu { background: #fff; }

.num-menu-label { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 6px 8px 4px; }
.num-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px; border-radius: 10px; border: 0; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer; text-decoration: none;
}
.num-item:hover { background: rgba(255,255,255,.05); }
.num-item.on { background: rgba(0,229,138,.09); }
.num-item-ic { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 8px; display: grid; place-items: center; background: rgba(0,229,138,.12); color: var(--green); }
.num-item-ic svg { width: 13px; height: 13px; }
.num-item-txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.num-item-txt b { font-size: 11.5px; font-weight: 650; }
.num-item-txt small { font-size: 10px; color: var(--faint); }
.num-check { color: var(--green); display: grid; place-items: center; }
.num-manage { margin-top: 2px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; color: var(--muted); font-size: 11.5px; }
.num-manage svg { width: 14px; height: 14px; }
html.sb-collapsed .num-btn { justify-content: center; padding: 9px 0; }
html.sb-collapsed .num-txt, html.sb-collapsed .num-chev { display: none; }
html.sb-collapsed .num-menu { left: 6px; right: auto; width: 240px; }

/* ---- tela do Agente IA ---- */
.ai-top { margin-bottom: 16px; }
.ai-state {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px;
  border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  flex-wrap: wrap;
}
.ai-state.on {
  border-color: rgba(0,229,138,.32);
  background: linear-gradient(100deg, rgba(0,229,138,.1), rgba(0,229,138,.02) 60%, transparent);
  box-shadow: 0 0 40px -22px rgba(0,229,138,.7);
}
.ai-orb {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(127,156,141,.12); color: var(--muted); border: 1px solid var(--line);
}
.ai-state.on .ai-orb {
  background: linear-gradient(150deg, #062a1d, #0a3d29); color: var(--green);
  border-color: rgba(0,229,138,.4); box-shadow: 0 0 26px -6px rgba(0,229,138,.7);
  animation: aiPulse 3.4s ease-in-out infinite;
}
@keyframes aiPulse { 0%,100% { box-shadow: 0 0 20px -8px rgba(0,229,138,.55); } 50% { box-shadow: 0 0 30px -2px rgba(0,229,138,.85); } }
.ai-orb svg { width: 20px; height: 20px; }
.ai-state-title { font-size: 14px; font-weight: 700; }
.ai-state-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ai-mini { display: flex; flex-direction: column; align-items: flex-end; padding: 0 10px; }
.ai-mini-n { font-size: 20px; font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.ai-mini-l { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }

.ai-grid { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 16px; align-items: start; }
.ai-steps { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ai-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ai-step-head {
  display: flex; align-items: flex-start; gap: 12px; padding: 15px 18px 0;
}
.ai-step-head h3 { font-size: 14px; font-weight: 700; margin: 0; }
.ai-step-head p { font-size: 11.5px; color: var(--muted); margin: 3px 0 0; }
.ai-step-n {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 9px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: #032015; background: var(--green);
  box-shadow: 0 0 18px -5px var(--green);
}
.ai-step-head .badge { margin-left: auto; flex: 0 0 auto; }
.card#step-1 .card-body, .card#step-2 .card-body, .card#step-3 .card-body { padding-top: 14px; }

/* dias da semana */
.daychips { display: flex; gap: 6px; flex-wrap: wrap; }
.dayc {
  height: 34px; min-width: 46px; padding: 0 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--muted);
  font-size: 12px; font-weight: 650; transition: .15s;
}
.dayc:hover { border-color: rgba(0,229,138,.3); color: var(--text-2); }
.dayc.on {
  background: rgba(0,229,138,.14); border-color: rgba(0,229,138,.45); color: #3ee5a3;
  box-shadow: inset 0 0 14px -6px rgba(0,229,138,.7);
}
.ai-break {
  border: 1px dashed var(--line); border-radius: 12px; padding: 12px 13px; margin: 6px 0 10px;
  background: rgba(255,255,255,.012);
}
.ai-break .g2 { gap: 10px; }
.ai-break .field { margin-bottom: 0; }

/* documentos */
.ai-docs { display: flex; flex-direction: column; gap: 10px; }
.ai-doctype { border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; background: rgba(255,255,255,.012); }
.ai-doctype-head { display: flex; align-items: center; gap: 10px; }
.ai-doctype-ic {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(0,229,138,.08); color: var(--green); border: 1px solid rgba(0,229,138,.18);
}
.ai-doctype-ic svg { width: 15px; height: 15px; }
.ai-doctype-head b { font-size: 12.5px; display: block; }
.ai-doctype-head small { font-size: 11px; color: var(--faint); }
.ai-doclist { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.ai-doclist li {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px;
  background: rgba(0,0,0,.18);
}
.ai-doclist li:hover { background: rgba(0,0,0,.3); }
.ai-doc-title { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-doc-sub { font-size: 10.5px; color: var(--faint); }
.ai-docs-foot { margin-top: 10px; }

/* painel lateral */
.ai-check { display: flex; align-items: center; gap: 9px; }
.ai-check-ic {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(251,113,133,.12); color: var(--red);
}
.ai-check.ok .ai-check-ic { background: rgba(0,229,138,.12); color: var(--green); }
.ai-check-ic svg { width: 12px; height: 12px; }
.ai-check b { font-size: 12px; font-weight: 600; display: block; }
.ai-check small { font-size: 10.5px; color: var(--faint); }
.ai-handoff { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px; }
.ai-handoff .hint { margin-top: 6px; }

.ai-logs { max-height: 420px; overflow-y: auto; }
.ai-log { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.ai-log:last-child { border-bottom: 0; }
.ai-log-top { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.ai-log-top b { font-size: 11.5px; }
.ai-log-top .tiny { margin-left: auto; }
.ai-log-q { font-size: 11px; color: var(--faint); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ai-log-a { font-size: 11.5px; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ai-log-err { font-size: 11px; color: var(--red); }

/* ---- configurações: bloco de IA ---- */
.ai-provider-note {
  display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted);
  padding: 8px 11px; border-radius: 10px; background: rgba(255,255,255,.02);
  border: 1px solid var(--line); margin-bottom: 12px;
}
.ai-provider-note:empty { display: none; }
.ai-note-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: 0 0 6px; box-shadow: 0 0 8px var(--green); }
.ai-key-ok {
  margin-top: 12px; padding: 10px 12px; border-radius: 11px; font-size: 11.5px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02); display: flex;
  align-items: center; gap: 8px; flex-wrap: wrap;
}
.ai-key-ok.ok { border-color: rgba(0,229,138,.35); background: rgba(0,229,138,.06); color: var(--text-2); }
.ai-key-ok.ok svg { width: 14px; height: 14px; color: var(--green); }
.ai-key-ok.err { border-color: rgba(251,113,133,.4); background: rgba(251,113,133,.07); color: #fb8b9b; }
.ai-cta {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px;
  border-radius: 13px; border: 1px solid rgba(0,229,138,.2); background: rgba(0,229,138,.05);
}
#ai-key-eye.on { color: var(--green); border-color: rgba(0,229,138,.4); }

@media (max-width: 1080px) {
  .ai-grid { grid-template-columns: minmax(0,1fr); }
  .ai-side { order: -1; }
}
@media (max-width: 620px) {
  .ai-state { gap: 10px; }
  .ai-mini { order: 3; align-items: flex-start; padding: 0; }
  .ai-step-head { flex-wrap: wrap; }
  .ai-step-head .badge { margin-left: 38px; }
  .dayc { min-width: 40px; }
}

/* ==========================================================================
   Landing — lista, cartões e wizard de criação
   ========================================================================== */
.ld-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 12px 16px; border: 1px solid var(--line);
  border-radius: 16px; background: var(--panel);
}
.ld-usage { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ld-usage-n { font-size: 22px; font-weight: 800; letter-spacing: -.04em; }
.ld-domain { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.ld-domain svg { width: 14px; height: 14px; }
.ld-domain b { color: var(--green); font-weight: 650; }

/* um card por linha, ocupando toda a coluna da página */
.ld-list { display: flex; flex-direction: column; gap: 14px; }
.ld-card {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); overflow: hidden;
  transition: border-color .18s, box-shadow .18s;
}
.ld-card:hover { border-color: rgba(0,229,138,.28); box-shadow: var(--shadow-sm); }
.ld-card .ld-thumb {
  height: 100%; min-height: 196px; border-radius: 0; align-self: stretch;
}
.ld-thumb {
  height: 152px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 20px; text-align: center; position: relative;
}
.ld-thumb::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 70% at 50% 0%, rgba(255,255,255,.22), transparent 60%); }
.ld-thumb-title { font-size: 20px; font-weight: 800; letter-spacing: -.045em; line-height: 1.1; max-width: 92%; position: relative; z-index: 1; }
.ld-thumb-btn {
  font-size: 12px; font-weight: 700; padding: 9px 16px; border-radius: 999px; position: relative; z-index: 1;
  background: rgba(255,255,255,.94); color: #0b1a12; box-shadow: 0 6px 18px -8px rgba(0,0,0,.45);
}
.ld-info { display: flex; flex-direction: column; gap: 13px; padding: 18px 20px; min-width: 0; }
.ld-info-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.ld-name { font-size: 15.5px; font-weight: 700; letter-spacing: -.025em; }

/* métricas: visitantes · cadastros · conversão */
.ld-kpis { display: flex; gap: 8px; flex-wrap: wrap; }
.ld-kpi {
  flex: 1 1 130px; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,.022);
}
.ld-kpi > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.ld-kpi b { font-size: 18px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.ld-kpi small { font-size: 10.5px; color: var(--muted); letter-spacing: .02em; }
.ld-kpi-ic {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 30px;
  background: rgba(0,229,138,.1); color: var(--green);
}
.ld-kpi-ic.blue { background: rgba(96,165,250,.1); color: var(--blue); }
.ld-kpi-ic.violet { background: rgba(167,139,250,.12); color: var(--violet); }
.ld-kpi-ic svg { width: 15px; height: 15px; }
.ld-kpi.good { border-color: rgba(0,229,138,.3); background: rgba(0,229,138,.055); }
.ld-kpi.good b { color: var(--green); }

/* tags e lista aplicadas */
.ld-assign { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.ld-none { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--faint); }
.ld-none svg { width: 13px; height: 13px; }
.ld-list-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 999px; border: 1px solid rgba(96,165,250,.34); color: var(--blue);
  background: rgba(96,165,250,.08); font-size: 11px; font-weight: 600;
}
.ld-list-chip svg { width: 11px; height: 11px; }
.ld-url {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted);
  margin-top: 3px; font-family: var(--mono); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ld-url:hover { color: var(--green); }
.ld-url svg { width: 11px; height: 11px; }
.ld-stats { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); }
.ld-stats span { display: inline-flex; align-items: center; gap: 5px; }
.ld-stats svg { width: 13px; height: 13px; color: var(--faint); }
.ld-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 2px; }
.ld-del { margin-left: auto; }
.ld-del:hover { color: var(--red); border-color: rgba(251,113,133,.4); }
.ld-note {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap; margin-top: 18px; padding: 12px 15px;
  border: 1px solid rgba(251,191,36,.32); background: rgba(251,191,36,.07); border-radius: 14px; font-size: 12.5px;
}
.ld-note svg { width: 16px; height: 16px; color: var(--amber); flex: 0 0 auto; }
.ld-note .btn { margin-left: auto; }

/* ---- wizard (página) ---- */
.ld-page { display: flex; flex-direction: column; gap: 16px; }
.ld-back {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 12px; color: var(--muted); font-weight: 600;
}
.ld-back:hover { color: var(--green); }
.ld-back svg { width: 14px; height: 14px; }
.ld-page .page-head { margin-bottom: 2px; }
.ld-step-label {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,.03); white-space: nowrap;
}
.ld-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.ld-step {
  display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--faint);
  padding: 6px 11px 6px 6px; border-radius: 999px; border: 1px solid transparent;
  background: none; font-family: inherit; cursor: default; text-align: left;
}
.ld-step:not([disabled]) { cursor: pointer; }
.ld-step:not([disabled]):hover { background: rgba(255,255,255,.045); color: var(--text-2); }
.ld-page-foot {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 14px 0 6px; margin-top: 4px;
  background: linear-gradient(180deg, rgba(4,7,6,0) 0%, var(--bg) 40%, var(--bg) 100%);
}
.ld-page-foot #ld-next { margin-left: auto; }
html[data-theme="light"] .ld-page-foot {
  background: linear-gradient(180deg, rgba(243,248,245,0) 0%, var(--bg) 40%, var(--bg) 100%);
}

/* tags e lista dentro do passo 3 */
.ld-assign-box {
  margin-top: 16px; padding: 15px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
  display: flex; flex-direction: column; gap: 13px;
}
.ld-assign-head b { font-size: 13px; }
.ld-assign-col { display: flex; flex-direction: column; gap: 6px; }
.ld-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ld-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.03);
  color: var(--text-2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: border-color .14s, background .14s, color .14s;
}
.ld-chip i { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; opacity: .75; }
.ld-chip:hover { border-color: var(--line-strong); }
.ld-chip.on { border-color: currentColor; background: rgba(255,255,255,.06); }
.ld-step.on { color: var(--text); background: rgba(0,229,138,.08); border-color: rgba(0,229,138,.26); }
.ld-step.done { color: var(--muted); }
.ld-step-dot {
  width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px;
  font-weight: 800; background: rgba(255,255,255,.06); color: var(--muted); flex: 0 0 21px;
}
.ld-step-dot svg { width: 11px; height: 11px; }
.ld-step.on .ld-step-dot { background: var(--green); color: #04120c; }
.ld-step.done .ld-step-dot { background: rgba(0,229,138,.18); color: var(--green); }

.ld-wizard-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.ld-step-content h3 { font-size: 17px; letter-spacing: -.03em; }
.ld-step-body .field:last-child { margin-bottom: 0; }

.ld-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 10px; }
.ld-sw {
  height: 48px; border-radius: 13px; border: 2px solid transparent; cursor: pointer; padding: 0;
  box-shadow: 0 6px 16px -10px rgba(0,0,0,.8); transition: transform .14s, border-color .14s;
}
.ld-sw:hover { transform: translateY(-2px); }
.ld-sw.on { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,229,138,.22); }

.ld-preview {
  border-radius: 22px; min-height: 330px; padding: 26px 22px; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center; gap: 20px; position: sticky; top: 0;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.ld-preview-tag {
  position: absolute; top: 10px; left: 12px; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  opacity: .55; font-weight: 700;
}
.ld-preview-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; }
.ld-preview-title { font-size: 22px; font-weight: 800; letter-spacing: -.045em; line-height: 1.1; max-width: 100%; word-break: break-word; }
.ld-preview-btn {
  background: #fff; color: #0b1a12; font-weight: 800; font-size: 12.5px; padding: 12px 22px; border-radius: 999px;
  box-shadow: 0 10px 26px -12px rgba(0,0,0,.55); max-width: 100%; word-break: break-word;
}
.ld-preview-terms { font-size: 9px; opacity: .62; line-height: 1.45; max-width: 100%; }

.ld-checks { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.ld-check {
  display: flex; align-items: center; gap: 11px; text-align: left; padding: 12px 14px; border-radius: 13px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02); cursor: pointer; color: var(--text);
  transition: border-color .15s, background .15s;
}
.ld-check b { display: block; font-size: 13px; }
.ld-check small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ld-check-box {
  width: 20px; height: 20px; border-radius: 6px; border: 1.6px solid var(--line-strong); display: grid;
  place-items: center; flex: 0 0 20px; color: #04120c;
}
.ld-check-box svg { width: 12px; height: 12px; stroke-width: 3; }
.ld-check.on { border-color: rgba(0,229,138,.4); background: rgba(0,229,138,.07); }
.ld-check.on .ld-check-box { background: var(--green); border-color: var(--green); }
.ld-check.locked { cursor: default; }
.ld-switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.02);
}
.ld-switch-row b { font-size: 13px; }

.ld-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line); margin-bottom: 14px; }
.ld-seg button {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 9px;
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.ld-seg button svg { width: 14px; height: 14px; }
.ld-seg button.on { background: rgba(0,229,138,.14); color: var(--green); }

.ld-pick { display: flex; flex-direction: column; gap: 8px; }
.ld-pick-item {
  display: flex; align-items: center; gap: 11px; text-align: left; padding: 11px 13px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--text); cursor: pointer; font: inherit;
}
.ld-pick-item b { display: block; font-size: 13px; }
.ld-pick-item small { font-size: 11px; color: var(--muted); }
.ld-pick-item.on { border-color: rgba(0,229,138,.45); background: rgba(0,229,138,.07); }
.ld-pick-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(0,229,138,.09); color: var(--green); flex: 0 0 30px; }
.ld-pick-ic svg { width: 15px; height: 15px; }
.ld-pick-check { color: var(--green); }
.ld-pick-check svg { width: 15px; height: 15px; }

.ld-vars { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.ld-var { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ld-var .input { flex: 1 1 180px; min-width: 0; }
.ld-var-tag { font-family: var(--mono); font-size: 11px; color: var(--green); background: rgba(0,229,138,.09); padding: 4px 7px; border-radius: 6px; flex: 0 0 auto; }
.ld-var-tokens { display: flex; gap: 4px; }
.ld-var-tokens button {
  border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--muted); border-radius: 7px;
  font: inherit; font-size: 10.5px; padding: 5px 8px; cursor: pointer;
}
.ld-var-tokens button:hover { color: var(--green); border-color: rgba(0,229,138,.35); }
.ld-warn {
  display: flex; gap: 9px; align-items: flex-start; margin: 12px 0; padding: 11px 13px; border-radius: 11px;
  border: 1px solid rgba(251,191,36,.3); background: rgba(251,191,36,.06); font-size: 12px; color: var(--text-2);
}
.ld-warn svg { width: 15px; height: 15px; color: var(--amber); flex: 0 0 auto; margin-top: 1px; }
.ld-empty-inline { font-size: 12.5px; color: var(--muted); padding: 10px 0; }
.ld-empty-inline a { color: var(--green); }

.ld-redirects { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.ld-red {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 13px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--text); cursor: pointer; font: inherit;
}
.ld-red b { display: block; font-size: 13px; }
.ld-red small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ld-red-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.045); color: var(--muted); flex: 0 0 32px; }
.ld-red-ic svg { width: 16px; height: 16px; }
.ld-red.on { border-color: rgba(0,229,138,.45); background: rgba(0,229,138,.07); }
.ld-red.on .ld-red-ic { background: rgba(0,229,138,.14); color: var(--green); }

.ld-slug { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.ld-slug-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ld-slug-base { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.ld-slug-row .input { flex: 1 1 140px; min-width: 0; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.ld-slug-link { display: inline-block; margin-top: 8px; font-size: 11.5px; color: var(--green); font-family: var(--mono); word-break: break-all; }
.ld-bad { color: var(--red) !important; }
.ld-good { color: var(--green) !important; }


.ld-success-card { text-align: center; max-width: 620px; margin: 0 auto; }
.ld-success-big {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center;
  background: rgba(0,229,138,.12); color: var(--green);
}
.ld-success-big svg { width: 30px; height: 30px; }
.ld-success-card h2 { font-size: 23px; letter-spacing: -.04em; }
.ld-success {
  display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid rgba(0,229,138,.3); background: rgba(0,229,138,.06); word-break: break-all;
}
.ld-success-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: rgba(0,229,138,.14); color: var(--green); flex: 0 0 36px; }
.ld-success-ic svg { width: 18px; height: 18px; }
.ld-leads-sum { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.ld-leads-sum b { color: var(--text); font-size: 15px; }

@media (max-width: 900px) {
  .ld-card { grid-template-columns: minmax(0, 1fr); }
  .ld-card .ld-thumb { min-height: 150px; }
  .ld-wizard-main { grid-template-columns: minmax(0, 1fr); }
  .ld-preview { min-height: 210px; position: static; }
  .ld-preview-title { font-size: 19px; }
  .ld-steps { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .ld-step { white-space: nowrap; }
}
@media (max-width: 560px) {
  .ld-swatches { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
  .ld-sw { height: 38px; border-radius: 10px; }
  .ld-page-foot { flex-wrap: wrap; }
  .ld-page-foot .btn-primary { flex: 1 1 100%; justify-content: center; }
  .ld-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .ld-kpi { flex: none; flex-direction: column; align-items: flex-start; gap: 5px; padding: 9px 10px; }
  .ld-kpi b { font-size: 16px; }
  .ld-kpi small { font-size: 9.5px; }
  .ld-kpi-ic { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 7px; }
  .ld-kpi-ic svg { width: 12px; height: 12px; }
  .ld-info { padding: 15px 16px; }
  .ld-page { padding-bottom: 84px; }
  .ld-page-foot { margin-bottom: -84px; padding-bottom: 18px; }
}

.ld-assign .tag.ld-tag { height: 22px; font-size: 11px; padding: 0 9px; }
.page-actions .btn.disabled { opacity: .45; filter: grayscale(.35); }

/* ===================== menu lateral recolhível (topbar) ============== */
/* O botão do topbar existia só no mobile. No desktop ele recolhe a barra
   para um trilho de ícones — e a escolha fica gravada no navegador. */
.menu-btn { display: inline-flex; }
html.sb-collapsed { --sbw: 76px; }
html.sb-collapsed .sidebar { padding: 22px 10px 16px; }
html.sb-collapsed .brand { justify-content: center; padding: 4px 0 18px; }
html.sb-collapsed .brand > div:last-child { display: none; }
html.sb-collapsed .nav-label { display: none; }
html.sb-collapsed .nav { gap: 6px; }
html.sb-collapsed .nav-item { justify-content: center; gap: 0; padding: 11px 0; }
html.sb-collapsed .nav-item > span { display: none; }
html.sb-collapsed .nav-item.active::before { left: -10px; }
html.sb-collapsed .nav-badge {
  position: absolute; top: 2px; right: 4px; margin: 0;
  min-width: 16px; height: 16px; padding: 0 4px; font-size: 9px;
}
html.sb-collapsed .ai-pill { justify-content: center; padding: 9px 0; }
html.sb-collapsed .ai-pill-txt,
html.sb-collapsed .ai-pill-sw { display: none; }
html.sb-collapsed .user-chip { justify-content: center; padding: 9px 0; }
html.sb-collapsed .user-chip > div:last-child { display: none; }
html.sb-collapsed #logout-btn span { display: none; }

/* ============ tela cheia do robô: paleta e painel recolhível ========= */
.flow-palette {
  position: fixed; top: 64px; right: 14px; z-index: 320;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px;
  width: 336px; padding: 8px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: 0 24px 54px -28px rgba(0,0,0,.9);
}
.flow-palette[hidden] { display: none; }
.fp-item {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 9px;
  border-radius: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.02);
  color: var(--text-2); font-size: 11.5px; font-weight: 600; cursor: pointer;
  text-align: left; transition: .14s;
}
.fp-item svg { width: 14px; height: 14px; flex: 0 0 14px; }
.fp-item:hover { color: var(--green); border-color: rgba(0,229,138,.4); background: rgba(0,229,138,.08); }

/* --- editor de mensagem do robô: formatação + emojis ------------------- */
.msg-composer { position: relative; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(255,255,255,.02); overflow: visible; }
.msg-composer-bar {
  display: flex; align-items: center; gap: 3px; padding: 5px 6px;
  border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0;
  background: rgba(255,255,255,.03);
}
.mcb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 25px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); font-size: 12px; line-height: 1;
  cursor: pointer; transition: .13s; padding: 0;
}
.mcb-btn:hover { color: var(--green); border-color: rgba(0,229,138,.35); background: rgba(0,229,138,.09); }
.mcb-btn b, .mcb-btn i, .mcb-btn s { font-size: 12.5px; }
.mcb-btn .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.mcb-emoji { font-size: 15px; }
.mcb-sep { width: 1px; height: 16px; background: var(--line-strong); margin: 0 4px; }
.msg-composer-input {
  display: block; width: 100% !important;
  border: 0 !important; border-radius: 0 !important; background: transparent !important;
  min-height: 148px; max-height: 380px; padding: 10px 12px !important;
  resize: vertical; box-shadow: none !important; line-height: 1.55;
}
.msg-composer > .hint { padding: 0 10px 8px; }
.msg-composer .hint code { font-size: 10px; color: var(--green); }
.msg-emoji-pop {
  position: absolute; right: 4px; top: 34px; z-index: 40;
  width: 268px; max-height: 220px; overflow-y: auto;
  padding: 8px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line-strong);
  box-shadow: 0 22px 44px -22px rgba(0,0,0,.9);
}
.msg-emoji-pop[hidden] { display: none; }
.msg-emoji-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.msg-emoji-item {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border: 0; border-radius: 6px;
  background: transparent; cursor: pointer; font-size: 16px; line-height: 1;
  transition: .1s;
}
.msg-emoji-item:hover { background: rgba(0,229,138,.14); transform: scale(1.12); }
.node-body code { font-size: 10.5px; color: var(--green); }

/* imagem do cabeçalho do template, no editor da landing */
.ld-media { display: flex; gap: 12px; align-items: flex-start; }
.ld-media-thumb {
  width: 92px; height: 68px; flex: 0 0 92px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.03);
}
.ld-media .btn + .btn { margin-left: 6px; }
.ld-media .hint { margin-top: 7px; }

/* ---------------- tags/listas clicáveis (painel do Inbox) + automações --- */
.tag-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 7px;
  font-size: 11px; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2);
  cursor: pointer; transition: border-color .12s, background .12s, color .12s;
}
.tag-btn i { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.tag-btn:hover { border-color: currentColor; }
.tag-btn.on { border-color: currentColor; background: rgba(0, 229, 138, .10); color: var(--green); }
.tag-btn:disabled { opacity: .55; cursor: not-allowed; }
.tag-btn .lk { display: inline-flex; margin-left: 1px; opacity: .8; }
.tag-btn .lk svg { width: 11px; height: 11px; }

.au-preview {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 12px; line-height: 1.5; color: var(--text-2);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin: 4px 0 14px;
}
.au-preview svg { width: 15px; height: 15px; color: var(--cyan); flex: 0 0 auto; margin-top: 1px; }

/* segmento 24H do Inbox: é filtro, não ordenação — usa contorno verde em vez
   do preenchimento sólido, para não parecer que há duas ordenações ativas */
.segmented .seg.seg-win { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.segmented .seg.seg-win svg { width: 12px; height: 12px; }
.segmented .seg.seg-win.on {
  background: rgba(0, 229, 138, .12);
  color: var(--green);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(0, 229, 138, .55);
}

/* ==========================================================================
   Suporte — tickets internos (membro ↔ admin, sem e-mail)
   ========================================================================== */
.tk-topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tk-num { font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: .06em; }

.tk-wrap { overflow: hidden; }
.tk-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tk-tabs { flex: 1 1 340px; flex-wrap: wrap; border: 0; background: transparent; padding: 0; gap: 2px; }
.tk-tabs .tab { border: 1px solid transparent; }
.tk-tabs .tab.active { border-color: var(--line); }
.tk-tabs .tab b { font-size: 11px; opacity: .7; margin-left: 3px; }
.tk-search { position: relative; flex: 0 0 250px; }
.tk-search .input { padding-left: 34px; }
.tk-search > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }

.tk-row { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: .13s; }
.tk-row:last-child { border-bottom: 0; }
.tk-row:hover { background: rgba(255, 255, 255, .03); }
.tk-row.unread { background: rgba(0, 229, 138, .045); }
.tk-row-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 36px; background: rgba(34, 211, 238, .09); border: 1px solid rgba(34, 211, 238, .18); color: var(--cyan); }
.tk-row-ic svg { width: 17px; height: 17px; }
.tk-row-main { flex: 1; min-width: 0; }
.tk-row-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tk-row-subj { font-size: 13.5px; font-weight: 650; color: var(--text); min-width: 0; }
.tk-row-prev { font-size: 12px; color: var(--muted); margin-top: 3px; min-width: 0; }
.tk-row-meta { display: flex; align-items: center; gap: 9px; margin-top: 8px; flex-wrap: wrap; }
.tk-row-side { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; color: var(--faint); }
.tk-row-side svg { width: 14px; height: 14px; }
.tk-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; }
.tk-blank { padding: 8px; }

.tk-thread { overflow: hidden; }
.tk-head { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.tk-subj { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.tk-head-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tk-status { height: 36px; min-width: 180px; }

.tk-msgs { display: flex; flex-direction: column; gap: 10px; padding: 20px 18px; max-height: min(58vh, 620px); overflow-y: auto; background: radial-gradient(600px 400px at 70% 0%, rgba(0, 229, 138, .03), transparent 60%); }
.tk-msg { display: flex; }
.tk-msg.mine { justify-content: flex-end; }
.tk-bubble { max-width: min(560px, 86%); background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; border-bottom-left-radius: 5px; padding: 11px 13px; font-size: 13px; line-height: 1.5; color: var(--text); }
.tk-msg.mine .tk-bubble { background: linear-gradient(140deg, #00d987, #00bf78); color: #022116; border: 0; border-radius: 16px; border-bottom-right-radius: 5px; box-shadow: 0 8px 24px -14px rgba(0, 229, 138, .7); }
.tk-from { display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .75; margin-bottom: 6px; }
.tk-from svg { width: 12px; height: 12px; }
.tk-text-body { word-break: break-word; }
.tk-stamp { font-size: 10px; opacity: .55; margin-top: 6px; text-align: right; }
.tk-sys { display: flex; justify-content: center; margin: 4px 0; }
.tk-sys span { font-size: 11px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; text-align: center; }
.tk-files { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 7px; }
.tk-img { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); max-width: 220px; }
.tk-img img { display: block; width: 100%; height: auto; max-height: 280px; object-fit: cover; }
.tk-file { display: flex; align-items: center; gap: 8px; max-width: 260px; padding: 8px 10px; border-radius: 10px; background: rgba(127, 156, 141, .1); border: 1px solid var(--line); text-decoration: none; color: inherit; font-size: 12.5px; }
.tk-file span { flex: 1; min-width: 0; }
.tk-file small { color: var(--muted); font-size: 10.5px; }
.tk-file svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--muted); }
.tk-empty { padding: 30px; text-align: center; color: var(--muted); font-size: 12.5px; }

.tk-composer { padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.tk-text { min-height: 76px; }
.tk-bar { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.tk-attach { margin: 0; cursor: pointer; }
.tk-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tk-chips:not(:empty) { margin-bottom: 9px; }
.tk-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 5px 8px; font-size: 11.5px; }
.tk-chip svg { width: 13px; height: 13px; color: var(--muted); flex: 0 0 13px; }
.tk-chip small { color: var(--faint); font-size: 10px; }
.tk-chip-x { border: 0; background: transparent; color: var(--faint); cursor: pointer; display: grid; place-items: center; padding: 0 2px; border-radius: 5px; }
.tk-chip-x:hover { color: var(--red); }
.tk-chip-x svg { width: 11px; height: 11px; }

.tk-drop { border: 1px dashed var(--line-strong); border-radius: 12px; background: rgba(255, 255, 255, .02); }
.tk-drop-in { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 18px; cursor: pointer; text-align: center; font-size: 12.5px; color: var(--muted); }
.tk-drop-in svg { width: 20px; height: 20px; color: var(--green); }
.tk-drop-in b { color: var(--text); font-weight: 600; }
.tk-drop-in small { color: var(--faint); font-size: 11px; }

@media (max-width: 820px) {
  .tk-search { flex: 1 1 100%; }
  .tk-head { flex-direction: column; }
  .tk-head-acts { width: 100%; justify-content: flex-start; }
  .tk-status { min-width: 0; flex: 1; }
  .tk-msgs { max-height: none; }
  .tk-row-ic { display: none; }
  .tk-row-side .tiny { display: none; }
}

/* anexos dentro da bolha do próprio autor (fundo verde): contraste próprio */
.tk-msg.mine .tk-file { background: rgba(2, 33, 22, .13); border-color: rgba(2, 33, 22, .22); }
.tk-msg.mine .tk-file svg, .tk-msg.mine .tk-file small { color: rgba(2, 33, 22, .65); }
.tk-msg.mine .tk-img { border-color: rgba(2, 33, 22, .22); }

/* ======================================================== robô criado por IA */
.ai-rb-hero { display: flex; gap: 13px; align-items: flex-start; padding: 14px; border-radius: var(--r-sm); background: linear-gradient(140deg, rgba(167, 139, 250, .1), rgba(0, 229, 138, .05)); border: 1px solid rgba(167, 139, 250, .22); }
.ai-rb-hero .strong { font-size: 14px; }
.ai-rb-hero .hint { margin-top: 3px; }
.ai-rb-orb { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--violet); background: rgba(167, 139, 250, .12); border: 1px solid rgba(167, 139, 250, .28); }
.ai-rb-orb svg { width: 19px; height: 19px; }
.ai-rb-orb.pulse { animation: rbPulse 1.8s ease-in-out infinite; }
@keyframes rbPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, .28); } 50% { box-shadow: 0 0 0 9px rgba(167, 139, 250, 0); } }

.ai-rb-prompt { min-height: 168px; resize: vertical; line-height: 1.55; }
.rb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rb-chip { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12px; color: var(--text-2); background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 6px 11px; cursor: pointer; transition: .15s; }
.rb-chip:hover { border-color: var(--line-strong); color: var(--text); background: var(--panel-2); }
.rb-chip svg { width: 13px; height: 13px; color: var(--violet); }
.ai-rb-foot-note { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 14px; font-size: 11.5px; line-height: 1.5; color: var(--faint); }
.ai-rb-foot-note svg { width: 13px; height: 13px; }

.modal.rb-progress { max-width: 520px; padding: 22px 22px 0; }
.rb-prog-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.rb-prog-title { font-size: 18px; margin: 0 0 3px; letter-spacing: -.01em; }
.rb-bar { height: 9px; }
.rb-bar > i { background: linear-gradient(90deg, var(--violet), var(--green)); }
.rb-bar.ok > i { background: linear-gradient(90deg, var(--green-deep), var(--green)); }
.rb-bar.err > i { background: linear-gradient(90deg, #b34, var(--red)); }
.rb-prog-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); margin-top: 8px; font-variant-numeric: tabular-nums; }
.rb-prog-log { margin-top: 16px; max-height: 190px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding-bottom: 4px; }
.rb-log-line { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-2); animation: rbIn .35s ease; }
.rb-log-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; background: var(--green); box-shadow: 0 0 10px var(--glow); }
.rb-log-line:last-child .rb-log-dot { animation: rbBlink 1.2s ease-in-out infinite; }
@keyframes rbBlink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes rbIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.rb-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 18px -22px 0; }
.rb-done { display: flex; gap: 11px; align-items: center; min-width: 0; padding: 11px 12px; border-radius: var(--r-sm); background: rgba(0, 229, 138, .07); border: 1px solid rgba(0, 229, 138, .22); animation: rbIn .35s ease; }
.rb-done-ic { color: var(--green); display: grid; place-items: center; }
.rb-done-ic svg { width: 22px; height: 22px; }
.rb-error { display: flex; gap: 9px; align-items: flex-start; color: var(--red); font-size: 12.5px; line-height: 1.45; }
.rb-error svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; }
@media (max-width: 560px) {
  .modal.rb-progress { padding: 18px 16px 0; }
  .rb-foot { margin: 16px -16px 0; }
}

.rb-banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; margin-bottom: 16px; border-color: rgba(167, 139, 250, .28); background: linear-gradient(140deg, rgba(167, 139, 250, .09), rgba(0, 229, 138, .04)); }
.rb-banner .strong { font-size: 13.5px; }
.rb-banner .hint { margin: 2px 0 8px; }
.rb-banner-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 36px; color: var(--violet); background: rgba(167, 139, 250, .12); border: 1px solid rgba(167, 139, 250, .28); }
.rb-banner-ic svg { width: 17px; height: 17px; }
.rb-banner-ic.pulse { animation: rbPulse 1.8s ease-in-out infinite; }
.rb-banner-bar { height: 6px; }
.rb-banner-bar > i { background: linear-gradient(90deg, var(--violet), var(--green)); }

/* ---------------------------------------------------------------- Programar */
.sx-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.sx-stat { display: flex; align-items: center; gap: 12px; }
.sx-stat-ic { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); background: rgba(127, 156, 141, .12); border: 1px solid var(--line); }
.sx-stat-ic svg { width: 17px; height: 17px; }
.sx-stat-ic.on { color: var(--green); background: rgba(0, 229, 138, .1); border-color: rgba(0, 229, 138, .25); }
.sx-stat-ic.bad { color: var(--red); background: rgba(251, 113, 133, .1); border-color: rgba(251, 113, 133, .25); }
.sx-stat b { display: block; font-size: 17px; font-weight: 750; letter-spacing: -.03em; line-height: 1.2; }
.sx-stat span { display: block; font-size: 11.5px; color: var(--muted); }

.sx-ic { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 13px; display: grid; place-items: center; color: var(--green); background: linear-gradient(145deg, rgba(0, 229, 138, .16), rgba(0, 229, 138, .04)); border: 1px solid rgba(0, 229, 138, .22); }
.sx-ic svg { width: 18px; height: 18px; }

.sx-conds { display: flex; flex-direction: column; gap: 6px; }
.sx-cond { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.sx-cond svg { width: 13px; height: 13px; flex: 0 0 13px; color: var(--green); }
.sx-cond em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--faint); white-space: nowrap; }
.sx-cond.big { font-size: 12.5px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }

.sx-alert { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 14px; color: var(--red); border-color: rgba(251, 113, 133, .3); }
.sx-alert svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; }
.sx-alert b { font-size: 12.5px; color: var(--red); }

.sx-grid { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 16px; align-items: start; margin-top: 4px; }
.sx-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sx-side { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 12px; }

.sx-sec-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.sx-sec-head > .btn { margin-left: auto; flex: 0 0 auto; }
.sx-step { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--green); background: rgba(0, 229, 138, .12); border: 1px solid rgba(0, 229, 138, .25); }
.sx-sec-head .card-title { font-size: 14.5px; }

.sx-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sx-pick-label { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 10.5px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.sx-pick-label svg { width: 13px; height: 13px; }

.sx-inline { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; margin-top: 14px; }
.sx-toggle-line { display: flex; align-items: center; gap: 14px; flex: 1 1 240px; min-width: 220px; }
.sx-unit { align-self: center; font-size: 12px; color: var(--muted); }
.sx-inline .input-group { align-items: center; }

.sx-adv { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.sx-adv summary { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: var(--muted); list-style: none; }
.sx-adv summary::-webkit-details-marker { display: none; }
.sx-adv summary svg { width: 13px; height: 13px; }
.sx-adv summary:hover { color: var(--text-2); }

.sx-rule { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.sx-rule-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.sx-rule-n { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--blue); background: rgba(96, 165, 250, .14); }
.sx-rtypes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; margin-bottom: 12px; }
.sx-rtypes button { padding: 7px 4px; font-size: 11.5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-rule-body { display: flex; flex-direction: column; gap: 12px; }
.sx-weekdays { display: flex; gap: 6px; flex-wrap: wrap; }
.sx-wd { height: 30px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; transition: .15s; }
.sx-wd:hover { color: var(--text); border-color: rgba(0, 229, 138, .4); }
.sx-wd.on { background: var(--green); border-color: transparent; color: #032015; }
.sx-rule-sum { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 10px; font-size: 12px; color: var(--text-2); background: rgba(0, 229, 138, .06); border: 1px solid rgba(0, 229, 138, .16); }
.sx-rule-sum svg { width: 13px; height: 13px; flex: 0 0 13px; color: var(--green); }

.sx-preview { display: flex; flex-direction: column; gap: 16px; }
.sx-prev-title { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; font-size: 10.5px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.sx-prev-title svg { width: 13px; height: 13px; }
.sx-prev-big { font-size: 23px; font-weight: 780; letter-spacing: -.035em; line-height: 1.15; }
.sx-prev-big small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.sx-sample { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.sx-sample span { font-size: 11px; padding: 3px 8px; border-radius: 99px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); color: var(--text-2); }
.sx-prev-foot { padding-top: 13px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }

.sx-next { display: flex; flex-direction: column; gap: 10px; }
.sx-next-row { display: grid; grid-template-columns: 9px minmax(0, 1fr); column-gap: 8px; row-gap: 1px; align-items: start; }
.sx-next-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 99px; background: var(--green); box-shadow: 0 0 10px -1px var(--green); grid-row: 1 / span 3; }
.sx-next-row b { grid-column: 2; font-size: 12.5px; font-weight: 650; }
.sx-next-row em { grid-column: 2; font-style: normal; font-size: 11px; color: var(--green-2, var(--green)); }
.sx-next-row small { grid-column: 2; font-size: 11px; color: var(--faint); line-height: 1.35; }

@media (max-width: 980px) {
  .sx-grid { grid-template-columns: minmax(0, 1fr); }
  .sx-side { position: static; }
  .sx-picks { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .sx-stats { grid-template-columns: minmax(0, 1fr); }
  .sx-rtypes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sx-sec-head { flex-wrap: wrap; }
  .sx-sec-head > .btn { margin-left: 0; }
}

/* ==========================================================================
   Contatos — segmentação por tags/listas + gerenciador unificado
   ========================================================================== */

/* confirmação empilhada sobre a janela que a abriu */
.modal-backdrop.confirm-backdrop { z-index: 520; }

/* ---- barra de segmentação (chips) ---- */
.seg-card { margin-bottom: 14px; }
.seg-body { padding: 12px 14px 13px; display: flex; flex-direction: column; gap: 9px; }
.seg-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.seg-title {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted);
}
.seg-title svg { width: 14px; height: 14px; color: var(--green); }
.seg-note { font-size: 11.5px; color: var(--faint); }
.seg-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.seg-cap {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  font-size: 11px; font-weight: 650; color: var(--faint); min-width: 62px;
}
.seg-cap svg { width: 13px; height: 13px; }
.seg-chips {
  display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0;
  flex-wrap: wrap; padding: 2px 1px 3px;
}
.fchip {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  height: 30px; padding: 0 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255,255,255,.03);
  color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap;
  transition: .15s ease;
}
.fchip:hover { border-color: rgba(0,229,138,.35); background: rgba(0,229,138,.07); color: var(--text); transform: translateY(-1px); }
.fchip:active { transform: translateY(0); }
.fchip > svg { width: 13px; height: 13px; color: var(--faint); }
.fchip > i { width: 8px; height: 8px; border-radius: 99px; flex: 0 0 8px; }
.fchip > b {
  font-size: 10.5px; font-weight: 700; color: var(--faint);
  padding: 1px 5px; border-radius: 99px; background: rgba(255,255,255,.05);
}
.fchip.on {
  border-color: rgba(0,229,138,.65); color: #04120c;
  background: linear-gradient(180deg, #2bffab, #00c47c);
  box-shadow: 0 10px 24px -14px rgba(0,229,138,.9);
}
.fchip.on > b { color: #04241a; background: rgba(0,0,0,.16); }
.fchip.on > svg { color: #04241a; }
.fchip.ghost { color: var(--muted); border-style: dashed; }
.fchip.ghost > svg { color: var(--muted); }
.seg-empty { font-size: 12px; color: var(--faint); }
.linkbtn {
  border: 0; background: transparent; padding: 0; cursor: pointer;
  color: var(--green); font-size: 12px; font-weight: 650; text-decoration: underline;
  text-decoration-color: rgba(0,229,138,.4); text-underline-offset: 2px;
}
.linkbtn:hover { color: var(--green-2); }
html[data-theme="light"] .fchip.on { color: #fff; background: linear-gradient(180deg, #04b877, #008c58); border-color: rgba(0,140,88,.85); }
html[data-theme="light"] .fchip.on > b { color: #fff; background: rgba(0,0,0,.18); }
html[data-theme="light"] .fchip.on > svg { color: #fff; }

/* ---- chips de tag dentro da tabela ---- */
.cell-tags { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; max-width: 230px; }
.tag-btn {
  border: 1px solid var(--line); cursor: pointer; font-family: inherit;
  transition: .14s ease;
}
.tag-btn:hover { border-color: currentColor; background: rgba(255,255,255,.06); transform: translateY(-1px); }
.tag.more { color: var(--faint); cursor: default; }

/* ---- painel Tags e listas ---- */
.lib-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.lib-bar .tabs { flex: 0 0 auto; }
.lib-bar .tab { display: inline-flex; align-items: center; gap: 6px; }
.lib-bar .tab svg { width: 13px; height: 13px; }
.lib-bar .tab b {
  font-size: 10.5px; font-weight: 750; color: var(--faint);
  padding: 1px 5px; border-radius: 99px; background: rgba(255,255,255,.06);
}
.lib-bar .tab.active b { color: var(--green); background: rgba(0,229,138,.14); }
.lib-search { position: relative; flex: 1 1 180px; min-width: 150px; }
.lib-search > span { position: absolute; left: 11px; top: 12px; width: 15px; height: 15px; color: var(--faint); }
.lib-search .input { height: 38px; padding-left: 34px; font-size: 12.5px; }

.lib-new {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px; margin-bottom: 12px; border-radius: 14px;
  border: 1px dashed var(--line-strong); background: rgba(0,229,138,.035);
}
.lib-new .input { flex: 1 1 200px; height: 38px; font-size: 12.5px; }
.lib-swatches { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.swatch {
  width: 17px; height: 17px; border-radius: 99px; cursor: pointer; padding: 0;
  background: var(--sw); border: 2px solid transparent;
  box-shadow: 0 0 0 1px rgba(0,0,0,.35) inset; transition: .14s ease;
}
.swatch:hover { transform: scale(1.15); }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--sw); }

.lib-list {
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: rgba(255,255,255,.015);
}
.lib-row {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px;
  border-bottom: 1px solid var(--line); transition: .14s ease;
}
.lib-row:hover { background: rgba(255,255,255,.028); }
.lib-list > .lib-row:last-child { border-bottom: 0; }
.lib-dot {
  width: 10px; height: 10px; border-radius: 99px; flex: 0 0 10px;
  box-shadow: 0 0 0 3px rgba(255,255,255,.05);
}
.lib-dot.list { display: grid; place-items: center; width: 22px; height: 22px; flex-basis: 22px; background: rgba(0,229,138,.12); box-shadow: none; }
.lib-dot.list svg { width: 12px; height: 12px; color: var(--green); }
.lib-main { flex: 1 1 auto; min-width: 0; }
.lib-name {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 13px; font-weight: 650; color: var(--text);
}
.lib-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.lib-acts { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.lib-acts .lib-del:hover { color: var(--red); background: rgba(251,113,133,.12); }
.lib-edit {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 13px 12px 34px; border-bottom: 1px solid var(--line);
  background: rgba(0,229,138,.04); animation: fade .16s ease;
}
.lib-edit .input { flex: 1 1 180px; height: 36px; font-size: 12.5px; }
.lib-empty {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 26px 18px; text-align: center; color: var(--faint);
}
.lib-empty svg { width: 22px; height: 22px; color: var(--faint); opacity: .7; }
.lib-empty b { font-size: 13px; color: var(--text-2); }
.lib-empty span { font-size: 11.5px; max-width: 300px; line-height: 1.45; }
.lib-note {
  display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px;
  padding: 10px 12px; border-radius: 12px; font-size: 12px; line-height: 1.45;
  color: var(--text-2); background: rgba(96,165,250,.08); border: 1px solid rgba(96,165,250,.22);
}
.lib-note svg { width: 15px; height: 15px; color: var(--blue); flex: 0 0 15px; margin-top: 1px; }

@media (max-width: 720px) {
  .seg-line { flex-direction: column; align-items: stretch; gap: 5px; }
  .seg-cap { min-width: 0; }
  .seg-top { gap: 6px; }
  .seg-top .btn { width: 100%; justify-content: center; }
  .lib-row { flex-wrap: wrap; }
  .lib-acts { width: 100%; justify-content: flex-end; }
  .lib-edit { padding-left: 13px; }
  .lib-new { gap: 7px; }
  .lib-new #lib-add { width: 100%; justify-content: center; }
}

/* contagem por item dentro do dropdown de tags/listas */
.dd-item .dd-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-item .dd-count {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 700; color: var(--faint);
  padding: 1px 6px; border-radius: 99px; background: rgba(255,255,255,.06);
}

/* ==========================================================================
   Automações — escolha do tipo (robô x template) e editor de template
   ========================================================================== */
.au-acts { display: grid; gap: 8px; }
.au-act {
  display: grid; grid-template-columns: 28px minmax(0,1fr) minmax(0,1.15fr) 32px;
  gap: 8px; align-items: center;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,.02);
}
.au-act.off { opacity: .55; }
.au-act .au-check { display: grid; place-items: center; }
.au-act .au-check input { width: 17px; height: 17px; accent-color: #00e58a; cursor: pointer; margin: 0; }
.au-act select { height: 36px; font-size: 12.5px; }
.au-act-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 8px; }
@media (max-width: 640px) {
  .au-act { grid-template-columns: 26px minmax(0,1fr) 32px; }
  .au-act select[data-target] { grid-column: 2/3; }
}

.au-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 620px) { .au-pick { grid-template-columns: 1fr; } }
.au-pick-opt {
  display: flex; flex-direction: column; gap: 9px; text-align: left;
  padding: 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font: inherit;
  cursor: pointer; transition: .14s;
}
.au-pick-opt:hover { border-color: var(--green); background: rgba(0,229,138,.06); transform: translateY(-1px); }
.au-pick-opt .ic {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(56,189,248,.09); border: 1px solid rgba(56,189,248,.22); color: var(--cyan);
}
.au-pick-opt.tpl .ic { background: rgba(167,139,250,.1); border-color: rgba(167,139,250,.26); color: var(--violet); }
.au-pick-opt .ic svg { width: 19px; height: 19px; }
.au-pick-opt b { font-size: 13.5px; font-weight: 650; color: var(--text); }
.au-pick-opt small { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.au-pick-opt .tagline { margin-top: auto; font-size: 11px; color: var(--faint); }

.au-var {
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px;
  background: rgba(255,255,255,.02); display: grid; gap: 7px;
}
.au-var-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.au-var-head .mono { font-size: 11.5px; color: var(--cyan); }
.au-var-row { display: grid; grid-template-columns: 175px minmax(0,1fr); gap: 8px; align-items: center; }
@media (max-width: 640px) { .au-var-row { grid-template-columns: 1fr; } }
.au-vars { display: grid; gap: 8px; }
.au-varfill { color: var(--green); font-weight: 600; }
.au-varfill.miss { color: var(--amber); font-family: var(--mono); font-weight: 600; }

.au-warn {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--amber); line-height: 1.45;
}

/* filtro da lista de automações: ícone dentro do segmento */
.segmented .seg svg { width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }
.segmented .seg b { font-weight: 700; opacity: .65; margin-left: 3px; }

/* ---- Calendário do Programar ---- */
.cal-body { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.cal-main { min-width: 0; }
.cal-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.cal-month { min-width: 148px; text-align: center; font-size: 14.5px; font-weight: 750; letter-spacing: -.02em; }
.cal-dows { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.cal-dows span { text-align: center; font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-day {
  position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 86px;
  padding: 6px 6px 5px; text-align: left; cursor: pointer; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2);
  color: var(--text); transition: border-color .15s, background .15s;
}
.cal-day:hover { border-color: rgba(0, 229, 138, .45); }
.cal-day.other { opacity: .38; }
.cal-day.sel { border-color: var(--green); background: rgba(0, 229, 138, .07); box-shadow: inset 0 0 0 1px var(--green); }
.cal-num { width: 21px; height: 21px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 750; }
.cal-day.today .cal-num { background: var(--green); color: #032015; }
.cal-chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-chip {
  display: block; max-width: 100%; padding: 2px 5px; border-radius: 6px; font-size: 9.5px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid transparent;
}
.cal-chip.program { color: var(--green); background: rgba(0, 229, 138, .1); border-color: rgba(0, 229, 138, .22); }
.cal-chip.broadcast { color: var(--blue); background: rgba(96, 165, 250, .12); border-color: rgba(96, 165, 250, .25); }
.cal-chip.run { color: var(--muted); background: rgba(127, 156, 141, .12); border-color: var(--line); }
.cal-chip.run.bad { color: var(--red); background: rgba(251, 113, 133, .12); border-color: rgba(251, 113, 133, .28); }
.cal-more { padding-left: 5px; font-size: 9px; color: var(--faint); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 11px; color: var(--muted); }
.cal-legend span { display: flex; align-items: center; gap: 6px; }
.cal-dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }
.cal-dot.program { background: var(--green); }
.cal-dot.broadcast { background: var(--blue); }
.cal-dot.run { background: var(--muted); }
.cal-error { display: flex; align-items: center; gap: 8px; padding: 18px; font-size: 12.5px; color: var(--red); }

.cal-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); }
.cal-side-head { display: flex; align-items: flex-start; gap: 10px; }
.cal-side-day { font-size: 13px; font-weight: 750; letter-spacing: -.01em; }
.cal-side-head > .badge { margin-left: auto; flex: 0 0 auto; }
.cal-list { display: flex; flex-direction: column; gap: 7px; max-height: 50vh; overflow: auto; }
.cal-item {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 9px;
  width: 100%; padding: 8px 9px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--text); transition: .15s;
}
.cal-item:hover { border-color: rgba(0, 229, 138, .45); }
.cal-item.program { border-left: 3px solid var(--green); }
.cal-item.broadcast { border-left: 3px solid var(--blue); }
.cal-item.run { border-left: 3px solid var(--muted); }
.cal-item.run.bad { border-left-color: var(--red); }
.cal-item-time { font-size: 12px; font-weight: 750; color: var(--green); font-variant-numeric: tabular-nums; }
.cal-item.run .cal-item-time { color: var(--muted); }
.cal-item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-item-title { font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item-sub { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.cal-item-stat { font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }
.cal-blank { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 10px; color: var(--faint); font-size: 12px; text-align: center; }
.cal-blank svg { width: 20px; height: 20px; }
.cal-cta { display: flex; flex-direction: column; gap: 7px; padding-top: 11px; border-top: 1px solid var(--line); }
.cal-note { display: flex; gap: 7px; align-items: flex-start; padding-top: 11px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.cal-note svg { width: 13px; height: 13px; flex: 0 0 13px; margin-top: 1px; }

@media (max-width: 980px) {
  .cal-body { grid-template-columns: minmax(0, 1fr); }
  .cal-side { position: static; }
  .cal-list { max-height: none; }
}
@media (max-width: 700px) {
  .cal-day { min-height: 58px; padding: 4px; border-radius: 10px; }
  .cal-chip { font-size: 8.5px; padding: 1px 3px; }
  .cal-more { font-size: 9px; }
  .cal-num { font-size: 10.5px; }
  .cal-month { min-width: 0; font-size: 13px; }
}

/* ==========================================================================
   Inbox — respostas prontas, composer maior e dropdowns do painel (2026-11-18)
   ========================================================================== */
.composer-wrap { position: relative; border-top: 1px solid var(--line); }
.composer-wrap .composer { border-top: 0; }
.composer #ch-input {
  min-height: 78px; max-height: 170px; resize: none;
  line-height: 1.5; padding: 10px 12px;
}
.qr-trigger.on {
  color: var(--green);
  background: rgba(0, 229, 138, .12);
  border-color: rgba(0, 229, 138, .4);
}
.qr-pop {
  position: absolute; left: 16px; right: 16px; bottom: calc(100% + 8px);
  z-index: 60; background: var(--panel-solid, #0b120e);
  border: 1px solid var(--line-strong, var(--line)); border-radius: 16px;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .85);
  overflow: hidden; animation: qrIn .14s ease;
}
@keyframes qrIn { from { opacity: 0; transform: translateY(6px); } }
.qr-pop[hidden] { display: none; }
.qr-pop-head { display: flex; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); }
.qr-search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 0 10px; height: 36px;
}
.qr-search svg { width: 14px; height: 14px; color: var(--faint); flex: 0 0 14px; }
.qr-search input {
  flex: 1; min-width: 0; background: none; border: 0; outline: none;
  color: var(--text); font: inherit; font-size: 13px;
}
.qr-list { max-height: min(320px, 42vh); overflow-y: auto; padding: 6px; }
.qr-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 10px; cursor: pointer; border: 1px solid transparent;
}
.qr-item:hover, .qr-item.hovered {
  background: rgba(0, 229, 138, .07); border-color: rgba(0, 229, 138, .25);
}
.qr-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qr-item-main b { font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-item-main > span { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-ins {
  background: none; border: 0; color: var(--faint); cursor: pointer;
  padding: 4px; border-radius: 7px; display: grid; place-items: center;
}
.qr-ins:hover { color: var(--green); background: rgba(0, 229, 138, .12); }
.qr-ins svg { width: 14px; height: 14px; }
.qr-item-send { color: var(--green); display: grid; place-items: center; opacity: .75; }
.qr-item-send svg { width: 15px; height: 15px; }
.qr-empty { padding: 22px 14px; text-align: center; color: var(--faint); font-size: 12px; line-height: 1.5; }
.qr-foot {
  padding: 6px 10px 8px; border-top: 1px solid var(--line);
  font-size: 10.5px; color: var(--faint); display: flex; align-items: center; gap: 5px;
}
.qr-foot svg { width: 11px; height: 11px; }

/* painel do contato: tags/listas em dropdown com check */
.cp-dd .dd-btn { height: 38px; font-size: 12.5px; }
.cp-dd .dd-menu.floating { min-width: 250px; max-height: min(320px, 60vh); }
.cp-dd .dd-item.locked { opacity: .6; }
.cp-dd .dd-lock { display: inline-flex; color: var(--faint); }
.cp-dd .dd-lock svg { width: 12px; height: 12px; }

/* colaboradores: cartão de resposta pronta */
.qr-card .qr-body {
  font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; white-space: pre-wrap;
}

@media (max-width: 720px) {
  .qr-pop { left: 8px; right: 8px; }
  .qr-list { max-height: 38vh; }
}

/* ==========================================================================
   Respostas prontas com elementos (texto/imagem/vídeo/áudio) — 2026-11-19
   ========================================================================== */
.qr-kind {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: .01em;
  color: var(--muted); background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px;
  white-space: nowrap;
}
.qr-kind svg { width: 11px; height: 11px; }
.qr-item-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.qr-item-title b { min-width: 0; }
.qr-kinds { display: inline-flex; gap: 4px; flex: 0 0 auto; }

.qr-edit-list { display: flex; flex-direction: column; gap: 8px; }
.qr-edit-item {
  display: flex; gap: 10px; align-items: stretch;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); padding: 9px 10px;
  transition: border-color .12s ease, opacity .12s ease;
}
.qr-edit-item.dragging { opacity: .5; border-color: var(--green); }
.qr-edit-item.over { border-top-color: var(--green); border-top-width: 2px; }
.qr-edit-handle {
  display: grid; place-items: center; width: 22px; flex: 0 0 22px;
  color: var(--faint); cursor: grab; border-radius: 7px;
}
.qr-edit-handle:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.qr-edit-handle:active { cursor: grabbing; }
.qr-edit-handle svg { width: 16px; height: 16px; }
.qr-edit-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.qr-edit-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qr-edit-type {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 650; color: var(--cyan);
  text-transform: uppercase; letter-spacing: .04em;
}
.qr-edit-type svg { width: 13px; height: 13px; }
.qr-edit-actions { display: flex; align-items: center; gap: 2px; }
.qr-edit-actions .btn { padding: 4px; }
.qr-edit-actions [data-move="up"] svg { transform: rotate(180deg); }
.qr-edit-actions svg { width: 14px; height: 14px; }
.qr-edit-body .textarea { width: 100%; min-height: 56px; font-size: 13px; }

.qr-edit-media { display: flex; align-items: stretch; gap: 10px; min-height: 54px; }
.qr-media-pick {
  width: 100%; display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  border: 1px dashed var(--line-strong, var(--line)); border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer;
  padding: 12px 14px; font: inherit; font-size: 12.5px; text-align: left;
}
.qr-media-pick:hover { border-color: var(--green); color: var(--text); background: rgba(0, 229, 138, .05); }
.qr-media-pick svg { width: 15px; height: 15px; flex: 0 0 15px; }
.qr-media-pick small { color: var(--faint); font-size: 11px; flex: 1 0 100%; }
.qr-media-preview {
  flex: 0 0 auto; width: 108px; height: 74px; border-radius: 9px; overflow: hidden;
  background: #000; display: grid; place-items: center;
}
.qr-media-preview img, .qr-media-preview video { width: 100%; height: 100%; object-fit: cover; }
.qr-media-preview audio { width: 210px; height: 38px; }
.qr-edit-media[data-kind="audio"] .qr-media-preview { width: auto; background: transparent; }
.qr-media-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 7px; }
.qr-media-name { font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-media-busy { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.qr-media-busy svg { width: 15px; height: 15px; animation: qrSpin 1s linear infinite; }
@keyframes qrSpin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .qr-edit-media { flex-direction: column; }
  .qr-media-preview { width: 100%; height: 150px; }
  .qr-media-preview audio { width: 100%; }
}

/* ---- Programar: envios agendados (avulsos da tela Envios) ---- */
.sx-agendados { margin-bottom: 18px; }
.sx-sched-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.sx-sched-head > div { min-width: 0; }
.sx-sched-head .card-title { display: flex; align-items: center; gap: 7px; }
.sx-sched-head .card-title svg { width: 15px; height: 15px; color: var(--blue); }
.sx-sched-head .hint { margin-top: 3px; }
.sx-sched-head > .btn { margin-left: auto; flex: 0 0 auto; }

/* ==========================================================================
   Inbox no celular — nada que chega pode passar da tela + composer livre da
   barra inferior (2026-11-21)
   ========================================================================== */

/* 1. contenção: o chat é uma coluna que PODE encolher. Sem min-width:0 o
      min-content de uma mensagem larga empurra a coluna e a conversa inteira
      passa da borda direita do celular. */
.chat, .chat-head, .chat-head-main, .msgs, .composer-wrap, .composer, .convos { min-width: 0; }
.msgs { overflow-x: hidden; }
.chat-head-name, .chat-head-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 2. bolhas de texto: URL/token sem espaço quebra DENTRO da bolha em vez de
      vazar para fora dela (era o que estourava a margem direita) */
.msg { overflow-wrap: anywhere; }
.msg-caption, .msg > div { overflow-wrap: anywhere; word-break: break-word; }

/* 3. mídia: imagem/vídeo/áudio/documento nunca maiores que a bolha */
.msg-media { max-width: min(260px, 100%); }
.msg-media img, .msg-media video { max-width: 100%; height: auto; }
.msg-file, .msg-audio, .msg-lost { max-width: 100%; }
.msg-audio audio { width: 230px; max-width: 100%; }
.msg-file span { min-width: 0; }

/* 4. visualizador em tela cheia: 96vw + 24px de padding passava da tela */
.lb { padding: 12px; }
.lb img, .lb video { max-width: calc(100vw - 24px); max-height: 92vh; }

@media (max-width: 820px) {
  /* conversa entre a topbar e a barra inferior, com respiro menor nas laterais
     para sobrar largura útil para a bolha */
  .msgs { padding: 14px 10px 10px; }
  .chat-head { padding: 10px 10px; gap: 6px; min-height: 56px; }
  .chat-head .btn-icon { width: 34px; height: 34px; }
  .composer { padding: 8px 10px 10px; gap: 6px; }
  .composer #ch-input { min-height: 46px; }
  .msg { max-width: 88%; }
  .msg-media { max-width: 100%; }
  .window-note { margin: 10px 10px 0; }
  .msgs-day { max-width: 100%; }
}

/* ----------------------------- bloqueio de contato (Inbox) */
/* Ícone de bloqueado na lista de conversas (o avatar saiu da lista). */
.convo-block { display: inline-flex; align-items: center; color: var(--red); flex: 0 0 auto; }
.convo-block svg { width: 13px; height: 13px; }
.convo.blocked .convo-name { color: var(--muted); }
/* Aviso no lugar do campo de mensagem quando o contato está bloqueado. */
.chat-blocked {
  display: flex; align-items: center; gap: 9px; padding: 14px 16px;
  border-top: 1px solid var(--line); background: var(--panel);
  font-size: 12px; color: var(--muted);
}
.chat-blocked svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--red); }
.chat-blocked a { color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
/* Chave do bloqueio no painel: ligada, fica vermelha (não é "sucesso"). */
.switch.danger.on { background: var(--red); box-shadow: 0 0 18px -4px var(--red); }
.switch.danger.on::after { background: #2a0a12; }
.cp-blocksec .cp-ai-txt b { color: var(--text); }

/* ---- seção "Em andamento" da lista de envios ---- */
.bc-sec {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin: 22px 0 12px;
}
.bc-sec:first-of-type { margin-top: 0; }
.bc-sec-title {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}
.bc-sec-title b { color: var(--text); font-weight: 750; }
