/* =========================================================
   Dmzap — identidade visual
   Cor da marca: verde-limão neon #C6F432 (preenchimento, sempre com texto escuro)
   Cor de apoio: rosa choque #FF3D8B (IA, recursos especiais e detalhes da marca)
   Fonte: Plus Jakarta Sans
   Temas: claro e escuro (html[data-theme]); a pessoa escolhe no botão ☀/☾
   ========================================================= */
:root {
  --brand: #c6f432; --brand-strong: #b4e31f; --brand-ink: #0b0f05;
  --pink: #ff3d8b; --pink-strong: #f0237a; --pink-ink: #ffffff;
  --brand-mix: linear-gradient(120deg, #c6f432 0%, #c6f432 45%, #ff3d8b 100%);
  --radius: 14px; --radius-sm: 10px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* tema claro */
  --bg: #f6f6f2; --panel: #ffffff; --panel-2: #fafaf6; --hover: #f2f3ec;
  --text: #0c0d0a; --muted: #686d62; --line: #e6e7e0; --line-2: #d6d9cd;
  --accent: #3f6212;               /* texto/links na cor da marca (legível no claro) */
  --pink-text: #d61a6b; --pink-soft: #ffe4ef; --pink-soft-line: #ffbcd6;
  --brand-soft: #eefad0; --brand-soft-line: #d6ee8a;
  --ok: #15803d; --ok-soft: #dcfce7; --err: #dc2626; --err-soft: #fef2f2; --err-line: #fecaca;
  --warn: #b45309; --warn-soft: #fff7ed; --warn-line: #fed7aa;
  --shadow: 0 1px 2px rgba(16,18,10,.04), 0 10px 30px -18px rgba(16,18,10,.18);
  --shadow-lg: 0 2px 6px rgba(16,18,10,.05), 0 24px 60px -28px rgba(16,18,10,.28);
  --canvas: #fbfbf7; --canvas-dot: #d3d6c9;
  --ig-them: #efefef; --ig-story: #27272a;
  --focus: 0 0 0 3px rgba(132,180,0,.28);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #090a08; --panel: #111310; --panel-2: #161914; --hover: #1b1e18;
  --text: #f1f3ec; --muted: #969c8d; --line: #22261e; --line-2: #2e3329;
  --accent: #c6f432;
  --pink-text: #ff6aa6; --pink-soft: rgba(255,61,139,.12); --pink-soft-line: rgba(255,61,139,.35);
  --brand-soft: rgba(198,244,50,.10); --brand-soft-line: rgba(198,244,50,.28);
  --ok: #4ade80; --ok-soft: rgba(74,222,128,.12); --err: #f87171; --err-soft: rgba(248,113,113,.10); --err-line: rgba(248,113,113,.3);
  --warn: #fbbf24; --warn-soft: rgba(251,191,36,.08); --warn-line: rgba(251,191,36,.28);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -20px rgba(0,0,0,.8);
  --shadow-lg: 0 1px 0 rgba(255,255,255,.04) inset, 0 30px 70px -30px rgba(0,0,0,.9);
  --canvas: #0c0e0b; --canvas-dot: #262b22;
  --ig-them: #262626; --ig-story: #1c1d1b;
  --focus: 0 0 0 3px rgba(198,244,50,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; }
body { transition: background-color .2s ease; }
a { color: var(--accent); text-underline-offset: 3px; }
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 6px; font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 700; letter-spacing: -.01em; }
b, strong { font-weight: 700; }
code { font-size: 12px; background: var(--hover); border: 1px solid var(--line); padding: 0 5px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.row { display: flex; gap: 12px; align-items: center; } .grow { flex: 1; } .wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }

/* ---------- botões ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--text); border-radius: var(--radius-sm); padding: 8px 14px; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s, box-shadow .15s, transform .05s; }
button:hover, .btn:hover { background: var(--hover); }
button:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--focus); }
.primary { background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand-strong); font-weight: 700;
  box-shadow: 0 1px 0 rgba(255,255,255,.45) inset, 0 6px 18px -8px rgba(160,210,20,.7); }
.primary:hover { background: var(--brand-strong); }
:root[data-theme="dark"] .primary { box-shadow: 0 0 0 1px rgba(198,244,50,.2), 0 8px 28px -10px rgba(198,244,50,.55); }
::selection { background: var(--pink); color: #fff; }
.danger { color: var(--err); }
/* recursos de IA: rosa */
#vary, #dmVary, #iVary { color: var(--pink-text); border-color: var(--pink-soft-line); background: var(--pink-soft); }
#vary:hover, #dmVary:hover, #iVary:hover { background: var(--pink); color: var(--pink-ink); border-color: var(--pink); }
.seg button[data-v="INTENT"].on, .seg button[data-tt="INTENT"].on { background: var(--pink) !important; color: var(--pink-ink) !important; box-shadow: none !important; }
.flow-palette button[data-add="AI_REPLY"] { color: var(--pink-text); border-color: var(--pink-soft-line); }
.tag-ai { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px;
  background: var(--pink-soft); color: var(--pink-text); border: 1px solid var(--pink-soft-line); }
button:disabled { opacity: .55; cursor: default; transform: none; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 10px; }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------- formulários ---------- */
input, textarea, select { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); background: var(--panel); color: var(--text); transition: border-color .15s, box-shadow .15s; }
:root[data-theme="dark"] input, :root[data-theme="dark"] textarea, :root[data-theme="dark"] select { background: var(--panel-2); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-strong); }
label.field { display: block; } label.field > span { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
a.card { transition: border-color .15s, transform .15s, box-shadow .15s; }
a.card:hover { border-color: var(--brand-soft-line); transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ---------- marca ---------- */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; letter-spacing: -.04em; color: var(--text); text-decoration: none; }
.logo img { width: 32px; height: 32px; border-radius: 9px; display: block; }
.logo span b { color: var(--accent); font-weight: 800; }

/* ---------- login / cadastro ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-hero { position: relative; overflow: hidden; background: #0a0b08; color: #f1f3ec; padding: 44px 48px; display: flex; flex-direction: column; }
.auth-hero::before { content: ""; position: absolute; width: 640px; height: 640px; left: -160px; top: -260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(198,244,50,.30), rgba(198,244,50,0) 65%); pointer-events: none; }
.auth-hero { border-right: 1px solid rgba(255,255,255,.06); }
.auth-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 70% 30%, #000 20%, transparent 70%); }
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero .logo { color: #f1f3ec; }
.auth-hero .logo span b { color: var(--brand); }
.auth-hero .glow-2 { position: absolute; width: 560px; height: 560px; right: -240px; bottom: -260px; border-radius: 50%; z-index: 0;
  background: radial-gradient(circle, rgba(255,61,139,.26), rgba(255,61,139,0) 65%); pointer-events: none; }
.auth-hero h2 em.pink { color: var(--pink); }
.auth-hero h2 { font-size: 40px; line-height: 1.08; letter-spacing: -.035em; font-weight: 800; margin: auto 0 14px; max-width: 470px; }
.auth-hero h2 em { font-style: normal; color: var(--brand); }
.auth-hero p { color: #a3a99a; max-width: 430px; margin: 0 0 26px; font-size: 15px; }
.auth-points { display: grid; gap: 10px; margin: 0 0 30px; padding: 0; list-style: none; color: #d6dacd; }
.auth-points li { display: flex; gap: 10px; align-items: center; }
.auth-points li::before { content: ""; width: 18px; height: 18px; border-radius: 6px; flex: none;
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0f05' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/12px no-repeat; }
.auth-demo { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 16px; max-width: 400px;
  display: flex; flex-direction: column; gap: 8px; backdrop-filter: blur(6px); }
.auth-demo .bubble { font-size: 13px; }
.auth-demo .bubble.them { background: #1f221c; color: #e6e9df; }
.auth-demo .bubble.me { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.auth-demo .ai-line { color: var(--pink); }
.auth-demo .lbl { font-size: 11px; color: #7d8374; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.auth-side { display: grid; place-items: center; padding: 32px 20px; position: relative; }
.auth-side .theme-float { position: absolute; top: 18px; right: 18px; }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 28px; }
.auth-form .primary { width: 100%; padding: 12px; font-size: 15px; }
.auth-form .mobile-logo { display: none; margin-bottom: 18px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--panel); border-right: 1px solid var(--line); padding: 20px 14px;
  display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.side .logo { padding: 2px 8px 14px; }
.side-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.side a.nav { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--muted);
  text-decoration: none; font-weight: 600; transition: background-color .15s, color .15s; }
.side a.nav:hover { background: var(--hover); color: var(--text); }
.side a.nav.on { background: var(--brand-soft); color: var(--text); }
.side a.nav.on .icon { color: var(--accent); }
.side a.nav.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--brand), var(--pink)); }
.account { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; margin: 0 0 6px;
  background: var(--panel-2); }
.side select { margin-bottom: 6px; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.side-foot .row { gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; min-width: 0; }
.user-chip .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.main { padding: 32px 36px; min-width: 0; max-width: 1480px; width: 100%; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 + .muted { font-size: 14px; }
.banner { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn); padding: 11px 14px; border-radius: 12px; margin-bottom: 18px; }
.banner.err { background: var(--err-soft); border-color: var(--err-line); color: var(--err); }

/* ---------- números ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 104px; }
.stat > span { font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.35; }
.stat b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat:first-child { background: var(--brand); border-color: var(--brand-strong); }
.stat:first-child > span { color: rgba(11,15,5,.68); }
.stat:first-child b { color: var(--brand-ink); }

/* ---------- lista de automações ---------- */
.list { display: grid; gap: 10px; }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; transition: border-color .15s; }
.item:hover { border-color: var(--line-2); }
.item a { text-decoration: none; } .item a:hover { text-decoration: underline; }
.thumb { width: 52px; height: 52px; border-radius: 11px; background: var(--hover); object-fit: cover; flex: none; display: grid; place-items: center;
  font-size: 11px; color: var(--muted); border: 1px solid var(--line); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px;
  background: var(--hover); color: var(--muted); border: 1px solid var(--line); }
