/* Lesender — paleta inspirada no Meta Ads Manager */
:root {
  --blue: #0866ff;
  --blue-hover: #0a5ae0;
  --blue-press: #004ccf;
  --blue-50: #ebf3ff;
  --blue-100: #d6e6ff;
  --blue-200: #aecdff;
  --navy: #1c2b33;
  --navy-2: #283943;
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --border: #dadde1;
  --border-2: #e4e6eb;
  --text: #1c2b33;
  --text-2: #465a69;
  --muted: #67788a;
  --green: #31a24c;
  --green-50: #e6f6ea;
  --orange: #f7b928;
  --orange-50: #fef5e0;
  --red: #e41e3f;
  --red-50: #fde8ec;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.18), 0 2px 4px rgba(0, 0, 0, 0.08);
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;

  /* tintas de status (texto sobre os fundos -50) */
  --green-ink: #1e7b34;
  --orange-ink: #9a6a00;
  --red-ink: #b3122e;
  --blue-ink: #2f5fc4;
  --purple: #7c3aed;
  --purple-ink: #6d28d9;
  --purple-50: #f5f3ff;
  --purple-100: #ede9fe;
  --purple-200: #c4b5fd;
  --red-100: #f5c2cc;
  --orange-100: #f3dfa8;
  /* superfícies fortes (botão "AA", etiqueta caixa alta) e avisos flutuantes */
  --strong-bg: #1c2b33;
  --strong-fg: #ffffff;
  --toast-bg: #1c2b33;
  --chip-mix-ink: #000000;
  --target-line: #8aa4c8;
  /* balão do WhatsApp */
  --wa-bg: #efeae2;
  --wa-bubble: #d9fdd3;
  --wa-link: #d1f4cc;
  --wa-ink: #111b21;
  --wa-ink-2: #4a5b63;
  --wa-time: #667781;
  --wa-anchor: #027eb5;
  color-scheme: light;
}

