:root {
  --bg: #f5f6f4;
  --surface: #ffffff;
  --surface-2: #f0f2ef;
  --border: #e2e5e0;
  --text: #17201b;
  --muted: #66706a;
  --faint: #98a19b;
  --accent: #128c4a;
  --accent-hover: #0e7a40;
  --accent-soft: #e4f4ea;
  --accent-text: #0d6b39;
  --warn: #a35f00;
  --warn-soft: #fff3dc;
  --danger: #c2372b;
  --danger-soft: #fde9e6;
  --info: #2457c5;
  --info-soft: #e7eefc;
  --chat-bg: #efeae2;
  --bubble: #ffffff;
  --bubble-text: #111b21;
  --bubble-meta: #667781;
  --bubble-btn: #0a7cff;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 4px 16px rgba(16, 24, 20, .04);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412;
    --surface: #161c19;
    --surface-2: #1d2420;
    --border: #2a332e;
    --text: #e6ebe8;
    --muted: #9aa49e;
    --faint: #6c7670;
    --accent: #25b866;
    --accent-hover: #2fcc74;
    --accent-soft: #143222;
    --accent-text: #5fdc95;
    --warn: #f0b04f;
    --warn-soft: #3a2a0e;
    --danger: #f06c5f;
    --danger-soft: #3d1a17;
    --info: #7aa5ff;
    --info-soft: #182644;
    --chat-bg: #0b141a;
    --bubble: #202c33;
    --bubble-text: #e9edef;
    --bubble-meta: #8696a0;
    --bubble-btn: #53bdeb;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 620; }
h3 { font-size: 14px; font-weight: 620; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.brand-mark svg { width: 18px; height: 18px; }
.brand b { display: block; font-size: 14.5px; }
.brand small { color: var(--muted); font-size: 12px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-weight: 520; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.nav a .count { margin-left: auto; font-size: 11.5px; background: var(--surface-2); color: var(--muted); padding: 0 7px; border-radius: 99px; }
.sidebar-foot { margin-top: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.main { min-width: 0; padding: 26px 32px 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0 8px 0 0; }
  .brand div { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { white-space: nowrap; padding: 7px 10px; }
  .nav a .count, .sidebar-foot { display: none; }
  .main { padding: 20px 16px 48px; }
}

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.card-head p { color: var(--muted); font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.split-left { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.step-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1080px) { .split, .split-left { grid-template-columns: 1fr; } }
@media (max-width: 1200px) { .step-grid { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.grow { flex: 1; }
.right { margin-left: auto; }
.hidden { display: none !important; }
.sticky { position: sticky; top: 20px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 560; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg.i { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 32px; padding: 0; height: 32px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 560; font-size: 13px; }
label.field .hint, .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 11px; width: 100%; min-height: 36px; outline: none; transition: border-color .12s, box-shadow .12s; }
textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: 16px; height: 16px; min-height: 0; accent-color: var(--accent); }
input[type=file] { padding: 6px; }
.input-group { display: flex; gap: 6px; }
.input-group > input { flex: 1; min-width: 0; }
.fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 560; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: var(--border); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-soft); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.green { background: var(--accent-soft); color: var(--accent-text); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.chip { display: inline-block; padding: 0 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 12px; margin: 1px 3px 1px 0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; font: inherit; font-weight: 560; color: var(--muted); padding: 9px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--accent-text); border-bottom-color: var(--accent); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.mono { white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 560; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: 12.5px; }

.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty svg.i { width: 30px; height: 30px; color: var(--faint); margin-bottom: 8px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); border: 1px solid transparent; }
.banner svg.i { margin-top: 1px; }
.banner.amber { background: var(--warn-soft); color: var(--warn); }
.banner.green { background: var(--accent-soft); color: var(--accent-text); }
.banner.red { background: var(--danger-soft); color: var(--danger); }
.banner.blue { background: var(--info-soft); color: var(--info); }
.banner b { color: inherit; }
.banner .grow p { color: var(--text); opacity: .85; font-size: 13px; }

.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.bars .bar span { width: 100%; max-width: 28px; background: var(--accent); border-radius: 4px 4px 2px 2px; min-height: 2px; position: relative; }
.bars .bar span.fail { background: var(--danger); border-radius: 0; min-height: 0; }
.bars .bar small { font-size: 10.5px; color: var(--faint); }

.copy-field { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 4px 4px 12px; }
.copy-field code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Passos da configuração ---------- */
.steps { counter-reset: step; }
.step { border-top: 1px solid var(--border); }
.step:first-child { border-top: 0; }
.step-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; user-select: none; }
.step-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 13px; background: var(--surface-2); color: var(--muted); flex: none; }
.step.done .step-num { background: var(--accent); color: #fff; }
.step-head .chev { margin-left: auto; color: var(--faint); transition: transform .15s; }
.step.open .chev { transform: rotate(180deg); }
.step-body { display: none; padding: 0 20px 20px 62px; }
.step.open .step-body { display: flex; flex-direction: column; gap: 14px; }
.step-body ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 860px) { .step-body { padding-left: 20px; } }

/* ---------- Prévia estilo WhatsApp ---------- */
.phone { background: var(--chat-bg); border-radius: var(--radius); padding: 18px 14px; min-height: 220px; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--border); background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 14px 14px; }
.phone-top { display: flex; align-items: center; gap: 10px; margin: -18px -14px 14px; padding: 10px 14px; background: var(--accent); color: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.phone-top .avatar { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.phone-top small { opacity: .85; display: block; font-size: 11.5px; }
.bubble { background: var(--bubble); color: var(--bubble-text); border-radius: 8px; border-top-left-radius: 0; padding: 7px 9px 6px; max-width: 92%; box-shadow: 0 1px .5px rgba(11,20,26,.13); font-size: 14px; line-height: 1.42; white-space: pre-wrap; word-wrap: break-word; }
.bubble .b-head { font-weight: 700; margin-bottom: 3px; }
.bubble .b-foot { color: var(--bubble-meta); font-size: 12.5px; margin-top: 4px; }
.bubble .b-time { float: right; color: var(--bubble-meta); font-size: 11px; margin: 6px 0 -4px 10px; }
.bubble .var { background: var(--info-soft); color: var(--info); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.bubble-btn { background: var(--bubble); color: var(--bubble-btn); max-width: 92%; border-radius: 8px; text-align: center; padding: 8px; font-size: 14px; font-weight: 500; box-shadow: 0 1px .5px rgba(11,20,26,.13); display: flex; align-items: center; justify-content: center; gap: 6px; }
.bubble-btn svg.i { width: 15px; height: 15px; }
.bubble-wrap { display: flex; flex-direction: column; gap: 3px; }
.phone.mini { min-height: 0; padding: 10px; }
.phone.mini .bubble { font-size: 13px; }

/* ---------- Templates ---------- */
.tpl-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.tpl-card { display: flex; flex-direction: column; }
.tpl-card .card-pad { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.tpl-card .name { font-family: var(--mono); font-size: 13px; font-weight: 600; word-break: break-all; }
.tpl-card .reason { color: var(--danger); font-size: 12.5px; }
.batch-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); }
.batch-item:first-child { border-top: 0; }
.batch-item .grow { min-width: 0; }
.batch-item .grow div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-list { display: flex; flex-direction: column; gap: 8px; }
.btn-row { display: grid; grid-template-columns: 130px 1fr 1fr auto; gap: 8px; align-items: center; }
@media (max-width: 700px) { .btn-row { grid-template-columns: 1fr; } }
.var-row { display: grid; grid-template-columns: 56px 1fr 1fr; gap: 8px; align-items: center; }
.var-row .tag { font-family: var(--mono); font-size: 12.5px; color: var(--info); background: var(--info-soft); border-radius: 6px; padding: 6px 0; text-align: center; }
@media (max-width: 700px) { .var-row { grid-template-columns: 56px 1fr; } .var-row > :last-child { grid-column: 2; } }

/* ---------- Sequências ---------- */
.seq-list .item { display: flex; flex-direction: column; gap: 3px; padding: 12px 16px; border-top: 1px solid var(--border); cursor: pointer; }
.seq-list .item:first-child { border-top: 0; }
.seq-list .item:hover { background: var(--surface-2); }
.seq-list .item.active { background: var(--accent-soft); }
.timeline { position: relative; display: flex; flex-direction: column; gap: 0; }
.tl-step { display: grid; grid-template-columns: 36px 1fr; gap: 14px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 13px; flex: none; }
.tl-line { flex: 1; width: 2px; background: var(--border); margin: 4px 0; }
.tl-step:last-child .tl-line { display: none; }
.tl-wait { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 2px 0 10px; flex-wrap: wrap; }
.tl-wait input { width: 80px; min-height: 30px; padding: 4px 8px; }
.tl-wait select { width: auto; min-height: 30px; padding: 4px 8px; }
.tl-card { margin-bottom: 18px; }

/* ---------- Upload ---------- */
.drop { border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 30px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .12s, background .12s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop svg.i { width: 28px; height: 28px; margin-bottom: 6px; }

/* ---------- Modal e toasts ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 14, 12, .45); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .12s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: calc(100vw - 36px); }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-weight: 520; max-width: 420px; animation: fade .15s; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok { background: var(--accent); color: #fff; }

pre.json { margin: 0; padding: 14px; background: var(--surface-2); border-radius: var(--radius-sm); overflow: auto; max-height: 420px; font: 12px/1.5 var(--mono); }
details.event { border-top: 1px solid var(--border); }
details.event:first-child { border-top: 0; }
details.event summary { display: flex; align-items: center; gap: 10px; padding: 12px 18px; cursor: pointer; list-style: none; }
details.event summary::-webkit-details-marker { display: none; }
details.event[open] summary { background: var(--surface-2); }
details.event .body { padding: 12px 18px 16px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 60px; display: grid; place-items: center; color: var(--muted); }

/* ---------- Navegação em grupos ---------- */
.nav-group { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 14px 10px 4px; }
.nav a .count.hot { background: var(--danger); color: #fff; }
@media (max-width: 860px) { .nav-group { display: none; } }

/* ---------- Pílulas (filtros de público, seleção múltipla) ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 99px; padding: 4px 11px; font: inherit; font-size: 13px; cursor: pointer; transition: all .12s; }
.pill:hover { border-color: var(--accent); color: var(--text); }
.pill.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.pill.on.neg { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.rule-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px dashed var(--border); }
.rule-row:first-child { border-top: 0; }
.rule-row > span { font-size: 13px; font-weight: 600; padding-top: 4px; }
@media (max-width: 700px) { .rule-row { grid-template-columns: 1fr; gap: 6px; } }
.audience-count { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-text); }
.audience-count b { font-size: 20px; }

/* ---------- Conversas ---------- */
.inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr) 280px; height: calc(100vh - 140px); min-height: 520px; overflow: hidden; }
.inbox > * { min-height: 0; }
.inbox-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.inbox-list .head { padding: 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.inbox-list .items { overflow-y: auto; flex: 1; }
.conv-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; text-decoration: none; color: inherit; }
.conv-item:hover { background: var(--surface-2); }
.conv-item.active { background: var(--accent-soft); }
.conv-item .grow { min-width: 0; }
.conv-item .preview { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item .dot { min-width: 20px; height: 20px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.avatar-c { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 14px; }
.chat { display: flex; flex-direction: column; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px 16px; background: var(--chat-bg); background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: min(76%, 560px); padding: 7px 10px 5px; border-radius: 8px; font-size: 14px; line-height: 1.42; word-wrap: break-word; box-shadow: 0 1px .5px rgba(11,20,26,.13); color: var(--bubble-text); }
.msg.in { background: var(--bubble); align-self: flex-start; border-top-left-radius: 0; }
.msg.out { background: #d9fdd3; align-self: flex-end; border-top-right-radius: 0; }
@media (prefers-color-scheme: dark) { .msg.out { background: #005c4b; } }
.msg .txt { white-space: pre-wrap; }
.msg .meta { display: flex; justify-content: flex-end; gap: 6px; font-size: 11px; color: var(--bubble-meta); margin-top: 2px; align-items: center; }
.msg .who { font-size: 11px; font-weight: 700; color: var(--accent-text); margin-bottom: 2px; }
.msg.out .who { color: var(--bubble-meta); }
.msg.failed { outline: 1.5px solid var(--danger); }
.msg img { max-width: 260px; border-radius: 6px; display: block; }
.day-sep { align-self: center; background: var(--surface); color: var(--muted); font-size: 12px; padding: 3px 10px; border-radius: 8px; box-shadow: var(--shadow); margin: 6px 0; }
.composer { border-top: 1px solid var(--border); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.composer textarea { min-height: 44px; max-height: 160px; resize: none; }
.draft { border: 1px dashed var(--info); background: var(--info-soft); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; color: var(--text); }
.chat-side { border-left: 1px solid var(--border); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.chat-side h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.kv { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.kv div { display: flex; justify-content: space-between; gap: 10px; }
.kv div span:first-child { color: var(--muted); }
@media (max-width: 1250px) { .inbox { grid-template-columns: 300px minmax(0, 1fr); } .chat-side { display: none; } }
@media (max-width: 860px) {
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox.has-chat .inbox-list { display: none; }
  .inbox:not(.has-chat) .chat { display: none; }
  .chat-body { min-height: 55vh; }
}

/* ---------- Perfil ---------- */
.profile { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .profile { grid-template-columns: 1fr; } }
.timeline-list { display: flex; flex-direction: column; }
.timeline-list .it { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; }
.timeline-list .it:first-child { border-top: 0; }
.timeline-list .ic { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; flex: none; }
.timeline-list .ic svg.i { width: 14px; height: 14px; }

/* ---------- Agenda ---------- */
.event-card { display: grid; grid-template-columns: 74px 1fr auto; gap: 16px; align-items: center; }
.date-box { width: 74px; border-radius: 12px; border: 1px solid var(--border); text-align: center; overflow: hidden; }
.date-box .m { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 3px 0; }
.date-box .d { font-size: 26px; font-weight: 700; padding: 4px 0 0; line-height: 1.1; }
.date-box .t { font-size: 12px; color: var(--muted); padding-bottom: 6px; }
@media (max-width: 700px) { .event-card { grid-template-columns: 64px 1fr; } .event-card > :last-child { grid-column: 1 / -1; } }

/* ---------- Ajuda ---------- */
.guide h2 { margin: 6px 0 2px; }
.guide p, .guide li { color: var(--text); line-height: 1.6; }
.guide ul, .guide ol { margin: 6px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.guide .card-pad { display: flex; flex-direction: column; gap: 10px; }
.glossary { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.glossary .card-pad b { display: block; margin-bottom: 4px; }
.chat-head .grow > * { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Arquivos ---------- */
.bubble .b-media { display: block; width: calc(100% + 12px); margin: -4px -6px 6px; border-radius: 6px; max-height: 260px; object-fit: cover; }
.bubble .b-ph, .bubble .b-doc { height: 120px; display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.bubble .b-doc { height: 56px; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; max-height: 52vh; overflow: auto; }
.file-card { border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; color: var(--text); }
.file-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.file-card img, .file-card .file-ic { width: 100%; height: 96px; object-fit: cover; border-radius: 5px; background: var(--surface-2); }
.file-card span.small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-ic { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.file-ic svg.i { width: 26px; height: 26px; }
.file-pill { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.file-pill img, .file-pill .file-ic { width: 48px; height: 48px; object-fit: cover; border-radius: 5px; background: var(--surface-2); }

/* ---------- Funil (kanban) ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: 60vh; }
.col { flex: 0 0 272px; background: var(--surface-2); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 230px); border: 1px solid var(--border); }
.col-head { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--border); }
.col-head .row-between b { display: flex; align-items: center; gap: 8px; }
.col-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 80px; flex: 1; }
.col.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 10px; cursor: grab; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .4; }
.kcard .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcard select { min-height: 26px; padding: 2px 6px; font-size: 12px; }
.stage-edit { display: grid; grid-template-columns: 34px 1fr 180px 1fr auto; gap: 8px; align-items: center; }
.stage-edit input[type=color] { width: 34px; height: 34px; padding: 2px; min-height: 0; }
@media (max-width: 760px) { .stage-edit { grid-template-columns: 34px 1fr; } .stage-edit > :nth-child(n+3) { grid-column: 1 / -1; } }

/* ---------- Respostas prontas ---------- */
.qr-pop { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; }
.qr-item { text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); padding: 8px 10px; font: inherit; color: var(--text); cursor: pointer; }
.qr-item:hover, .qr-item.on { background: var(--accent-soft); }
.qr-item .small { color: var(--muted); }

/* ---------- Campos adicionais ---------- */
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.field-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field-val { min-height: 22px; outline: none; border-radius: 4px; padding: 2px 4px; margin: 0 -4px; word-break: break-word; font-size: 14px; }
.field-val:hover { background: var(--surface-2); }
.field-val:focus { background: var(--surface-2); box-shadow: 0 0 0 2px var(--accent-soft); }
.field-val:empty::before { content: attr(data-placeholder); color: var(--faint); }

/* ---------- Tema "Grafite e amarelo" (aprovado em 2026-11-03) ----------
   Ligado por <html data-tema="amarelo"> no index.html. */
html[data-tema="amarelo"] {
  --bg: #0c120f;
  --surface: #121b16;
  --surface-2: #18231d;
  --border: #26342c;
  --text: #f1f4f2;
  --muted: #a3ada7;
  --faint: #6f7a74;
  --accent: #f5c518;
  --accent-hover: #ffd43b;
  --accent-soft: #2a2610;
  --accent-text: #f5c518;
  --chat-bg: #0a100d;
  --bubble: #1b2620;
  --bubble-text: #eef2ef;
  --bubble-meta: #8d9892;
  --shadow: none;
  --radius: 10px;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif;
  color-scheme: dark;
}
html[data-tema="amarelo"] body {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 32px 32px;
  background-attachment: fixed;
}
html[data-tema="amarelo"] .sidebar { background: #0a0f0c; border-right-color: #1d2822; }
html[data-tema="amarelo"] .nav a { position: relative; color: #c9d0cc; font-weight: 500; }
html[data-tema="amarelo"] .nav a:hover { background: transparent; color: var(--text); }
html[data-tema="amarelo"] .nav a.active { background: transparent; color: var(--accent); }
html[data-tema="amarelo"] .nav a.active::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
html[data-tema="amarelo"] .brand-mark { background: var(--accent); color: #111; }
html[data-tema="amarelo"] .card { background: rgba(22, 34, 28, .78); border-color: #2a3a31; }
html[data-tema="amarelo"] .stat .value { font-weight: 600; }
html[data-tema="amarelo"] .btn-primary,
html[data-tema="amarelo"] .btn-primary:hover { color: #14120a; font-weight: 650; }
html[data-tema="amarelo"] .pill.on { background: var(--accent-soft); border-color: #5a4d12; color: var(--accent); }
html[data-tema="amarelo"] .tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
html[data-tema="amarelo"] input, html[data-tema="amarelo"] select, html[data-tema="amarelo"] textarea { background: #0f1713; border-color: #26342c; color: var(--text); }

/* Desenho do funil (sequências) */
.flow { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding-bottom: 4px; }
.flow-node { display: flex; gap: 10px; align-items: flex-start; min-width: 190px; max-width: 240px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.flow-node > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.flow-node b { font-size: 13px; font-weight: 600; line-height: 1.35; }
.flow-node svg.i { color: var(--accent); margin-top: 2px; }
.flow-node.trigger { border-color: var(--accent); }
.flow-node.end { min-width: 0; align-items: center; }
.flow-edge { position: relative; flex: none; width: 92px; display: flex; align-items: center; justify-content: center; }
.flow-edge::before { content: ""; position: absolute; left: 6px; right: 10px; top: 50%; border-top: 2px dashed var(--border); }
.flow-edge::after { content: ""; position: absolute; right: 4px; top: calc(50% - 5px); border: 5px solid transparent; border-left-color: var(--muted); }
.flow-edge span { position: relative; background: var(--surface); padding: 1px 6px; border-radius: 99px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---------- Instagram (comentário → DM) ---------- */
.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ig-thumb { border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 0; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; text-align: left; color: var(--text); }
.ig-thumb img, .ig-thumb > span { width: 100%; aspect-ratio: 1; object-fit: cover; display: grid; place-items: center; color: var(--faint); }
.ig-thumb small { font-size: 11px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-thumb.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ig-phone { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; box-shadow: var(--shadow); }
.ig-top { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.ig-av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; background: linear-gradient(45deg, #f09433, #dc2743 55%, #bc1888); flex: none; }
.ig-av.sm { width: 22px; height: 22px; font-size: 10px; }
.ig-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 650; margin-top: 4px; }
.ig-comment { display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.ig-comment.reply { margin-left: 26px; }
.ig-dm { background: var(--surface-2); border-radius: 16px; border-bottom-left-radius: 4px; padding: 9px 11px; max-width: 88%; white-space: pre-wrap; line-height: 1.42; display: flex; flex-direction: column; gap: 8px; }
.ig-dm.me { align-self: flex-end; background: #3d5afe; color: #fff; border-radius: 16px; border-bottom-right-radius: 4px; }
.ig-btn { background: var(--surface); border-radius: 10px; text-align: center; padding: 7px; font-weight: 600; color: var(--info); display: flex; align-items: center; justify-content: center; gap: 5px; }
.ig-btn svg.i { width: 14px; height: 14px; }

/* ---------- Fluxos (editor visual) ---------- */
.fx-tpl { text-align: left; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; font: inherit; color: var(--text); }
.fx-tpl:hover { border-color: var(--accent); }
.fx-name { font-size: 20px; font-weight: 700; border: 1px solid transparent; background: transparent; padding: 2px 6px; border-radius: 6px; min-width: 0; max-width: 420px; color: var(--text); }
.fx-name:hover, .fx-name:focus { border-color: var(--border); background: var(--surface); }
.fx-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; height: calc(100vh - 150px); min-height: 520px; }
.fx-canvas { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); background-image: radial-gradient(color-mix(in srgb, var(--faint) 35%, transparent) 1px, transparent 1px); background-size: 22px 22px; cursor: grab; touch-action: none; }
.fx-canvas.panning { cursor: grabbing; }
.fx-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.fx-edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.fx-edges path { fill: none; stroke: var(--accent); stroke-width: 2; }
.fx-edges path.muted { stroke: var(--faint); stroke-dasharray: 5 4; }
.fx-edges path.temp { stroke: var(--info); stroke-dasharray: 4 3; }
.fx-node { position: absolute; width: 240px; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--c); border-radius: 10px; box-shadow: var(--shadow); cursor: default; user-select: none; }
.fx-node.on { box-shadow: 0 0 0 2px var(--c), var(--shadow); }
.fx-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: 13px; cursor: move; border-bottom: 1px solid var(--border); }
.fx-head b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-head svg.i { width: 15px; height: 15px; color: var(--c); }
.fx-body { padding: 8px 10px; font-size: 12.5px; line-height: 1.4; color: var(--text); white-space: pre-wrap; word-break: break-word; max-height: 120px; overflow: hidden; }
.fx-outs { border-top: 1px solid var(--border); }
.fx-out { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 4px 0 4px 10px; font-size: 12px; position: relative; }
.fx-out + .fx-out { border-top: 1px dashed var(--border); }
.fx-out span { flex: 1; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-out.muted { color: var(--faint); }
.fx-port { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); background: var(--surface); margin-right: -7px; cursor: crosshair; flex: none; }
.fx-port.linked { background: var(--accent); }
.fx-out.muted .fx-port { border-color: var(--faint); }
.fx-out.muted .fx-port.linked { background: var(--faint); }
.fx-in { position: absolute; left: -7px; top: 14px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--c); background: var(--surface); }
.fx-num { font-size: 11px; background: var(--info-soft); color: var(--info); border-radius: 99px; padding: 0 6px; display: inline-flex; align-items: center; gap: 3px; font-weight: 650; }
.fx-num svg.i { width: 11px; height: 11px; }
.fx-here { display: block; margin-top: 6px; border: 0; border-radius: 6px; background: var(--warn-soft); color: var(--warn); font: inherit; font-size: 11.5px; font-weight: 650; padding: 2px 6px; cursor: pointer; }
.fx-left { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.fx-left .fx-canvas { flex: 1; }
.fx-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fx-tools .btn { background: var(--surface); }
.fx-zoom { position: absolute; right: 10px; top: 10px; z-index: 3; display: flex; gap: 4px; }
.fx-zoom .btn { background: var(--surface); }
.fx-mini { position: absolute; right: 10px; bottom: 10px; z-index: 3; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 4px; cursor: pointer; }
.fx-mini rect { fill: var(--faint); opacity: .5; }
.fx-mini rect.vp { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 1; }
.fx-panel { overflow: auto; }
.fx-row { display: flex; gap: 6px; align-items: center; }
.fx-row input, .fx-row select { min-width: 0; flex: 1; }
.fx-card { border: 1px solid var(--border); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 1100px) { .fx-wrap { grid-template-columns: 1fr; height: auto; } .fx-canvas { height: 560px; } }
a.pill { text-decoration: none; }

/* =====================================================================
   Área "Instagram (Direct)" — o nosso ManyChat próprio.
   Tema claro medido no ManyChat (02tab_telas.md / 06_design_system.md):
   fundo #F5F5F5, cards brancos sem sombra, azul de ação #006BE2, Inter, raio 6 px.
   Ligado por <html class="mc"> (o app tira o data-tema amarelo nessa área).
   ===================================================================== */
html.mc {
  --bg: #F5F5F5; --surface: #FFFFFF; --surface-2: #EFEFEF; --border: #D6D6D6;
  --text: #292929; --muted: #707070; --faint: #878787;
  --accent: #006BE2; --accent-hover: #0058BC; --accent-soft: #E6F0FD; --accent-text: #006BE2;
  --warn: #BB4F00; --warn-soft: #FFF1E5; --danger: #D52B0D; --danger-soft: #FDE8E4;
  --info: #006BE2; --info-soft: #E6F0FD;
  --chat-bg: #F5F5F5; --bubble: #FFFFFF; --bubble-text: #292929; --bubble-meta: #878787; --bubble-btn: #006BE2;
  --shadow: none; --radius: 8px; --radius-sm: 6px;
  --font: "Inter", "InterVariable", Helvetica, Arial, sans-serif;
  color-scheme: light;
}
html.mc body { background: var(--bg); color: var(--text); font-size: 14px; }
html.mc input, html.mc select, html.mc textarea { background: #fff; border-color: var(--border); color: var(--text); border-radius: 6px; }
html.mc .btn { height: 32px; border-radius: 6px; font-weight: 500; }
html.mc .btn-sm { height: 28px; }
html.mc .btn-primary { background: #006BE2; border-color: #006BE2; color: #fff; }
html.mc .btn-primary:hover { background: #0058BC; border-color: #0058BC; }
html.mc .card { border-color: transparent; }
html.mc .page-head h1, html.mc .mc-h1 { font-size: 20px; font-weight: 700; color: #151515; }
html.mc .ig-tabs { display: none; }
html.mc .pill.on { background: #E6F0FD; border-color: #006BE2; color: #006BE2; }
html.mc a { color: #006BE2; }
html.mc .badge.green { background: #DEFFE6; color: #0C8143; }
html.mc .fx-canvas { background-color: #F5F5F5; }
html.mc .fx-node { border-radius: 12px; }

/* Esqueleto: barra de ícones (48 px) + faixa escura + cabeçalho branco */
.mc-shell { display: grid; grid-template-columns: 48px 1fr; min-height: 100vh; }
.mc-rail { position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid #D6D6D6; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; z-index: 20; }
.mc-logo { width: 30px; height: 30px; border-radius: 7px; background: #151515; color: #fff !important; display: grid; place-items: center; margin-bottom: 6px; }
.mc-logo svg.i { width: 17px; height: 17px; }
.mc-switch { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #DEFFE6; color: #0C8143 !important; margin-bottom: 8px; }
.mc-switch svg.i { width: 15px; height: 15px; }
.mc-nav { display: flex; flex-direction: column; gap: 4px; }
.mc-nav a, .mc-iconbtn { position: relative; width: 36px; height: 36px; border-radius: 6px; display: grid; place-items: center; color: #292929 !important; background: transparent; border: 0; cursor: pointer; }
.mc-nav a:hover, .mc-iconbtn:hover { background: #EFEFEF; }
.mc-nav a.active { background: #E1E1E1; }
.mc-nav svg.i, .mc-iconbtn svg.i { width: 19px; height: 19px; stroke-width: 1.6; }
.mc-dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: #006BE2; font-size: 0; }
.mc-dot.hot { background: #D52B0D; }
.mc-rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
[data-tip] { position: relative; }
.mc-rail [data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 42px; top: 50%; transform: translateY(-50%); background: #292929; color: #fff; font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 4px; white-space: nowrap; pointer-events: none; z-index: 50; }
.mc-body { min-width: 0; display: flex; flex-direction: column; }
.mc-topbar { background: #292929; color: #fff; font-size: 13px; display: flex; align-items: center; gap: 10px; padding: 8px 16px; }
.mc-topbar span { flex: 1; display: flex; align-items: center; gap: 8px; }
.mc-topbar svg.i { width: 15px; height: 15px; color: #F5B651; }
.mc-topbar a { color: #6FA8FF !important; }
.mc-x { background: none; border: 0; color: #fff; cursor: pointer; display: grid; place-items: center; }
.mc-x svg.i { width: 16px; height: 16px; }
.mc-head { background: #fff; border-bottom: 1px solid #D6D6D6; height: 56px; padding: 0 30px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 10; }
.mc-head h1 { font-size: 25px; font-weight: 600; color: #292929; letter-spacing: -.01em; }
.mc-main { padding: 28px 30px 60px; min-width: 0; }

/* Chave de área (WhatsApp × Instagram) */
.mode-switch { display: flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); margin: 0 4px 14px; }
.mode-switch a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 8px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--muted) !important; text-decoration: none; white-space: nowrap; }
.mode-switch a svg.i { width: 14px; height: 14px; }
.mode-switch a.on { background: var(--surface); color: var(--text) !important; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.mc-head .mode-switch { margin: 0; background: #F5F5F5; border-color: #E1E1E1; }
.mc-head .mode-switch a.on { color: #006BE2 !important; }
html[data-tema="amarelo"] .mode-switch a.on { color: var(--accent) !important; }

/* Inicial */
.mc-center { max-width: 826px; margin: 0 auto; }
.mc-promo { background: #151515; color: #fff; border-radius: 6px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.mc-promo b { display: block; font-size: 16px; }
.mc-promo span { color: #B5B5B5; font-size: 12.5px; }
.mc-promo-ic { width: 38px; height: 38px; border-radius: 8px; background: #000; border: 1px solid #333; display: grid; place-items: center; }
.mc-btn-teal { background: #399A82; color: #fff !important; text-decoration: none; border-radius: 99px; padding: 7px 14px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.mc-btn-black { background: #151515; color: #fff; border: 0; border-radius: 6px; height: 32px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; cursor: pointer; }
.mc-hello { font-size: 44px; font-weight: 900; color: #151515; letter-spacing: -.02em; line-height: 1.1; }
.mc-sub { font-size: 12.5px; color: #292929; margin-top: 6px; }
.mc-sec { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 34px 0 12px; }
.mc-sec h2 { font-size: 22px; font-weight: 700; color: #151515; }
.mc-sec > a { font-size: 12.5px; }
.mc-grid2, .mc-grid3, .mc-grid4 { display: grid; gap: 12px; }
.mc-grid2 { grid-template-columns: repeat(2, 1fr); } .mc-grid3 { grid-template-columns: repeat(3, 1fr); } .mc-grid4 { grid-template-columns: repeat(4, 1fr); }
.mc-card { background: #fff; border: 1px solid transparent; border-radius: 6px; }
.mc-pad { padding: 14px 16px; }
.mc-muted { color: #707070; }
.mc-tpl { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; padding: 14px; min-height: 70px; text-decoration: none; color: #292929 !important; font: inherit; text-align: left; cursor: pointer; }
.mc-tpl:hover { border-color: #D6D6D6; }
.mc-tpl b { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.mc-tpl.big b { font-size: 16px; }
.mc-tpl-foot { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: #707070; }
.mc-tpl-foot svg.i { width: 12px; height: 12px; }
.mc-pop { margin-left: auto; background: #BB4F00; color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: .03em; padding: 1px 4px; border-radius: 2px; }
.mc-pop.ai { background: #7F53E0; }
.mc-cardtitle { display: block; font-size: 13.5px; font-weight: 600; margin-top: 2px; line-height: 1.35; }
.mc-progress { height: 8px; background: #E8E8E8; border-radius: 4px; margin: 14px 0 6px; overflow: hidden; }
.mc-progress i { display: block; height: 100%; background: #006BE2; border-radius: 4px; }
.mc-check { display: flex; align-items: center; gap: 8px; border: 1px solid #D6D6D6; border-radius: 6px; padding: 7px 10px; font-size: 12.5px; color: #292929 !important; text-decoration: none; }
.mc-check > span { width: 16px; height: 16px; border: 1px solid #B5B5B5; border-radius: 50%; display: grid; place-items: center; flex: none; }
.mc-check > span svg.i { width: 11px; height: 11px; }
.mc-check.ok { background: #EFEFEF; color: #878787 !important; text-decoration: line-through; }
.mc-check.ok > span { border: 0; }
.mc-big { display: block; font-size: 26px; font-weight: 700; margin-top: 4px; }

/* Automação: submenu interno + lista */
.mc-withsub { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; align-items: start; }
.mc-subnav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; }
.mc-subnav a { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 6px; color: #292929 !important; text-decoration: none; font-size: 13px; }
.mc-subnav a svg.i { width: 13px; height: 13px; color: #707070; }
.mc-subnav a:hover { background: #EFEFEF; }
.mc-subnav a.on { background: #DADADA; }
.mc-subnav.cfg b { font-size: 12.5px; font-weight: 700; margin: 12px 8px 4px; }
.mc-subnav.cfg b:first-child { margin-top: 0; }
.mc-list { max-width: 810px; margin: 0 auto; }
.mc-list.wide { max-width: 1100px; }
.mc-filters { margin-bottom: 18px; }
.mc-filters input, .mc-filters select { height: 32px; width: auto; min-width: 190px; font-size: 13px; }
.mc-thead { display: flex; align-items: center; gap: 12px; padding: 0 16px 8px; font-size: 12px; color: #707070; font-weight: 500; }
.mc-thead [data-s] { cursor: pointer; }
.mc-thead .num, .mc-rowhead .num, .mc-trig .num { width: 72px; text-align: right; flex: none; }
.mc-thead .mod, .mc-rowhead .mod { width: 92px; flex: none; font-size: 12.5px; }
.mc-resp { width: 240px; flex: none; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-row { display: block; background: #fff; border: 1px solid transparent; border-radius: 6px; padding: 14px 16px; margin-bottom: 12px; text-decoration: none; color: #292929 !important; cursor: pointer; }
.mc-row:hover { border-color: #D6D6D6; }
.mc-rowhead { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.mc-rowhead b { font-weight: 600; }
.mc-badge { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; padding: 1px 5px; border-radius: 3px; margin-right: 6px; vertical-align: 1px; }
.mc-badge.live { background: #D52B0D; color: #fff; }
.mc-badge.stopped { background: #EFEFEF; color: #707070; }
.mc-badge.draft { border: 1px solid #D6D6D6; color: #878787; }
.mc-trig { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 12px; color: #707070; }
.mc-trig.off { opacity: .55; }
.mc-ig { width: 13px; height: 13px; flex: none; border-radius: 4px; background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.mc-chip { display: inline-block; border: 1px solid #C2DBFF; background: #F0F6FF; color: #006BE2; border-radius: 4px; font-size: 11px; padding: 0 5px; margin: 1px 2px 1px 0; }
.mc-off { background: #5A5A5A; color: #fff; font-size: 10px; font-weight: 600; border-radius: 99px; padding: 1px 7px; }
.mc-state { display: inline-block; font-size: 12px; color: #707070; background: #EFEFEF; border-radius: 4px; padding: 2px 8px; }
.mc-state.on { background: #DEFFE6; color: #0C8143; }

/* Básico: card com texto à esquerda e ilustração salmão quadriculada à direita */
.mc-basic { display: grid; grid-template-columns: 1fr 260px; overflow: hidden; min-height: 150px; }
.mc-basic-txt { padding: 18px 20px; }
.mc-basic-txt b { font-size: 16px; font-weight: 700; }
.mc-basic-txt p { margin-top: 6px; font-size: 13px; }
.mc-basic-art { background-color: #F8B4A0; background-image: linear-gradient(rgba(255,255,255,.25) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.25) 1px, transparent 1px); background-size: 18px 18px; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 20px; }
.mc-basic-art i { display: block; height: 22px; background: #fff; border-radius: 11px 11px 11px 3px; width: 70%; }
.mc-basic-art i:nth-child(2) { width: 50%; align-self: flex-end; background: #0084FF; border-radius: 11px 11px 3px 11px; }
.mc-basic-art i:nth-child(3) { width: 60%; }

/* Estado vazio */
.mc-empty { text-align: center; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mc-empty h2 { font-size: 20px; font-weight: 700; }
.mc-empty p { max-width: 460px; font-size: 13px; }
.mc-empty-art { display: flex; gap: 6px; margin-bottom: 8px; }
.mc-empty-art i { width: 46px; height: 32px; border-radius: 14px 14px 14px 4px; background: #5CE1E6; }
.mc-empty-art i:nth-child(2) { background: #7F53E0; transform: translateY(10px); }
.mc-empty-art i:nth-child(3) { background: #8BEEA8; }

/* Modelos */
.mc-tplwrap { display: flex; gap: 20px; min-height: 420px; }
.mc-tplnav { width: 200px; flex: none; display: flex; flex-direction: column; gap: 2px; }
.mc-tplnav b { font-size: 12.5px; margin: 12px 8px 2px; }
.mc-tplnav a { padding: 5px 8px; border-radius: 6px; cursor: pointer; color: #292929 !important; font-size: 13px; }
.mc-tplnav a.on, .mc-tplnav a:hover { background: #EFEFEF; }
html.mc .modal.wide { max-width: 980px; }

/* Contatos / Configurações */
.mc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mc-table th { text-align: left; font-size: 12px; font-weight: 500; color: #707070; padding: 10px 14px; border-bottom: 1px solid #EFEFEF; }
.mc-table td { padding: 10px 14px; border-bottom: 1px solid #EFEFEF; vertical-align: middle; }
.mc-table tr[data-c] { cursor: pointer; } .mc-table tr[data-c]:hover td { background: #FAFAFA; }
.mc-av { width: 30px; height: 30px; border-radius: 50%; background: #E6F0FD; color: #006BE2; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.mc-setrow { display: grid; grid-template-columns: 220px 300px 1fr; gap: 20px; align-items: center; padding: 16px 20px; border-bottom: 1px solid #EFEFEF; }
.mc-setrow:last-child { border-bottom: 0; }
.mc-setrow b { font-size: 13.5px; font-weight: 600; }
.mc-setrow p { font-size: 12.5px; }
.mc-setrow code { font-size: 12px; word-break: break-all; }

@media (max-width: 900px) {
  .mc-withsub { grid-template-columns: 1fr; } .mc-subnav { position: static; flex-direction: row; flex-wrap: wrap; }
  .mc-grid3, .mc-grid4, .mc-grid2 { grid-template-columns: 1fr 1fr; } .mc-basic { grid-template-columns: 1fr; } .mc-basic-art { display: none; }
  .mc-setrow { grid-template-columns: 1fr; gap: 6px; } .mc-head .mode-switch a { font-size: 0; gap: 0; }
}
html.mc a { text-decoration: none; }
html.mc a:hover { text-decoration: underline; }
html.mc .mc-row, html.mc .mc-row:hover, html.mc .mc-tpl:hover, html.mc .mc-check:hover, html.mc .btn:hover, html.mc .mc-nav a:hover, html.mc .mc-subnav a:hover, html.mc .mode-switch a:hover { text-decoration: none; }