.pill.live { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); }
.pill.err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--brand-ink); }
.switch input:focus-visible + span { box-shadow: var(--focus); }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 22px; align-items: start; }
.section-title { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; margin: 22px 0 10px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 260px; overflow: auto; }
.media-grid button { padding: 0; border: 2px solid transparent; border-radius: 11px; overflow: hidden; aspect-ratio: 1; background: var(--hover); }
.media-grid button.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.media-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.seg button { border: 0; border-radius: 9px; font-weight: 600; background: transparent; color: var(--muted); padding: 7px 13px; }
.seg button:hover { color: var(--text); background: var(--hover); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
:root[data-theme="dark"] .seg button.on { background: var(--brand); color: var(--brand-ink); box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--panel); }
:root[data-theme="dark"] .chips { background: var(--panel-2); }
.chips:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.chips input { border: 0; flex: 1; min-width: 120px; padding: 4px; background: transparent !important; box-shadow: none !important; }
.chip { background: var(--brand-soft); color: var(--text); border: 1px solid var(--brand-soft-line); border-radius: 99px; padding: 2px 4px 2px 10px;
  font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.chip button { border: 0; background: none; padding: 0 6px; color: inherit; }
.check { display: flex; gap: 9px; align-items: flex-start; } .check input { width: auto; margin-top: 4px; }
.sticky { position: sticky; top: 20px; }

/* ---------- prévia estilo Instagram ---------- */
.phone { background: var(--panel); border: 1px solid var(--line); border-radius: 30px; padding: 14px; box-shadow: var(--shadow-lg); }
.phone .tabs { display: flex; gap: 4px; margin-bottom: 12px; padding: 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
.phone .tabs button { flex: 1; padding: 6px; font-size: 12px; border: 0; background: transparent; color: var(--muted); border-radius: 9px; }
.phone .tabs button.on { background: var(--text); color: var(--bg); }
.ig-post img, .ig-post .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--hover); display: grid; place-items: center; color: var(--muted); }
.ig-comment { display: flex; gap: 8px; margin-top: 10px; font-size: 13px; }
.ig-comment .avatar { width: 24px; height: 24px; font-size: 11px; }
.ig-comment.reply { margin-left: 30px; }
.media-grid.stories { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.media-grid.stories button { aspect-ratio: 9 / 16; }
.ig-story { position: relative; aspect-ratio: 9 / 16; max-height: 440px; margin: 0 auto; border-radius: 16px; overflow: hidden; background: var(--ig-story); }
.ig-story img, .ig-story .ph { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; color: #d4d4d8; }
.ig-story .reply-bar { position: absolute; left: 10px; right: 10px; bottom: 10px; border: 1px solid rgba(255,255,255,.7);
  border-radius: 99px; padding: 8px 14px; color: #fff; font-size: 12px; background: rgba(0,0,0,.15); }
.ig-story .tag { position: absolute; left: 50%; top: 45%; transform: translateX(-50%); background: #fff; color: #18181b;
  font-weight: 700; padding: 6px 12px; border-radius: 8px; font-size: 13px; }
.chat { display: flex; flex-direction: column; gap: 8px; min-height: 320px; padding: 6px 2px; }
.bubble { max-width: 85%; padding: 9px 13px; border-radius: 18px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.bubble.me { align-self: flex-end; background: #3797f0; color: #fff; }
.bubble.them { align-self: flex-start; background: var(--ig-them); color: var(--text); }
.bubble .btnlink { display: block; margin-top: 8px; background: var(--panel); color: var(--text); text-align: center; border-radius: 10px; padding: 7px; font-weight: 600; }

/* ---------- tabelas ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
tbody tr { transition: background-color .12s; }
tbody tr:hover { background: var(--panel-2); }
td code { font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.card:has(table) { overflow-x: auto; }
.empty { text-align: center; padding: 48px 16px; }
.empty h2 { font-size: 18px; }

/* ---------- flow builder ---------- */
.flow-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; height: calc(100vh - 160px); min-height: 520px; }
.flow-palette { position: absolute; left: 12px; top: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 2; pointer-events: none; }
.flow-palette button { pointer-events: all; font-weight: 600; font-size: 12px; padding: 6px 11px; box-shadow: var(--shadow); }
.flow-hint { position: absolute; right: 12px; bottom: 10px; left: 56px; text-align: right; pointer-events: none; }
.flow-side { overflow: auto; }
.flow-canvas { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); touch-action: none;
  background-color: var(--canvas); background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1px); background-size: 20px 20px; cursor: grab; }
.flow-canvas:active { cursor: grabbing; }
.flow-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.flow-edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.fedge { fill: none; stroke: var(--line-2); stroke-width: 2.2; }
:root[data-theme="dark"] .fedge { stroke: #3d4436; }
.fedge.temp { stroke: var(--brand-strong); stroke-dasharray: 6 4; }
.fedge-del { pointer-events: all; cursor: pointer; opacity: .35; }
.fedge-del:hover { opacity: 1; }
.fedge-del circle { fill: var(--panel); stroke: var(--line-2); }
.fedge-del text { font-size: 13px; fill: var(--err); font-weight: 700; }
.fnode { position: absolute; width: 240px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); cursor: pointer; user-select: none; }
.fnode.sel { outline: 2px solid var(--brand-strong); outline-offset: 1px; }
.fnode.current { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 35%, transparent); border-color: var(--ok); }
.fhead { padding: 9px 12px; font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--line); display: flex; gap: 6px; align-items: center;
  border-top: 4px solid var(--c); border-radius: 14px 14px 0 0; }