/* ---------- Tema escuro ---------- */
:root[data-theme="dark"] {
  --blue: #2d88ff;
  --blue-hover: #4596ff;
  --blue-press: #1877f2;
  --blue-50: #1b2a44;
  --blue-100: #22375c;
  --blue-200: #35558c;
  --bg: #18191a;
  --surface: #242526;
  --surface-2: #2c2d2f;
  --border: #3e4042;
  --border-2: #343538;
  --text: #e4e6eb;
  --text-2: #b8bbc0;
  --muted: #8e9196;
  --green-50: #183224;
  --orange-50: #372c12;
  --red-50: #3b1a21;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.55), 0 2px 4px rgba(0, 0, 0, 0.4);

  --green-ink: #6fd389;
  --orange-ink: #f2c14e;
  --red-ink: #ff8a9b;
  --blue-ink: #8db4ff;
  --purple: #a78bfa;
  --purple-ink: #c4a6ff;
  --purple-50: #261f3b;
  --purple-100: #352b55;
  --purple-200: #5b4a8f;
  --red-100: #5a2630;
  --orange-100: #4f4120;
  --strong-bg: #e4e6eb;
  --strong-fg: #18191a;
  --toast-bg: #3a3b3c;
  --chip-mix-ink: #ffffff;
  --target-line: #5f7aa3;

  --wa-bg: #0b141a;
  --wa-bubble: #005c4b;
  --wa-link: #025144;
  --wa-ink: #e9edef;
  --wa-ink-2: #c3cbd0;
  --wa-time: #a6c3bc;
  --wa-anchor: #53bdeb;
  color-scheme: dark;
}
:root[data-theme="dark"] .wa-bg { background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px); }
:root[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, 0.65); }
:root[data-theme="dark"] .backdrop.show { background: rgba(0, 0, 0, 0.6); }
:root[data-theme="dark"] .skeleton { background: linear-gradient(90deg, var(--border-2), var(--surface-2), var(--border-2)); background-size: 200% 100%; }
:root[data-theme="dark"] .sw .sw-ui::after { background: #e4e6eb; }
:root[data-theme="dark"] img.disp-thumb, :root[data-theme="dark"] .wa-img, :root[data-theme="dark"] .wa-photo { background: #ffffff; } /* fotos de produto com fundo branco */

/* botão de tema no topo */
.theme-btn .ico { width: 20px; height: 20px; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

.ico { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border-2);
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  height: var(--topbar-h); padding: 0 20px;
  font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.3px;
  border-bottom: 1px solid var(--border-2);
}
.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; cursor: pointer;
}
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--blue-50); color: var(--blue); }
.nav a.disabled { opacity: 0.45; cursor: not-allowed; }
.nav a.disabled:hover { background: none; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); padding: 16px 12px 6px; font-weight: 600; }
.sidebar-foot {
  padding: 14px 20px; border-top: 1px solid var(--border-2);
  font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.live-dot.on { background: var(--green); }
.live-dot.off { background: var(--red); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 30;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.crumbs:empty { display: none; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--blue); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.content { padding: 24px 28px 40px; max-width: 1440px; width: 100%; }

.backdrop { display: none; }
.only-mobile { display: none !important; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-primary:active { background: var(--blue-press); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(0.93); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.loading { pointer-events: none; opacity: 0.7; }
.btn.loading .ico { animation: spin 0.9s linear infinite; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn.blue { color: var(--blue); }
.icon-btn.blue:hover { background: var(--blue-50); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards e painéis ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { display: flex; flex-direction: column; min-height: 0; }
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 12px;
}
.panel-head h2 { font-size: 17px; flex: 1; }
.panel-head h2 small { color: var(--muted); font-weight: 400; font-size: 15px; margin-left: 4px; }
.panel-body { padding: 0 18px 18px; }
.panel-scroll { max-height: 520px; overflow-y: auto; }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.kpi-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--blue-50); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.kpi-icon .ico { width: 24px; height: 24px; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.kpi-value small { font-size: 14px; color: var(--muted); font-weight: 500; }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 13px; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  height: 38px; padding: 0 12px; width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 70px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }
.search { position: relative; }
.search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search .input { padding-left: 36px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { flex: 1; min-width: 200px; max-width: 420px; }
.toolbar .spacer { flex: 1; }

.chip-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.chip-toggle button { border: none; background: none; padding: 0 12px; height: 36px; cursor: pointer; font-weight: 500; color: var(--text-2); }
.chip-toggle button.on { background: var(--blue-50); color: var(--blue); }

/* ---------- Avatares e badges ---------- */
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--blue-50); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0; font-weight: 700; font-size: 17px;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.sm { width: 40px; height: 40px; font-size: 15px; }
.avatar .status {
  position: absolute; right: -1px; bottom: -1px;
  width: 15px; height: 15px; border-radius: 50%;
  border: 2.5px solid var(--surface); background: var(--muted);
}
.status.connected { background: var(--green); }
.status.qr, .status.connecting { background: var(--orange); }
.status.disconnected { background: var(--red); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 11px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--bg); color: var(--text-2);
}
.badge .ico { width: 14px; height: 14px; }
.badge.green { background: var(--green-50); color: var(--green-ink); }
.badge.orange { background: var(--orange-50); color: var(--orange-ink); }
.badge.red { background: var(--red-50); color: var(--red-ink); }
.badge.blue { background: var(--blue-50); color: var(--blue); }

/* ---------- Itens de lista (contas/campanhas) ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border-2); border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.12s, box-shadow 0.12s;
}
a.item, .item.clickable { cursor: pointer; color: inherit; }
a.item:hover, .item.clickable:hover { border-color: var(--blue-200); box-shadow: 0 2px 8px rgba(8, 102, 255, 0.08); }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-actions { display: flex; align-items: center; gap: 2px; }
.item-arrow { color: var(--blue); }

.camp-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.camp-stats span { display: inline-flex; align-items: center; gap: 4px; }
.camp-stats .ico { width: 16px; height: 16px; color: var(--blue); }

/* Card de conta (página Contas) */
.acc-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.acc-head { display: flex; gap: 14px; align-items: center; }
.acc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acc-meta div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 12px; }
.acc-meta b { display: block; font-size: 18px; }
.acc-meta span { font-size: 12px; color: var(--muted); }
.acc-foot { display: flex; gap: 8px; flex-wrap: wrap; }
.acc-foot .btn { flex: 1; }
.acc-error { font-size: 12px; color: var(--red); background: var(--red-50); padding: 8px 10px; border-radius: var(--radius-sm); }

/* ---------- Linhas de grupos (estilo da campanha) ---------- */
.rows { padding: 0; overflow: hidden; }
.row {
  display: grid;
  grid-template-columns: 28px 52px minmax(200px, 2.2fr) repeat(3, minmax(90px, 0.8fr)) minmax(150px, 1.2fr) 110px 36px;
  align-items: center; gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-2);
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--surface-2); }
.row.head { background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 10px; padding-bottom: 10px; text-transform: uppercase; letter-spacing: 0.4px; }
.row.head:hover { background: var(--surface-2); }
.row .name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .name-sub { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.metric small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.metric b { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; }
.metric b .ico { width: 18px; height: 18px; color: var(--text-2); }
.metric b em { font-style: normal; font-size: 13px; color: var(--muted); font-weight: 500; }
.row .meta { font-size: 12px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.row .meta span { display: inline-flex; gap: 6px; align-items: center; }
.row .meta .ico { width: 16px; height: 16px; color: var(--muted); }
.link-btn { background: none; border: none; color: var(--blue); cursor: pointer; padding: 0; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.link-btn .ico { width: 16px; height: 16px; color: var(--blue) !important; }
.link-btn:hover { text-decoration: underline; }
.mini-label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 2px; }
@media (min-width: 861px) {
  .rows .metric small, .rows .mini-label { display: none; }
}
.avatar img { opacity: 0; transition: opacity 0.15s; }
.avatar img.ok { opacity: 1; }
.select.sm { height: 34px; padding: 0 8px; }
.bar { height: 4px; background: var(--border-2); border-radius: 2px; overflow: hidden; margin-top: 6px; width: 100%; max-width: 120px; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: 2px; }
.bar i.warn { background: var(--orange); }
.bar i.full { background: var(--red); }
.checkbox { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }

/* Cabeçalho da campanha */
.camp-hero { padding: 20px 22px; margin-bottom: 16px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.camp-hero .info { flex: 1; min-width: 220px; }
.camp-hero h2 { font-size: 20px; }
.camp-hero p { margin: 4px 0 0; color: var(--muted); }
.camp-hero .stats { display: flex; gap: 28px; flex-wrap: wrap; }
.stat small { display: block; font-size: 12px; color: var(--muted); }
.stat b { font-size: 22px; }

.bulkbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--radius); margin-bottom: 12px;
  font-weight: 600; color: var(--blue);
}
.bulkbar .spacer { flex: 1; }

/* ---------- Estados vazios ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty > .ico { width: 48px; height: 48px; color: var(--blue-200); margin-bottom: 8px; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 4px; }
.empty p { margin: 0 0 16px; }
.skeleton { background: linear-gradient(90deg, var(--border-2), var(--surface-2), var(--border-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); height: 72px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Modal ---------- */
.modal-root:empty { display: none; }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(28, 43, 51, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100;
  animation: fade 0.15s ease;
}
.modal {
  background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; animation: pop 0.18s ease;
}
.modal.lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border-2); }
.modal-head h3 { flex: 1; font-size: 17px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border-2); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } }

.qr-box { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.qr-frame {
  width: 280px; height: 280px; border-radius: 12px; border: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: center; background: #fff; padding: 10px;
}
.qr-frame img { width: 100%; height: 100%; }
.qr-steps { text-align: left; color: var(--text-2); font-size: 13px; padding-left: 18px; margin: 0; line-height: 1.7; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--blue-100); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; }
.success-ring { width: 72px; height: 72px; border-radius: 50%; background: var(--green-50); color: var(--green); display: flex; align-items: center; justify-content: center; }
.success-ring .ico { width: 40px; height: 40px; }

/* Seletor de grupos */
.picker-list { border: 1px solid var(--border-2); border-radius: var(--radius); max-height: 380px; overflow-y: auto; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border-2); cursor: pointer; }
.pick:last-child { border-bottom: none; }
.pick:hover { background: var(--surface-2); }
.pick.on { background: var(--blue-50); }
.pick .item-main { min-width: 0; }
.picker-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.picker-head .search { flex: 1; min-width: 180px; }
.picker-count { font-size: 13px; color: var(--muted); margin-left: auto; }
.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--border-2); }
.steps span.on { background: var(--blue); }

/* Menu suspenso */
.dropdown { position: fixed; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; z-index: 120; border: 1px solid var(--border-2); }
.dropdown button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: none; background: none; border-radius: 6px; cursor: pointer; text-align: left; }
.dropdown button:hover { background: var(--bg); }
.dropdown button.danger { color: var(--red); }
.dropdown .ico { width: 18px; height: 18px; }

/* Toasts */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--toast-bg); color: #fff; padding: 12px 16px; border-radius: 8px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; animation: pop 0.2s ease; font-weight: 500; }
.toast.error { background: var(--red); }
.toast.success .ico { color: #6ee58b; }

/* ---------- Disparos ---------- */
.nav a.nav-cta { background: var(--blue); color: #fff; margin: 6px 0; }
.nav-wait { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--orange-50); color: var(--orange-ink); font-size: 12px; font-weight: 700; }
.nav-wait[hidden] { display: none; }
.hourglass { display: inline-block; font-size: 12px; animation: hourglass 2.4s ease-in-out infinite; }
@keyframes hourglass { 0%, 40% { transform: rotate(0); } 50%, 90% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hourglass { animation: none; } }
.nav a.nav-cta:hover { background: var(--blue-hover); }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; }
.btn-danger-outline { color: var(--red); }
.btn-danger-outline:hover { background: var(--red-50); }

.compose { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr); gap: 16px; align-items: start; }
.compose-main, .compose-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.compose-side { position: sticky; top: calc(var(--topbar-h) + 16px); }
.csec { padding: 18px; }
.csec h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.csec h3 .ico { color: var(--blue); }
.csec h3 small { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: auto; }
.step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }

.acc-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.acc-pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); cursor: pointer; min-width: 0; }
.acc-pick:hover { border-color: var(--blue-200); }
.acc-pick.on { border-color: var(--blue); background: var(--blue-50); }
.acc-pick.dim { opacity: 0.6; }