.fbody { padding: 9px 12px; font-size: 12px; line-height: 1.45; }
.ftext { white-space: pre-wrap; word-break: break-word; max-height: 78px; overflow: hidden; }
.fchip { display: inline-block; margin: 4px 4px 0 0; padding: 1px 7px; border-radius: 99px; background: var(--hover); font-size: 11px; }
.fouts { border-top: 1px dashed var(--line); padding: 4px 0; }
.fout { position: relative; display: flex; justify-content: flex-end; padding: 3px 18px 3px 12px; font-size: 11px; color: var(--muted); }
.fh, .fin { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--panel); border: 2px solid var(--c); }
.fh { right: -8px; top: 50%; transform: translateY(-50%); cursor: crosshair; }
.fh:hover { background: var(--c); }
.fin { left: -8px; top: 18px; }
.flow-zoom { position: absolute; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.flow-zoom button { width: 32px; height: 32px; padding: 0; }
.fbtn-row { display: grid; grid-template-columns: 110px 1fr 32px; gap: 6px; }
.fbtn-row button { padding: 0; }
.sim-state { background: var(--brand-soft); border: 1px solid var(--brand-soft-line); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.sim-ev { padding: 4px 0; border-bottom: 1px solid var(--line); }
.sim-ev.err { color: var(--err); }
pre.code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; overflow-x: auto; font-size: 11px; margin: 6px 0 0; }

/* ---------- avisos ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); font-weight: 600;
  padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 10; max-width: calc(100% - 32px); animation: toast-in .2s ease; }
.toast.err { background: var(--err); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* barra de rolagem discreta */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-form .mobile-logo { display: flex; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line);
    align-items: center; padding: 10px 12px; gap: 4px; }
  .side .logo { padding: 0 8px 0 4px; }
  .side .account, .side .side-label, .side select { display: none; }
  .side a.nav { padding: 7px 9px; }
  .side a.nav span { display: none; }
  .side a.nav.on::before { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; flex-direction: row; align-items: center; }
  .side-foot .user-chip { display: none; }
  .side-foot #logout { width: 36px; height: 36px; padding: 0; flex: none; }
  .side-foot #logout span { display: none; }
  .side .logo span { display: none; }
  .item { flex-wrap: wrap; }
  .editor { grid-template-columns: 1fr; }
  .flow-wrap { grid-template-columns: 1fr; height: auto; }
  .flow-canvas { height: 60vh; }
  .flow-hint { display: none; }
  .main { padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* =========================================================
   Painel (visão geral)
   ========================================================= */
:root { --c-int: #8dbf00; --c-int-area: rgba(160,210,0,.22); --c-dm: #ff3d8b; --c-clk: #52574b; }
:root[data-theme="dark"] { --c-int: #c6f432; --c-int-area: rgba(198,244,50,.20); --c-dm: #ff5c9d; --c-clk: #e8ebe2; }
:root[data-theme="dark"] body { background-image: radial-gradient(900px 380px at 75% -120px, rgba(198,244,50,.07), transparent 70%),
  radial-gradient(700px 300px at 100% 0, rgba(255,61,139,.05), transparent 70%); background-repeat: no-repeat; }

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 30px; margin-bottom: 4px; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; letter-spacing: .01em; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--hover); color: var(--text); flex: none; border: 1px solid var(--line); }
.kpi-ic .icon { width: 16px; height: 16px; }
.kpi-label { font-weight: 700; font-size: 13px; color: var(--muted); flex: 1; }
.kpi-value { font-size: 34px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-foot { display: flex; align-items: flex-end; gap: 10px; font-size: 12px; color: var(--muted); min-height: 34px; }
.kpi-foot > span { flex: 1; line-height: 1.35; }
.kpi-foot .ctr { color: var(--text); }
.spark { width: 96px; height: 34px; flex: none; overflow: visible; }
.spark-line { fill: none; stroke: var(--c-int); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark-area { fill: var(--c-int-area); opacity: .7; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.delta .icon { width: 12px; height: 12px; }
.delta.up { background: var(--ok-soft); color: var(--ok); }
.delta.down { background: var(--err-soft); color: var(--err); }
.delta.flat { background: var(--hover); color: var(--muted); font-weight: 600; }
.kpi.hl { background: var(--brand); border-color: var(--brand-strong); color: var(--brand-ink); }
.kpi.hl .kpi-label, .kpi.hl .kpi-foot { color: rgba(11,15,5,.66); }
.kpi.hl .kpi-ic { background: rgba(11,15,5,.08); border-color: rgba(11,15,5,.1); color: var(--brand-ink); }
.kpi.hl .delta { background: rgba(11,15,5,.1); color: var(--brand-ink); }
.kpi.hl .spark-line { stroke: var(--brand-ink); }
.kpi.hl .spark-area { fill: rgba(11,15,5,.12); }
:root[data-theme="dark"] .kpi.hl { box-shadow: 0 0 0 1px rgba(198,244,50,.25), 0 18px 50px -24px rgba(198,244,50,.55); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; margin-bottom: 14px; }
.chart-card { padding: 20px 20px 14px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; font-weight: 600; color: var(--muted); }
.legend span, .ch-tip span { display: inline-flex; align-items: center; gap: 6px; }
.legend i, .ch-tip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-int { background: var(--c-int); } .lg-dm { background: var(--c-dm); } .lg-clk { background: var(--c-clk); }
.chart { position: relative; height: 220px; cursor: crosshair; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ch-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 4; }
.ch-int, .ch-dm, .ch-clk { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.ch-int { stroke: var(--c-int); } .ch-dm { stroke: var(--c-dm); } .ch-clk { stroke: var(--c-clk); stroke-dasharray: 5 5; stroke-width: 2; }
.stop-a { stop-color: var(--c-int); stop-opacity: .35; } .stop-b { stop-color: var(--c-int); stop-opacity: 0; }
.ch-cursor { stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ch-tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--text); color: var(--bg); border-radius: 10px; padding: 8px 10px;
  font-size: 12px; display: flex; flex-direction: column; gap: 3px; pointer-events: none; box-shadow: var(--shadow-lg); white-space: nowrap; z-index: 2; }
.ch-tip[hidden] { display: none; }
.ch-x { display: grid; grid-template-columns: repeat(14, 1fr); font-size: 11px; color: var(--muted); margin-top: 8px; text-align: center; }
.ch-x span:first-child { text-align: left; } .ch-x span:last-child { text-align: right; }

.rank-card { padding: 20px; }
.rank { display: flex; align-items: center; gap: 12px; padding: 9px 0; text-decoration: none; color: inherit; border-top: 1px solid var(--line); }
.rank-card .rank:nth-of-type(1) { border-top: 0; }
.rank:hover .rank-name { text-decoration: underline; }
.rank-n { width: 24px; height: 24px; border-radius: 8px; background: var(--hover); display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--muted); flex: none; }
.rank-card .rank:nth-of-type(1) .rank-n { background: var(--brand); color: var(--brand-ink); }
.rank-name { display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { display: block; height: 5px; border-radius: 99px; background: var(--hover); margin-top: 6px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--c-int), var(--c-dm)); }
.rank b { font-variant-numeric: tabular-nums; font-size: 14px; }

.table-card { padding: 0; overflow: hidden; }
.table-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 10px; background: var(--panel); width: 220px; color: var(--muted); }
:root[data-theme="dark"] .search { background: var(--panel-2); }
.search:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.search input { border: 0; padding: 8px 0; background: transparent !important; box-shadow: none !important; }
.search .icon { width: 16px; height: 16px; }
.arow { display: grid; grid-template-columns: minmax(0, 1fr) 80px 80px 70px 120px 40px; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); transition: background-color .12s; }
.arow[hidden] { display: none; }
#rows .arow:first-child { border-top: 0; }
#rows .arow:hover { background: var(--panel-2); }
.arow-head { border-top: 0; padding-top: 10px; padding-bottom: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--line); }
.arow-head span:nth-child(n+2):nth-child(-n+4) { text-align: right; }
.acell-main { display: flex; align-items: center; gap: 14px; min-width: 0; text-decoration: none; color: inherit; }
.acell-main .thumb { width: 44px; height: 44px; }
.aname { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acell-main:hover .aname { text-decoration: underline; }
.ameta { display: flex; align-items: center; gap: 6px; margin-top: 3px; min-width: 0; }
.ameta .pill, .ameta .tag-ai { flex: none; white-space: nowrap; }
.adesc { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.anum { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.astatus { display: flex; align-items: center; gap: 8px; }
.on-txt { color: var(--ok); font-weight: 700; }
.kind-tile { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--accent);
  border: 1px solid var(--brand-soft-line); flex: none; }
.kind-tile .icon { width: 20px; height: 20px; }
.kind-tile.ai { background: var(--pink-soft); color: var(--pink-text); border-color: var(--pink-soft-line); }
.kind-tile.big { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; }
.kind-tile.big .icon { width: 26px; height: 26px; }

@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .page-head h1 { font-size: 24px; }
  .kpi-value { font-size: 28px; }
  .search { width: 100%; }
  .arow-head { display: none; }
  .arow { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; row-gap: 10px; }
  .acell-main { grid-column: 1 / -1; }
  .anum { text-align: left; font-size: 13px; }
  .anum::before { content: attr(data-l); display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .astatus { grid-column: 1 / -2; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } }

/* =========================================================
   Demais telas
   ========================================================= */
.back-link { display: inline-block; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.back-link:hover { color: var(--text); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost.danger:hover { background: var(--err-soft); }
.count-dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--err); color: #fff; font-size: 10px; font-weight: 800; }

/* editor: cabeçalho fixo no topo */
.editor-head { position: sticky; top: 0; z-index: 5; margin: -32px -36px 22px; padding: 14px 36px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.editor-head .back-link { margin: 0; }
.editor-head input#name, .editor-head input#fName { font-size: 15px; }
.ed-kind { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.ed-kind .kind-tile { width: 40px; height: 40px; }
.editor > .card { padding: 24px; }
.section-title { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 12px; margin-top: 26px; }
.section-title::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* contas conectadas */
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.acct { display: flex; flex-direction: column; gap: 16px; }
.acct-top { display: flex; align-items: center; gap: 14px; }
.acct-top .avatar { width: 56px; height: 56px; font-size: 20px; }
.avatar.ring { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--brand); }
.acct-name { font-weight: 800; font-size: 17px; letter-spacing: -.01em; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }
.acct-info { margin: 0; display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.acct-info div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.acct-info dt { color: var(--muted); } .acct-info dd { margin: 0; font-weight: 600; text-align: right; }
.acct > button { align-self: flex-start; margin-top: auto; }
.acct-new { border-style: dashed; border-color: var(--line-2); background: var(--panel-2); box-shadow: none; }
.acct-new .btn { align-self: stretch; }
.checklist { list-style: none; padding: 0; margin: 4px 0 10px; display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.checklist li { position: relative; padding-left: 24px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 5px;
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0f05' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/11px no-repeat; }

/* nova automação */
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.pick { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; padding: 22px; min-height: 210px; }
.pick h2 { margin: 12px 0 0; font-size: 17px; }
.pick .muted { font-size: 13px; flex: 1; }
.pick-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--accent); margin-top: 8px; }
.pick-go .icon { width: 14px; height: 14px; transition: transform .15s; }
.pick:hover .pick-go .icon { transform: rotate(90deg); }
.pick-flow .kind-tile { background: var(--pink-soft); color: var(--pink-text); border-color: var(--pink-soft-line); }
.pick-flow .pick-go { color: var(--pink-text); }

/* contatos */
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.crow { display: grid; grid-template-columns: minmax(0, 1fr) 140px 120px 130px; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.crow[hidden] { display: none; }
#rows .crow:first-child { border-top: 0; }
#rows .crow:hover { background: var(--panel-2); }
.crow-head { padding-top: 10px; padding-bottom: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  background: var(--panel-2); border-top: 0; border-bottom: 1px solid var(--line); }
.crow-head span:nth-child(n+2) { text-align: right; }
.ccell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ccell .avatar { width: 38px; height: 38px; background: var(--hover); color: var(--text); border: 1px solid var(--line); }
.cinfo { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.anum small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }

/* atividade: linha do tempo */
.timeline { padding: 6px 0 10px; }
.tl-day { position: sticky; top: 0; z-index: 1; padding: 14px 20px 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  background: linear-gradient(var(--panel) 70%, transparent); }
.tl-day[hidden], .tl-item[hidden] { display: none; }
.tl-item { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; padding: 10px 20px; align-items: flex-start; }
.tl-item::before { content: ""; position: absolute; left: 36px; top: 46px; bottom: -10px; width: 1px; background: var(--line); }
.tl-item:hover { background: var(--panel-2); }
.tl-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); position: relative; z-index: 1; }
.tl-ic .icon { width: 16px; height: 16px; }
.tl-ic.out { background: var(--brand-soft); color: var(--accent); border-color: var(--brand-soft-line); }
.tl-ic.ai { background: var(--pink-soft); color: var(--pink-text); border-color: var(--pink-soft-line); }
.tl-ic.err { background: var(--err-soft); color: var(--err); border-color: var(--err-line); }
.tl-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-weight: 600; font-size: 13.5px; }
.tl-auto { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tl-auto .icon { width: 12px; height: 12px; }
.tl-detail { font-size: 13px; color: var(--muted); margin-top: 3px; white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tl-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }

@media (max-width: 900px) {
  .editor-head { margin: -18px -16px 16px; padding: 10px 16px; flex-wrap: wrap; }
  .editor-head input#name, .editor-head input#fName { max-width: none !important; flex: 1 1 100%; order: 3; }
  .kpis-3 { grid-template-columns: 1fr; }
  .crow-head { display: none; }
  .crow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ccell { grid-column: 1 / -1; }
  .crow .anum { text-align: left; }
  .tl-item { grid-template-columns: 30px minmax(0, 1fr); padding: 10px 16px; }
  .tl-time { grid-column: 2; padding: 0; }
  .tl-item::before { left: 30px; }
}

/* =========================================================
   Caixa de entrada
   ========================================================= */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--pink); color: #fff;
  font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.nav-badge[hidden] { display: none; }
.main.main-inbox { padding: 0; max-width: none; }
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr) 280px; height: 100vh; }
.ib-list { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.ib-list-head { padding: 22px 16px 12px; display: grid; gap: 12px; border-bottom: 1px solid var(--line); }
.ib-list-head .search { width: 100%; }
.seg-full { display: flex; } .seg-full button { flex: 1; padding: 7px 6px; font-size: 12.5px; }
.ib-convs { overflow-y: auto; flex: 1; padding: 6px; }
.conv { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 12px; text-decoration: none; color: inherit; position: relative; }
.conv:hover { background: var(--hover); }
.conv.on { background: var(--brand-soft); }
.conv .avatar { width: 42px; height: 42px; background: var(--hover); color: var(--text); border: 1px solid var(--line); position: relative; overflow: visible; }
.av-badge { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--pink); font-size: 10px;
  display: grid; place-items: center; border: 2px solid var(--panel); }
.conv-mid { min-width: 0; flex: 1; }
.conv-top { display: flex; align-items: baseline; gap: 8px; }
.conv-top b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.conv-time { font-size: 11px; color: var(--muted); flex: none; }
.conv-prev { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.conv.unread .conv-prev { color: var(--text); font-weight: 600; }
.conv-dot { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; }

.ib-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ib-empty { margin: auto; text-align: center; max-width: 340px; padding: 20px; }
.th-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 85%, transparent); backdrop-filter: blur(10px); }
.th-head .avatar { width: 40px; height: 40px; }
.th-back { display: none; }
.paused-txt { color: var(--pink-text); font-weight: 600; }
.take { border-color: var(--pink-soft-line); color: var(--pink-text); background: var(--pink-soft); }
.take:hover { background: var(--pink); color: #fff; border-color: var(--pink); }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 230px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; gap: 2px; }
.menu[hidden] { display: none; }
.menu-title { font-size: 11px; font-weight: 700; color: var(--muted); padding: 6px 8px 4px; }
.menu button { justify-content: flex-start; border: 0; background: transparent; font-weight: 600; padding: 8px 10px; }
.menu button:hover { background: var(--hover); }

.th-body { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 4px; }
.day-sep { text-align: center; margin: 14px 0 8px; }
.day-sep span { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--hover); padding: 3px 10px; border-radius: 99px; }
.ev-line { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 8px 0; font-size: 12px; color: var(--muted); text-align: center; }
.ev-line span { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px dashed var(--line-2); padding: 5px 12px; border-radius: 99px; max-width: 80%; }
.ev-line .icon { width: 14px; height: 14px; flex: none; }
.ev-line time { font-size: 11px; }
.b-row { display: flex; flex-direction: column; max-width: 72%; margin-top: 6px; }
.b-row.in { align-self: flex-start; align-items: flex-start; }
.b-row.out { align-self: flex-end; align-items: flex-end; }
.b { padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.b.in { background: var(--ig-them); border-bottom-left-radius: 6px; }
.b.out { border-bottom-right-radius: 6px; }
.b.out.bot { background: var(--brand-soft); border: 1px solid var(--brand-soft-line); }
.b.out.human, .b.out.app { background: var(--text); color: var(--bg); }
.b-btn { display: block; margin-top: 8px; padding: 7px 10px; border-radius: 10px; text-align: center; font-weight: 700; font-size: 13px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.b-meta { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); margin-top: 4px; padding: 0 4px; }
.b-err { color: var(--err); font-weight: 700; } .b-test { color: var(--warn); font-weight: 700; }

.composer { border-top: 1px solid var(--line); padding: 12px 20px 16px; background: var(--panel); }
.composer textarea { min-height: 46px; max-height: 160px; resize: none; border-radius: 14px; padding: 12px 14px; }
.composer-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.composer-foot .small { flex: 1; }
.composer-lock { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--warn); background: var(--warn-soft);
  border: 1px solid var(--warn-line); padding: 9px 12px; border-radius: 10px; margin-bottom: 10px; }
.composer-lock .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; }

.ib-side { border-left: 1px solid var(--line); background: var(--panel); padding: 22px 16px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.ib-side:empty { display: block; }
.side-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 6px 0 4px; }
.avatar.big { width: 72px; height: 72px; font-size: 28px; margin-bottom: 6px; box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--brand); }
.side-name { font-size: 16px; }

@media (max-width: 1280px) { .inbox { grid-template-columns: 300px minmax(0, 1fr); } .ib-side { display: none; } }
@media (max-width: 900px) {
  .shell:has(.main-inbox) { display: flex; flex-direction: column; height: 100dvh; }
  .main.main-inbox { flex: 1; min-height: 0; }
  .inbox { grid-template-columns: minmax(0, 1fr); height: 100%; }
  .ib-list, .ib-thread { min-width: 0; }
  .th-head .small { font-size: 11px; }
  .inbox .ib-thread { display: none; }
  .inbox.has-thread .ib-list { display: none; }
  .inbox.has-thread .ib-thread { display: flex; }
  .th-back { display: inline-flex; }
  .th-head { padding: 10px 12px; flex-wrap: wrap; }
  .th-body { padding: 14px; }
  .b-row { max-width: 88%; }
  .composer { padding: 10px 12px 12px; }
}

/* =========================================================
   Modelos prontos
   ========================================================= */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.tpl { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; padding: 20px; position: relative; overflow: hidden; }