.editor-tools { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.editor-tools .spacer { flex: 1; }
.editor-tools .btn { font-family: var(--font); min-width: 34px; }
.spin-info { font-size: 13px; color: var(--muted); }
.spin-info b { color: var(--blue); }
.spin-info.warn b { color: var(--orange-ink); }
.textarea.msg { min-height: 260px; font-size: 14px; line-height: 1.5; font-family: var(--font); }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.range-in { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.range-in .input { width: 90px; }
.chip-toggle button { display: inline-flex; align-items: center; gap: 6px; }
.chip-toggle button .ico { width: 16px; height: 16px; }

/* Balão estilo WhatsApp */
.wa-card { overflow: hidden; }
.wa-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border-2); font-weight: 600; }
.wa-bg {
  background-color: var(--wa-bg);
  background-image: radial-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 14px 14px;
  padding: 18px 16px; min-height: 220px; display: flex; justify-content: flex-end;
}
.wa-bubble {
  background: var(--wa-bubble); border-radius: 8px 0 8px 8px; padding: 4px; max-width: 360px; width: 100%;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13); font-family: 'Segoe UI', Helvetica, Arial, sans-serif; color: var(--wa-ink); position: relative;
}
.wa-link { background: var(--wa-link); border-radius: 6px; overflow: hidden; margin-bottom: 2px; }
.wa-img { aspect-ratio: 1 / 1; width: 100%; background: #fff; }
.wa-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.wa-link-meta { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.wa-link-meta b { font-size: 14px; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wa-link-meta span { font-size: 12.5px; color: var(--wa-ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wa-link-meta small { font-size: 12px; color: var(--wa-time); }
.wa-text { padding: 4px 6px 2px; font-size: 14.2px; line-height: 1.38; white-space: pre-wrap; word-wrap: break-word; }
.wa-text a { color: var(--wa-anchor); }
.wa-text code { background: rgba(0, 0, 0, 0.06); }
.wa-time { text-align: right; font-size: 11px; color: var(--wa-time); padding: 0 6px 2px; display: flex; justify-content: flex-end; gap: 3px; align-items: center; }
.pv-tools { padding: 12px 14px; }
.wa-photo { border-radius: 6px; overflow: hidden; margin-bottom: 2px; background: #fff; }
.wa-photo img { width: 100%; display: block; max-height: 420px; object-fit: cover; }
.attach { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 10px; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.attach label.btn { cursor: pointer; }
.attach-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-2); }
.attach-info { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.upd-bar { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; align-items: center; gap: 10px; background: var(--toast-bg); color: #fff; padding: 8px 10px 8px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 13.5px; max-width: calc(100vw - 24px); }
.upd-bar .ico { width: 18px; height: 18px; color: #7cb3ff; }
/* Spintax no balão: {versão 1 | versão 2 | versão 3} */
.sg { background: rgba(124, 58, 237, 0.08); border-radius: 5px; padding: 1px 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.sb { color: var(--purple); font-weight: 800; }
.ss { color: var(--purple); font-weight: 800; margin: 0 3px; }
.so { border-bottom: 1px dashed rgba(124, 58, 237, 0.45); }
.sc { color: var(--purple-ink); font-weight: 700; font-size: 10px; margin-left: 2px; background: var(--purple-100); border-radius: 6px; padding: 0 4px; }
.chip-toggle.sm button { height: 28px; padding: 0 10px; font-size: 12.5px; }
.pv-tools:empty { display: none; }
.pv-tools label.btn { cursor: pointer; }
.pv-hint { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); }
.pv-hint .ico { color: var(--blue); width: 18px; height: 18px; }

.dist-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 34px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.dist-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-row b { text-align: right; }
.dist-bar { height: 6px; background: var(--border-2); border-radius: 3px; overflow: hidden; }
.dist-bar i { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.dist-warn { margin-top: 10px; background: var(--orange-50); color: var(--orange-ink); border-radius: var(--radius-sm); font-size: 13px; }
.dist-warn summary { padding: 10px; cursor: pointer; display: flex; gap: 6px; align-items: center; }
.dist-warn .ico { width: 18px; height: 18px; flex-shrink: 0; }
.dist-warn ul { margin: 0; padding: 0 12px 6px 32px; }
.dist-warn .hint { display: block; padding: 0 12px 10px; }
div.dist-warn { display: flex; gap: 6px; align-items: flex-start; }
.confirm-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Lista e monitor */
.disp-item { align-items: flex-start; }
.disp-thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--border-2); flex-shrink: 0; }
.disp-thumb.ph { display: flex; align-items: center; justify-content: center; color: var(--blue); background: var(--blue-50); border: none; }
.progress { height: 6px; background: var(--border-2); border-radius: 3px; overflow: hidden; display: flex; margin-top: 10px; max-width: 520px; }
.progress i { display: block; height: 100%; transition: width 0.3s; }
.p-sent { background: var(--green); }
.p-failed { background: var(--red); }
.progress-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.cchips { display: flex; gap: 6px; flex-wrap: wrap; }
.cchip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 14px; background: var(--bg); font-size: 13px; color: var(--text-2); }
.cchip .ico { width: 16px; height: 16px; }
.cchip.c-pending { background: var(--orange-50); color: var(--orange-ink); }
.cchip.c-sending { background: var(--blue-50); color: var(--blue); }
.cchip.c-sent { background: var(--green-50); color: var(--green-ink); }
.cchip.c-failed { background: var(--red-50); color: var(--red-ink); }

.monitor { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 16px; align-items: start; }
.mon-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; margin-top: 16px; font-size: 13px; color: var(--text-2); }
.info-grid > span { display: flex; align-items: center; gap: 8px; }
.info-grid .ico { width: 18px; height: 18px; color: var(--muted); }
.acc-mon { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.acc-mon-item { border: 1px solid var(--border-2); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.acc-mon-head { display: flex; gap: 10px; align-items: center; }
.acc-mon-item .item-sub { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.countdown { font-size: 12px; color: var(--muted); }

.jobs { border: 1px solid var(--border-2); border-radius: var(--radius); max-height: 520px; overflow-y: auto; }
.job { border-bottom: 1px solid var(--border-2); padding: 10px 14px; cursor: pointer; }
.job:last-child { border-bottom: none; }
.job:hover { background: var(--surface-2); }
.job-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 160px 70px; gap: 12px; align-items: center; font-size: 13px; }
.job-row .badge { justify-self: start; }
.job-group { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-acc { display: flex; gap: 4px; align-items: center; color: var(--muted); overflow: hidden; white-space: nowrap; }
.job-acc .ico { width: 15px; height: 15px; }
.job-time { color: var(--muted); text-align: right; }
.job-err { font-size: 12px; color: var(--red); margin-top: 4px; }
.job-text { margin-top: 8px; background: var(--wa-bubble); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; font-size: 13px; line-height: 1.4; }

/* ---------- Templates ---------- */
.page-hint { display: flex; gap: 8px; align-items: center; color: var(--text-2); margin: 0 0 16px; font-size: 13px; }
.page-hint .ico { color: var(--blue); flex-shrink: 0; }
.tpl-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.tpl-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.store-badge { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 13px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.store-badge.sm { height: 22px; padding: 0 9px; font-size: 12px; vertical-align: middle; }
.host-list { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.host { font-size: 12px; background: var(--bg); color: var(--text-2); padding: 2px 8px; border-radius: 10px; font-family: Consolas, monospace; }
.det-out { margin-top: 10px; font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.det-out:empty { display: none; }
.det-out .ico { width: 18px; height: 18px; color: var(--blue); }
.tpl-snippet { background: var(--wa-bubble); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.4; white-space: pre-wrap; max-height: 110px; overflow: hidden; color: var(--wa-ink); }

.var-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; padding: 12px; background: var(--surface-2); border-radius: var(--radius); position: sticky; top: calc(var(--topbar-h) + 4px); z-index: 5; border: 1px solid var(--border-2); }
.var-chip, .tok {
  --c: var(--blue);
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--c) 12%, var(--surface));
  color: color-mix(in srgb, var(--c) 80%, var(--chip-mix-ink));
  border-radius: 6px; font-weight: 600; font-size: 12.5px; white-space: nowrap;
}
.var-chip { height: 30px; padding: 0 10px; cursor: pointer; font-family: var(--font); }
.var-chip:hover { background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.tok { padding: 1px 7px; margin: 0 1px; user-select: all; vertical-align: baseline; line-height: 1.5; }

.block { border: 1px solid var(--border-2); border-radius: var(--radius); padding: 10px 12px 8px; margin-bottom: 10px; background: var(--surface); transition: border-color 0.12s; }
.block:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-50); }
.block.spin { border-left: 3px solid var(--blue); }
.block.blank { background: var(--surface-2); padding-top: 6px; padding-bottom: 4px; }
.block-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.block-head .spacer { flex: 1; }
.block-n { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); font-size: 12px; font-weight: 700; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm .ico { width: 18px; height: 18px; }
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.variant { margin-top: 6px; }
.variant-l { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 3px; }
.variant.fallback .tok-input { background: var(--orange-50); }
.tok-input {
  min-height: 38px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  outline: none; white-space: pre-wrap; word-break: break-word; line-height: 1.6; background: var(--surface);
}
.tok-input:focus { border-color: var(--blue); }
.tok-input:empty::before { content: attr(data-ph); color: var(--muted); }
.block-foot { display: flex; gap: 6px; margin-top: 6px; }
.block-foot:empty { display: none; }
.mini-tag { font-size: 11px; color: var(--muted); background: var(--bg); padding: 2px 8px; border-radius: 10px; }
.block-add { display: flex; gap: 8px; flex-wrap: wrap; }
.help-list { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; line-height: 1.6; }

/* Caixa alta ("Aa") */
.block { position: relative; }
.block-head { flex-wrap: wrap; padding-right: 46px; row-gap: 4px; }
.chk.sm { flex-wrap: nowrap; white-space: nowrap; }
.case-btn {
  position: absolute; top: 8px; right: 10px;
  height: 28px; min-width: 38px; padding: 0 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-weight: 700; font-size: 13px; cursor: pointer; font-family: var(--font); letter-spacing: 0.3px;
}
.case-btn:hover { border-color: var(--blue); color: var(--blue); }
.case-btn.on { background: var(--strong-bg); border-color: var(--strong-bg); color: var(--strong-fg); }
.tok-input.upper, .ai-var.upper { text-transform: uppercase; }
.tok-input.upper .tok, .ai-var.upper .tok { text-transform: none; }
.mini-tag.upper { background: var(--strong-bg); color: var(--strong-fg); font-weight: 700; }

/* Login */
body.locked .app { display: none; }
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); }
.auth[hidden] { display: none; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 28px 26px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; margin-bottom: 18px; }
.auth-card h2 { font-size: 20px; margin-bottom: 4px; }
.auth-card > .hint { margin: 0 0 18px; display: block; }
.pass-row { display: flex; gap: 6px; align-items: center; }
.pass-row .input { flex: 1; }
.pw-req { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; }
.pw-req li { color: var(--red-ink); display: flex; align-items: center; gap: 6px; transition: color .15s; }
.pw-req li::before { content: "✕"; font-size: 10px; width: 14px; height: 14px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--red-50); flex: none; }
.pw-req li.ok { color: var(--green-ink); }
.pw-req li.ok::before { content: "✓"; background: var(--green-50); }
.auth-err {background: var(--red-50); color: var(--red-ink); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; margin-bottom: 12px; }
.auth-err[hidden] { display: none; }
.auth-btn { width: 100%; }
.auth-card .chk { flex-wrap: nowrap; align-items: center; font-size: 13.5px; }
.auth-foot { margin: 14px 0 0; font-size: 12px; text-align: center; }
.user-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--border-2); font-size: 13px; }
.user-box:empty { display: none; }
.user-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-name .ico { width: 16px; height: 16px; color: var(--muted); }
.user-box .link-btn .ico { width: 15px; height: 15px; }
.set-sub { font-size: 13.5px; margin: 0 0 10px; }
.user-list { display: flex; flex-direction: column; gap: 6px; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); }
.user-row > span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.user-row .ico { width: 16px; height: 16px; color: var(--muted); }
.user-row small { flex-basis: 100%; color: var(--muted); font-size: 11.5px; padding-left: 22px; }

/* Alertas de segurança */
.net-alert { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 15px; background: var(--red-50); color: var(--red-ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.net-alert:hover { background: var(--red-100); }
.net-alert[hidden] { display: none; }
.net-alert .ico { width: 16px; height: 16px; }
.net-alert b + span { margin-left: -2px; }
.sec-list { display: flex; flex-direction: column; gap: 10px; }
.sec-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border-2); }
.sec-item.account_banned { background: var(--red-50); border-color: var(--red-100); }
.sec-item.account_logged_out, .sec-item.group_lost, .sec-item.group_send_blocked { background: var(--orange-50); border-color: var(--orange-100); }
.sec-ico { font-size: 22px; line-height: 1; }
.sec-item.silent_drop { background: var(--red-50); border-color: var(--red-100); }
.cchip.c-deliv { background: var(--green-50); color: var(--green-ink); font-weight: 700; }
.sec-item b { display: block; margin-bottom: 2px; }
.sec-item p { margin: 0 0 4px; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.sec-item small { color: var(--muted); font-size: 11.5px; }
@media (max-width: 860px) { .net-alert span { display: none; } .net-alert { padding: 0 8px; } }

/* Indicador de frequência */
.freq { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px 0 6px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface); cursor: pointer; font-family: var(--font); color: var(--text); }
.freq:hover { border-color: var(--blue-200); background: var(--surface-2); }
.freq[hidden] { display: none; }
.gauge.sm { width: 52px; height: 30px; }
.gauge.lg { width: 220px; height: 128px; }
.freq-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.freq-txt b { font-size: 13.5px; }
.freq-txt small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.freq.baixa .freq-txt b { color: var(--blue-ink); }
.freq.normal .freq-txt b { color: var(--green-ink); }
.freq.alta .freq-txt b { color: var(--red-ink); }
.freq-detail { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.freq-big { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.freq-level { text-align: center; max-width: 240px; display: flex; flex-direction: column; gap: 2px; }
.freq-level b { font-size: 20px; }
.freq-level.baixa b { color: var(--blue-ink); }
.freq-level.normal b { color: var(--green-ink); }
.freq-level.alta b { color: var(--red-ink); }
.freq-level span { font-size: 13px; color: var(--text-2); }
.freq-stats { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 200px; }
.freq-stats .stat { display: flex; flex-direction: column; }
.fh-title { margin: 20px 0 6px; font-size: 14px; }
.fh-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.fh-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-target { width: 12px; height: 12px; border: 1.5px dashed var(--target-line); border-radius: 3px; display: inline-block; }
.lg-sent { width: 12px; height: 12px; background: var(--blue); border-radius: 3px; display: inline-block; }
.fh-chart { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; height: 170px; border-bottom: 1px solid var(--border); }
.fh { display: flex; flex-direction: column; min-width: 0; cursor: default; }
.fh-plot { flex: 1; position: relative; border-radius: 4px; }
.fh:hover .fh-plot { background: var(--surface-2); }
.fh-target { position: absolute; left: 12%; right: 12%; bottom: 0; border: 1.5px dashed var(--target-line); border-bottom: none; border-radius: 4px 4px 0 0; }
.fh-sent { position: absolute; left: 25%; right: 25%; bottom: 0; background: var(--blue); border-radius: 4px 4px 0 0; }
.fh.now .fh-target { border-color: var(--text); border-style: solid; }
.fh.future .fh-target { opacity: 0.55; }
.fh-wrap { position: relative; padding-top: 64px; }
.fh.hover .fh-plot { background: var(--blue-50); }
.fh.hover .fh-target { border-color: var(--blue); border-style: solid; }
.fh-tip {
  position: absolute; z-index: 2; pointer-events: none; min-width: 190px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 12.5px; line-height: 1.6;
}
.fh-tip[hidden] { display: none; }
.fh-tip > b { font-size: 13px; }
.fh-tip div { display: flex; align-items: center; gap: 6px; }
.fh-tip .lg-target, .fh-tip .lg-sent { flex-shrink: 0; }
.fh-when { font-size: 11px; color: var(--muted); margin-left: 4px; }
.fh-lbl { font-size: 10px; color: var(--muted); text-align: center; height: 14px; margin-top: 2px; white-space: nowrap; }
@media (max-width: 860px) {
  .freq { padding: 0 6px; height: 40px; }
  .freq-txt small { display: none; }
  .fh-chart { height: 130px; }
}

/* Fila monitorada */
.q-status { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.q-status .badge .ico { width: 14px; height: 14px; }
.q-format { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-2); background: var(--blue-50); border-radius: var(--radius-sm); padding: 10px 12px; }
.q-format .ico { width: 18px; height: 18px; color: var(--blue); flex-shrink: 0; }
.q-manual { margin-top: 12px; font-size: 13px; }
.q-manual summary { cursor: pointer; font-weight: 600; color: var(--blue); margin-bottom: 8px; }
.q-next { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.q-next:empty { display: none; }
.q-next .ico { width: 18px; height: 18px; color: var(--blue); }
.q-list { display: flex; flex-direction: column; gap: 10px; }
.q-item { border: 1px solid var(--border-2); border-radius: var(--radius); padding: 12px; }
.q-item.sent { opacity: 0.7; }
.q-row { display: flex; gap: 12px; align-items: flex-start; }
.q-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.q-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.q-notes { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--orange-ink); }
.q-preview { margin-top: 10px; border-radius: var(--radius-sm); }
.q-edit { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 16px; align-items: start; }
.q-edit .textarea.msg { min-height: 280px; }
.q-edit-pv { border-radius: var(--radius); max-height: 520px; overflow-y: auto; }
@media (max-width: 860px) { .q-edit { grid-template-columns: minmax(0, 1fr); } }
.q-prog:empty { display: none; }
.q-prog { margin-top: 6px; }
.q-bar { height: 8px; margin-top: 4px; max-width: none; }
.q-item.sending .q-bar .p-sent { background: linear-gradient(90deg, var(--green), #4ade80); }
.q-wait { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--orange-ink); }
.q-wait .ico { width: 16px; height: 16px; }
@media (max-width: 860px) { .q-row { flex-wrap: wrap; } .q-actions { width: 100%; justify-content: flex-start; } }

/* Números da campanha */
.senders { margin-bottom: 16px; }
.senders-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.senders-head h3 { flex: 1; margin: 0; }
.senders-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.sender { border: 1px solid var(--border-2); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.sender.off { background: var(--surface-2); }
.sender.off .sender-main .avatar, .sender.off .item-main { opacity: 0.55; }
.sender-main { display: flex; align-items: center; gap: 10px; }
.sender-main .item-sub { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.compat { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 8px 10px; border-radius: var(--radius-sm); }
.compat .ico { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.compat.ok { background: var(--green-50); color: var(--green-ink); }
.compat.bad { background: var(--red-50); color: var(--red-ink); }
.compat.warn { background: var(--orange-50); color: var(--orange-ink); }
.compat-item { display: block; }
.compat-item + .compat-item { margin-top: 4px; }
.compat-item .link-btn { margin-left: 6px; color: inherit; text-decoration: underline; }
.compat-groups { margin: 4px 0 2px; padding-left: 18px; color: var(--text-2); }
@media (max-width: 860px) { .senders-list { grid-template-columns: minmax(0, 1fr); } }

/* Cupons */
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; flex-wrap: wrap; }
.chk.sm { font-size: 12.5px; font-weight: 600; color: var(--text-2); gap: 5px; }
.chk.sm .checkbox { width: 16px; height: 16px; }
.radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13.5px; white-space: nowrap; }
.radio input { accent-color: var(--blue); width: 16px; height: 16px; }
.disc-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.disc-row[hidden] { display: none; }
.disc-val { width: 120px; }
.max-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.max-row[hidden], .max-inline[hidden] { display: none; }
.max-row label { font-weight: 600; font-size: 13px; color: var(--text-2); }
.field.max-row { flex-direction: row; }
.field.max-row .hint { flex-basis: 100%; }
.max-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.price-calc { display: flex; gap: 8px; align-items: flex-start; background: var(--green-50); color: var(--green-ink); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; margin-bottom: 10px; line-height: 1.5; }
.price-calc .ico { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; margin-top: 1px; }
.fixed-coupon { border-top: 1px solid var(--border-2); padding-top: 14px; margin-top: 2px; }
.fc-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 0 14px; margin-top: 12px; padding: 12px; background: var(--orange-50); border-radius: var(--radius-sm); }
.fc-fields[hidden] { display: none; }
.fc-fields .field { margin-bottom: 0; }
.mini-tag.coupon { background: var(--orange-50); color: var(--orange-ink); }
.sim-opts { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cp-combo { position: relative; }
.cp-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; max-height: 280px; overflow-y: auto; }
.cp-suggest[hidden] { display: none; }
.cp-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; border: none; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; text-align: left; }
.cp-opt:hover, .cp-opt.active { background: var(--blue-50); }
.cp-opt.active { box-shadow: inset 3px 0 0 var(--blue); }
.cp-opt b { font-family: Consolas, monospace; font-size: 13.5px; }
.cp-opt span { font-size: 12px; color: var(--muted); }
#fCoupon { text-transform: uppercase; font-family: Consolas, monospace; letter-spacing: 0.3px; }
#fCoupon::placeholder { text-transform: none; font-family: var(--font); letter-spacing: 0; }
.coupon-field #cpInfo b { color: var(--text); }
.cp-row { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); }
.cp-row.fixed { background: var(--orange-50); border-color: transparent; }
.cp-row.expired { background: var(--surface-2); }
.cp-row.expired .cp-main b, .cp-row.expired .cp-main > span:not(.cp-exp) { opacity: 0.55; text-decoration: line-through; }
.cp-exp { display: flex; align-items: center; gap: 4px; font-size: 11.5px !important; margin-top: 2px; }
.cp-exp .ico { width: 14px; height: 14px; }
.cp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cp-main b { font-family: Consolas, monospace; font-size: 14px; }
.cp-main span { font-size: 12px; color: var(--muted); }
@media (max-width: 860px) { .fc-fields { grid-template-columns: minmax(0, 1fr); } }

/* I.A */
.ai-badge {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px;
  background: linear-gradient(135deg, #7c3aed, #0866ff); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: 0.4px;
  vertical-align: middle; cursor: help; flex-shrink: 0;
}
.btn .ai-badge { margin-right: 2px; }
.ai-vars { margin-top: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--purple-50); border: 1px dashed var(--purple-200); }
.ai-vars .variant-l { display: flex; align-items: center; gap: 6px; }
.ai-var { padding: 6px 8px; margin-top: 6px; background: var(--surface); border-radius: 6px; border: 1px solid var(--purple-100); white-space: pre-wrap; line-height: 1.6; font-size: 13.5px; }
.ai-pending { font-size: 13px; color: var(--purple-ink); margin-top: 4px; }
.ai-note { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.spin-ai { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; margin-right: 8px; flex-wrap: wrap; }
.spin-ai-txt { color: var(--purple-ink); font-weight: 600; }
.spin-ai-txt.ok { color: var(--green-ink); }
.spin-ai-err { color: var(--red); font-size: 12px; }
.ai-status { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--orange-50); color: var(--orange-ink); font-size: 13px; }
.ai-status.ok { background: var(--green-50); color: var(--green-ink); }
.ai-status .ico { width: 18px; height: 18px; }
.prod-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.prod-grid .textarea { min-height: 56px; }

/* Switch */
.sw { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); user-select: none; }
.sw input { display: none; }
.sw .sw-ui { width: 34px; height: 20px; border-radius: 10px; background: var(--border); position: relative; transition: background 0.15s; flex-shrink: 0; }
.sw .sw-ui::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.2); transition: transform 0.15s; }
.sw input:checked + .sw-ui { background: var(--blue); }
.sw input:checked + .sw-ui::after { transform: translateX(14px); }
.pv-tools .sw input { display: inline; accent-color: var(--blue); }

/* Dados do produto no envio */
.link-row { display: flex; gap: 8px; }
.link-row .input { flex: 1; min-width: 0; }
#tplInfo .ico { width: 14px; height: 14px; color: var(--green); vertical-align: -2px; }
.prod-box { border: 1px solid var(--blue-100); background: var(--blue-50); border-radius: var(--radius); padding: 12px; margin-bottom: 14px; }
.prod-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.prod-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
.prod-grid .field { margin-bottom: 10px; }
.prod-grid .field.full { grid-column: 1 / -1; }
.prod-grid label { display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

@media (max-width: 1100px) {
  .compose, .monitor { grid-template-columns: minmax(0, 1fr); }
  .compose-side { position: static; }
  .wa-bubble { max-width: 340px; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 1200px) {
  .row { grid-template-columns: 28px 48px minmax(180px, 2fr) repeat(3, minmax(80px, 0.8fr)) 110px 36px; }
  .row .col-meta { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  :root { --topbar-h: 56px; }
  .only-mobile { display: flex !important; }
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 35; }
  .main { margin-left: 0; }
  .topbar { padding: 0 12px; }
  .topbar-title h1 { font-size: 17px; }
  .topbar-actions .btn span:not(.ai-badge) { display: none; }
  .topbar-actions .btn { padding: 0 10px; }
  .content { padding: 16px 12px calc(84px + env(safe-area-inset-bottom)); }
  .grid-3, .grid-2, .cards-grid { grid-template-columns: minmax(0, 1fr); }
  .crumbs { display: none; }
  .kpis { gap: 10px; }
  .kpi { padding: 12px; gap: 10px; }
  .kpi-icon { width: 36px; height: 36px; border-radius: 10px; }
  .kpi-value { font-size: 20px; }
  .panel-scroll { max-height: none; }

  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border-2);
    padding-bottom: env(safe-area-inset-bottom);
    justify-content: space-around;
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; font-size: 11px; color: var(--muted); font-weight: 600; }
  .bottom-nav a.active { color: var(--blue); }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .csec { padding: 14px; }
  .prod-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .link-row .btn span { display: none; }
  .var-bar { position: static; }
  .confirm-bar { grid-template-columns: 1fr; }
  .job-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .job-acc { display: none; }
  .acc-picks, .acc-mon { grid-template-columns: minmax(0, 1fr); }
  .disp-thumb { width: 52px; height: 52px; }

  /* Linhas viram cartões */
  .rows { background: transparent; border: none; box-shadow: none; display: flex; flex-direction: column; gap: 10px; }
  .row.head { display: none; }
  .row {
    grid-template-columns: 24px 44px 1fr 36px;
    grid-template-areas: 'chk av name menu' 'm1 m1 m2 m2' 'm3 m3 cheio cheio';
    background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius); gap: 10px 12px; padding: 14px;
  }
  .row > .c-chk { grid-area: chk; }
  .row > .c-av { grid-area: av; }
  .row > .c-name { grid-area: name; min-width: 0; }
  .row > .c-m1 { grid-area: m1; }
  .row > .c-m2 { grid-area: m2; }
  .row > .c-m3 { grid-area: m3; }
  .row > .c-full { grid-area: cheio; }
  .row > .c-menu { grid-area: menu; }
  .row .avatar.sm { width: 44px; height: 44px; }
  .metric b { font-size: 16px; }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal, .modal.lg { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .qr-frame { width: 240px; height: 240px; }
  .camp-hero .stats { gap: 18px; }
}
@media (max-width: 420px) {
  .kpi-icon { display: none; }
  .acc-foot .btn span { display: none; }
}