.tpl::after { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--brand), transparent); opacity: 0; transition: opacity .15s; }
.tpl:hover::after { opacity: 1; }
.tpl-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.tpl-top .kind-tile { width: 40px; height: 40px; }
.tpl-cat { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tpl h3 { margin: 4px 0 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.tpl p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; flex: 1; }
.tpl-perks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tpl-perks span { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }
.tpl:hover .pick-go { text-decoration: underline; }
.tpl-hint { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 18px; border-radius: 14px;
  background: var(--brand-soft); border: 1px solid var(--brand-soft-line); font-size: 13.5px; }
.tpl-hint .kind-tile { width: 38px; height: 38px; background: var(--panel); }

/* =========================================================
   Moderação
   ========================================================= */
.switch.big { width: 56px; height: 32px; }
.switch.big span::after { width: 24px; height: 24px; left: 4px; top: 4px; }
.switch.big input:checked + span::after { transform: translateX(24px); }
.kpi-sub { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi.hl .kpi-sub { color: rgba(11,15,5,.6); }
.mod-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.mod-grid.is-off .rules { opacity: .55; }
.rules { display: grid; gap: 10px; transition: opacity .15s; }
.rule { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); cursor: pointer; }
.rule.col { flex-direction: column; align-items: stretch; cursor: default; }
.rule b { font-size: 14px; }
.mod-test { margin-top: 12px; font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 24px; }
.mrow { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.table-head + .mrow { border-top: 0; }
.mrow .avatar { width: 38px; height: 38px; background: var(--hover); color: var(--text); border: 1px solid var(--line); }
.mrow.restored { opacity: .6; }
.mtext { font-size: 13px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .mod-grid { grid-template-columns: 1fr; }
  .mrow { grid-template-columns: 38px minmax(0, 1fr); padding: 12px 16px; }
  .mrow .tl-time, .mrow > button, .mrow > span:last-child { grid-column: 2; justify-self: start; }
}

/* =========================================================
   Equipe e permissões
   ========================================================= */
.role-pill { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 99px; white-space: nowrap;
  background: var(--hover); color: var(--text); border: 1px solid var(--line); }
.role-pill.owner { background: var(--brand); color: var(--brand-ink); border-color: var(--brand-strong); }
.role-pill.admin { background: var(--brand-soft); color: var(--accent); border-color: var(--brand-soft-line); }
.role-pill.agent { background: var(--pink-soft); color: var(--pink-text); border-color: var(--pink-soft-line); }
.invite-form { display: grid; grid-template-columns: minmax(0, 1fr) 180px auto; gap: 10px; }
.inv-link { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); border: 1px solid var(--brand-soft-line); font-size: 13px; }
.inv-link code { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-row { grid-template-columns: 38px minmax(0, 1fr) auto auto; }
.team-row .role-sel { width: 160px; padding: 7px 10px; }
.team-row.pending .avatar { background: var(--panel-2); color: var(--muted); }
.team-row.pending .avatar .icon { width: 16px; height: 16px; }
.perm-table { display: grid; font-size: 13px; overflow-x: auto; }
.perm-row { display: grid; grid-template-columns: minmax(200px, 1fr) repeat(5, 96px); align-items: center; border-top: 1px solid var(--line); }
.perm-row > span { padding: 10px 8px; }
.perm-row > span:not(:first-child) { text-align: center; }
.perm-row.head { border-top: 0; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.perm-row .yes { color: var(--ok); font-weight: 800; } .perm-row .no { color: var(--line-2); }
.invite-accept { width: 100%; max-width: 440px; padding: 30px; }
.invite-accept h1 { font-size: 26px; }
.invite-accept .btn { display: flex; }

/* o que o papel não pode, some da tela (o servidor também bloqueia) */
.no-automations a[href="#/automations/new"], .no-automations [data-toggle], .no-automations .switch:has([data-toggle]),
.no-automations .editor-head button, .no-automations .editor-head .primary, .no-automations #mOn, .no-automations .switch.big,
.no-automations #mSave, .no-automations .flow-palette, .no-automations #dmAdd, .no-automations #dmVary { display: none !important; }
.no-automations .mod-grid .rules, .no-automations .mod-grid #mAction { pointer-events: none; opacity: .6; }
.no-automations .editor .card, .no-automations .flow-side { position: relative; }
.no-automations .editor-head::after { content: "Somente leitura: seu papel não permite editar automações"; font-size: 12px; font-weight: 700;
  color: var(--pink-text); background: var(--pink-soft); border: 1px solid var(--pink-soft-line); padding: 6px 12px; border-radius: 99px; }
.no-inbox .composer, .no-inbox #thTake, .no-inbox #thResume { display: none !important; }
.no-export a[href$="contacts.csv"] { display: none !important; }
.no-team .invite-card { display: none !important; }

@media (max-width: 900px) {
  .invite-form { grid-template-columns: 1fr; }
  .team-row { grid-template-columns: 38px minmax(0, 1fr); }
  .team-row > :nth-child(n+3) { grid-column: 2; justify-self: start; }
}

/* =========================================================
   Plano e cobrança
   ========================================================= */
.content-col { min-width: 0; display: flex; flex-direction: column; }
.content-col > .main { flex: 1; }
.bill-banner { display: flex; align-items: center; gap: 12px; padding: 10px 36px; font-size: 13.5px; font-weight: 600;
  background: var(--brand-soft); border-bottom: 1px solid var(--brand-soft-line); }
.bill-banner .icon { width: 18px; height: 18px; flex: none; }
.bill-banner .btn { padding: 6px 12px; font-size: 13px; }
.bill-banner.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.bill-banner.err { background: var(--err-soft); border-color: var(--err-line); color: var(--err); }
.status-chip { font-size: 12px; font-weight: 800; padding: 6px 12px; border-radius: 99px; }
.status-chip.ok { background: var(--ok-soft); color: var(--ok); }
.status-chip.bad { background: var(--err-soft); color: var(--err); }
.bill-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
.meter { margin-bottom: 16px; font-size: 13.5px; }
.meter-bar { height: 8px; border-radius: 99px; background: var(--hover); margin-top: 8px; overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.meter-bar.hot i { background: linear-gradient(90deg, var(--warn), var(--err)); }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 10px; position: relative; padding: 24px; }
.plan h3 { margin: 0; font-size: 18px; font-weight: 800; }
.plan .price { font-size: 38px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.plan .price span { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan .checklist { flex: 1; margin: 6px 0 12px; }
.plan > button { width: 100%; padding: 11px; }
.plan.popular { border-color: var(--brand-strong); box-shadow: 0 0 0 1px var(--brand-strong), var(--shadow-lg); }
.plan.current { border-color: var(--ok); }
.plan-badge { position: absolute; top: -11px; left: 24px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 99px; }
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(5, 6, 4, .55); backdrop-filter: blur(4px); }
.modal[hidden] { display: none; }
.modal-card { width: 100%; max-width: 440px; display: grid; gap: 14px; box-shadow: var(--shadow-lg); }
@media (max-width: 1100px) { .plans { grid-template-columns: 1fr; max-width: 460px; } }
@media (max-width: 900px) {
  .bill-grid { grid-template-columns: 1fr; }
  .bill-banner { padding: 10px 16px; flex-wrap: wrap; }
  .shell:has(.main-inbox) .content-col { flex: 1; min-height: 0; }
}

/* =========================================================
   Minha conta, primeiros passos e administrador
   ========================================================= */
a.user-chip { text-decoration: none; color: inherit; padding: 6px; margin: -6px; border-radius: 10px; }
a.user-chip:hover, a.user-chip.on { background: var(--hover); }
.acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.danger-zone { border-color: var(--err-line); }
.audit-row { grid-template-columns: 38px minmax(0, 1fr) auto 0; }
.onboarding { margin-bottom: 14px; padding: 20px 22px; border-color: var(--brand-soft-line); background:
  linear-gradient(135deg, var(--brand-soft), transparent 60%), var(--panel); }
.small-btn { padding: 5px 10px; font-size: 12px; }
.ob-bar { height: 6px; border-radius: 99px; background: var(--hover); margin: 14px 0 12px; overflow: hidden; }
.ob-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--pink)); }
.ob-steps { display: grid; gap: 6px; }
.ob-step { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.ob-step.next { background: var(--panel-2); border: 1px solid var(--line); }
.ob-step.ok { color: var(--muted); text-decoration: line-through; font-weight: 500; }
.ob-step .btn { padding: 6px 12px; font-size: 13px; }
.ob-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font-size: 12px; font-weight: 900; flex: none; }
.ob-step.ok .ob-dot { background: var(--brand); border-color: var(--brand-strong); color: var(--brand-ink); text-decoration: none; }
.adm-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr) 90px 90px 130px 90px; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.adm-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: var(--panel-2); padding-top: 10px; padding-bottom: 10px; }
.adm-row .menu { min-width: 230px; }
@media (max-width: 900px) {
  .acc-grid { grid-template-columns: 1fr; }
  .adm-head { display: none; }
  .adm-row { grid-template-columns: 1fr 1fr; }
  .adm-row > :first-child { grid-column: 1 / -1; }
}

/* aviso "pode ter caído no spam" */
.spam-hint { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45;
  background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--text); text-align: left; }
.spam-hint b { font-weight: 700; }