/* ---------- Cliques (encurtador) ---------- */
.click-item { align-items: center; }
.click-rank { width: 22px; flex: none; text-align: center; font-weight: 700; color: var(--muted); font-size: 13px; }
.click-num { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; padding-left: 8px; }
.click-num b { font-size: 18px; color: var(--text); }
.click-num small { font-size: 11px; color: var(--muted); }
.click-bar { height: 6px; border-radius: 3px; background: var(--border-2); margin: 6px 0 4px; overflow: hidden; }
.click-bar span { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.clk-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.clk-side { display: grid; gap: 16px; }
.hour-chart { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding-bottom: 18px; }
.hc-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; cursor: default; }
.hc-col span { display: block; background: var(--blue); border-radius: 4px 4px 0 0; min-height: 2px; }
.hc-col.future span { background: var(--border); }
.hc-col.hover span { background: var(--blue-press); }
.hc-col small { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.dev-row { display: grid; grid-template-columns: 90px 1fr 42px 48px; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 6px; }
.dev-row .click-bar { margin: 0; }
.dev-row b { text-align: right; }
.dev-row small { color: var(--muted); text-align: right; }
@media (max-width: 900px) { .clk-grid { grid-template-columns: 1fr; } }

/* ---------- Detalhe da conta ---------- */
.acc-info { margin-top: 16px; }
.info-list { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; font-size: 14px; }
.info-list dt { color: var(--muted); font-weight: 600; }
.info-list dd { margin: 0; color: var(--text); }
.muted { color: var(--muted); }
.acc-groups-toggle { margin-top: 16px; }
.acc-card a.item-main { color: inherit; text-decoration: none; }
.acc-card a.item-main:hover .item-title { color: var(--blue); }
@media (max-width: 560px) { .info-list { grid-template-columns: 1fr; gap: 2px; } .info-list dd { margin-bottom: 10px; } }

/* ---------- Conectar: abas QR / número e código de pareamento ---------- */
.conn-tabs { display: flex; justify-content: center; margin: 0 auto 16px; width: fit-content; }
.pair-code { font: 700 34px/1.2 ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: 4px; padding: 14px 22px; border-radius: var(--radius); background: var(--blue-50); color: var(--blue-ink); border: 1px dashed var(--blue-200); user-select: all; }
