/* ============ Tema: branco dominante, azul de destaque, preto no texto ============ */
:root {
  --brand: #2563eb;
  --brand-50: color-mix(in srgb, var(--brand) 7%, #fff);
  --brand-100: color-mix(in srgb, var(--brand) 14%, #fff);
  --brand-600: color-mix(in srgb, var(--brand) 85%, #000);
  --ink: #0b0d12; --text: #1a1d24; --muted: #6b7280; --faint: #9aa1ad;
  --line: #eceef2; --line-2: #e2e5ea; --bg: #fff; --soft: #f7f8fa;
  --ok: #16a34a; --warn: #d97706; --bad: #dc2626;
  --r: 10px; --r-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px -6px rgba(16, 24, 40, .08);
  --shadow-lg: 0 24px 60px -12px rgba(16, 24, 40, .22);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--brand-100); }
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -.015em; margin: 0; }
code, pre { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-size: 12px; }
code { background: var(--soft); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
pre { background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin: 8px 0; }
pre.code { background: #0b0d12; color: #d6e2ff; border-color: #0b0d12; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { margin-left: auto; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.late { color: var(--bad); font-weight: 500; } .done { text-decoration: line-through; color: var(--faint); }

/* Ícones (Lucide via mask: herdam a cor do texto) */
.ic { width: 16px; height: 16px; display: inline-block; flex: none; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; vertical-align: -3px; }

/* ============ Shell ============ */
.layout { display: grid; grid-template-columns: 244px 1fr; height: 100vh; }
.side { border-right: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; padding: 18px 12px 12px; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink); padding: 2px 8px 18px; font-size: 15px; }
.logo img { height: 26px; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; box-shadow: 0 4px 12px -4px var(--brand); flex: none; }
.logo-mark .ic { width: 17px; height: 17px; }
.logo-mark.sm { width: 32px; height: 32px; border-radius: 9px; box-shadow: none; }
.nav h6 { margin: 18px 10px 6px; font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.side a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: var(--r-sm); color: #4b5160; font-weight: 450; transition: background .15s, color .15s; }
.side a .ic { color: #8a909c; transition: color .15s; }
.side a:hover { background: var(--soft); color: var(--ink); }
.side a:hover .ic { color: var(--ink); }
.side a.on { background: var(--brand-50); color: var(--brand-600); font-weight: 550; }
.side a.on .ic { color: var(--brand); }
.side .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 6px 2px; }
.me > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me b { font-size: 13px; color: var(--ink); } .me span { font-size: 12px; color: var(--muted); }
.me .icon-btn { margin-left: auto; }
.main { overflow: auto; display: flex; flex-direction: column; background: var(--bg); }
.top { display: flex; align-items: center; gap: 10px; padding: 14px 28px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(10px); }
.top h1 { font-size: 17px; font-weight: 650; flex: 1; }
.content { padding: 24px 28px 40px; flex: 1; min-height: 0; }
.content.flush { padding: 0; }
.content.enter > * { animation: rise .35s var(--ease) both; }
.content.enter > *:nth-child(2) { animation-delay: .04s; } .content.enter > *:nth-child(3) { animation-delay: .08s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.loading { display: grid; place-items: center; padding: 80px 0; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--brand-100); border-top-color: var(--brand); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#menu { display: none; }

/* ============ Controles ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--brand); color: #fff; border: 1px solid transparent; border-radius: var(--r-sm); padding: 8px 14px; cursor: pointer; font-weight: 550; font-size: 13px; white-space: nowrap; transition: background .15s, transform .1s, box-shadow .15s; box-shadow: 0 1px 2px rgba(37, 99, 235, .25), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn:hover { background: var(--brand-600); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--bg); color: var(--text); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { background: var(--soft); border-color: #d5d9e0; }
.btn.dark { background: var(--ink); box-shadow: none; } .btn.dark:hover { background: #262a33; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm); border: 0; background: transparent; color: #5b6170; cursor: pointer; transition: background .15s, color .15s; flex: none; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.icon-btn.on { background: var(--brand-50); color: var(--brand); }
.icon-btn.danger:hover { color: var(--bad); background: #fef2f2; }
.icon-btn.primary { background: var(--brand); color: #fff; } .icon-btn.primary:hover { background: var(--brand-600); }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--bg); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; cursor: pointer; font-weight: 500; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--brand); font-weight: 550; font-size: 13px; cursor: pointer; padding: 6px 0; }
input, select, textarea { width: 100%; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg); outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
textarea { resize: vertical; min-height: 40px; }
select.compact { width: auto; padding: 6px 30px 6px 10px; font-size: 13px; }
input[type=color] { padding: 3px; height: 36px; cursor: pointer; }
input[type=checkbox] { width: auto; accent-color: var(--brand); }
label { display: block; font-size: 12.5px; font-weight: 550; color: #3d4250; margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.field.inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field.inline label { margin: 0; }
.field .muted { font-size: 12px; margin-top: 5px; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; margin: 0; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #d7dbe2; border-radius: 99px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 99px; padding: 4px 11px; font-weight: 450; margin: 0; cursor: pointer; font-size: 12.5px; }
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-50); color: var(--brand-600); }
.round-check { position: relative; display: inline-block; width: 18px; height: 18px; margin: 0; cursor: pointer; }
.round-check input { opacity: 0; position: absolute; }
.round-check span { position: absolute; inset: 0; border: 1.5px solid #c5cad3; border-radius: 50%; transition: all .15s; }
.round-check input:checked + span { background: var(--brand); border-color: var(--brand); }
.round-check input:checked + span::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.search { position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 11px; color: var(--faint); }
.search input { padding-left: 34px; min-width: 240px; }
.search.sm input { min-width: 160px; }
.search.pad { padding: 14px 14px 6px; } .search.pad .ic { left: 25px; } .search.pad input { min-width: 0; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar > p { margin: 0; max-width: 680px; }

/* ============ Blocos ============ */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow-sm); }
.card-title { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.card-title .ic { color: var(--brand); }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.stack { display: grid; gap: 12px; }
.chip-ic { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--brand-50); color: var(--brand); flex: none; }
.chip-ic .ic { width: 18px; height: 18px; }
.chip-ic.sm { width: 30px; height: 30px; border-radius: 8px; } .chip-ic.sm .ic { width: 15px; height: 15px; }
.chip-ic.xs { width: 24px; height: 24px; border-radius: 7px; } .chip-ic.xs .ic { width: 13px; height: 13px; }
.stat { display: flex; gap: 14px; align-items: center; padding: 16px 18px; transition: transform .2s var(--ease), box-shadow .2s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .n { font-size: 22px; font-weight: 650; color: var(--ink); letter-spacing: -.02em; line-height: 1.2; }
.stat .l { color: var(--muted); font-size: 12.5px; }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.stat.accent { background: var(--brand); border-color: var(--brand); }
.stat.accent .n, .stat.accent .l { color: #fff; } .stat.accent .l { opacity: .85; }
.stat.accent .chip-ic { background: rgba(255, 255, 255, .16); color: #fff; }
.vbars { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 14px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.vbar i { width: 100%; max-width: 34px; background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #fff)); border-radius: 6px 6px 3px 3px; transform-origin: bottom; animation: grow .7s var(--ease) both; }
.vbar small { font-size: 10.5px; color: var(--faint); } .vbar .v { font-size: 11px; color: var(--muted); }
@keyframes grow { from { transform: scaleY(0); } }
.brow { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: center; margin: 10px 0; font-size: 13px; }
.track { height: 7px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transform-origin: left; animation: growx .8s var(--ease) both; }
@keyframes growx { from { transform: scaleX(0); } }
.who { display: flex; align-items: center; gap: 10px; }
.who.link:hover b, .who.link:hover { color: var(--brand); }
.log > div { font-size: 12.5px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); font-weight: 650; font-size: 12.5px; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; } .avatar.xs { width: 22px; height: 22px; font-size: 9.5px; } .avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #cfd4db; flex: none; }
.status-dot.on { background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }
.badge { background: var(--brand); color: #fff; border-radius: 99px; font-size: 10.5px; padding: 0 6px; font-weight: 650; line-height: 17px; min-width: 17px; text-align: center; }
.dot-badge { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; min-width: 0; padding: 0; border: 2px solid #fff; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 1px 9px 1px 7px; border-radius: 99px; background: var(--soft); color: #4b5160; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #b8bec8; }
.pill.pending { background: #fff7ed; color: #9a3412; } .pill.pending::before { background: #f59e0b; }
.pill.open, .pill.won { background: #f0fdf4; color: #166534; } .pill.open::before, .pill.won::before { background: #22c55e; }
.pill.bot { background: var(--brand-50); color: var(--brand-600); } .pill.bot::before { background: var(--brand); }
.pill.lost { background: #fef2f2; color: #991b1b; } .pill.lost::before { background: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #4b5160; }
.chip .ic { color: var(--faint); width: 14px; height: 14px; }
.tag { display: inline-flex; align-items: center; gap: 3px; background: var(--brand-50); color: var(--brand-600); border-radius: 6px; padding: 1px 8px; font-size: 11.5px; font-weight: 500; margin: 2px 4px 2px 0; }
.tag button { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; opacity: .55; display: grid; }
.tag button:hover { opacity: 1; } .tag button .ic { width: 11px; height: 11px; }
.tags { display: flex; flex-wrap: wrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 460px; color: #4b5160; }
.hint { display: flex; gap: 12px; align-items: flex-start; background: var(--brand-50); border: 1px solid var(--brand-100); color: #26324a; border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 13px; }
.hint > .ic { color: var(--brand); margin-top: 2px; }
.hint pre { background: #fff; }
.empty { display: grid; place-items: center; text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-ic { width: 52px; height: 52px; border-radius: 16px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin-bottom: 12px; animation: float 3s ease-in-out infinite; }
.empty-ic .ic { width: 24px; height: 24px; }
.empty p { margin: 0 0 12px; max-width: 320px; }
@keyframes float { 50% { transform: translateY(-4px); } }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 28px 0 12px; }
.section-title .ic { color: var(--brand); }
h4.sub { font-size: 13px; margin: 18px 0 8px; }
.line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.line:last-child { border-bottom: 0; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 4px 0; } .kv span { color: var(--muted); }

/* Tabelas */
.table-wrap { border: 1px solid var(--line); border-radius: 14px; overflow: auto; background: var(--bg); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13.5px; }
th { font-size: 12px; color: var(--muted); font-weight: 550; background: #fcfcfd; white-space: nowrap; }
tbody tr { transition: background .12s; } tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: 0; }
.card table th { background: none; padding-left: 0; } .card table td { padding-left: 0; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { margin-left: 2px; }
.usage { display: grid; grid-template-columns: 70px auto; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(11, 13, 18, .32); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s ease both; }
.modal-bg.out { opacity: 0; transition: opacity .15s; }
.modal { background: var(--bg); border-radius: 16px; width: min(560px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .22s var(--ease) both; }
.modal.wide { width: min(720px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 14px; }
.modal-head h2 { font-size: 16px; font-weight: 650; flex: 1; }
.modal-body { padding: 4px 22px 8px; overflow: auto; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--line); margin-top: 8px; }
#toast { position: fixed; bottom: 22px; right: 22px; z-index: 99; display: grid; gap: 8px; }
#toast div { display: flex; align-items: center; gap: 9px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; max-width: 380px; font-size: 13px; box-shadow: var(--shadow-lg); animation: slide .25s var(--ease) both; }
#toast div .ic { color: #86efac; } #toast div.err .ic { color: #fca5a5; }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } }

/* ============ Login ============ */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-card { align-self: center; justify-self: center; width: min(380px, 90%); animation: rise .5s var(--ease) both; }
.login-card h1 { font-size: 26px; font-weight: 700; margin: 28px 0 6px; letter-spacing: -.03em; }
.login-card label { margin-top: 16px; }
.brand-row { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--ink); }
.brand-row img { height: 30px; }
.login-art { background: radial-gradient(1200px 600px at 100% 0%, color-mix(in srgb, var(--brand) 22%, #fff), transparent 60%), var(--brand-50); display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 60px; border-left: 1px solid var(--line); }
.art-card { display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); max-width: 420px; animation: rise .6s var(--ease) both; }
.art-card:nth-child(2) { margin-left: 40px; animation-delay: .1s; } .art-card:nth-child(3) { margin-left: 16px; animation-delay: .2s; }
.art-card .ic { grid-row: span 2; width: 40px; height: 40px; padding: 10px; border-radius: 12px; background: var(--brand); color: #fff; -webkit-mask: none; mask: none; position: relative; }
.art-card .ic::after { content: ""; position: absolute; inset: 10px; background: #fff; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.art-card b { color: var(--ink); } .art-card span { color: var(--muted); font-size: 13px; }

/* ============ Conversas ============ */
.inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr) 300px; height: calc(100vh - 61px); }
.inbox > div { overflow: auto; border-right: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: transparent; border-radius: 7px; padding: 5px 10px; cursor: pointer; font-size: 12.5px; color: var(--muted); font-weight: 500; white-space: nowrap; transition: all .15s; }
.tabs button:hover { color: var(--ink); background: var(--soft); }
.tabs button.on { background: var(--ink); color: #fff; }
.conv { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; position: relative; }
.conv:hover { background: var(--soft); }
.conv.on { background: var(--brand-50); }
.conv.on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.conv-av { position: relative; }
.ch { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 2px #fff; }
.ch .ic { width: 12px; height: 12px; }
.ch.whatsapp { color: #16a34a; } .ch.instagram { color: #db2777; } .ch.webchat { color: var(--brand); }
.conv-main { min-width: 0; flex: 1; display: grid; gap: 2px; }
.conv .nm { display: flex; gap: 6px; font-weight: 600; color: var(--ink); font-size: 13.5px; }
.conv .lm { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12.5px; }
.meta-row { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--faint); margin-top: 3px; flex-wrap: wrap; }
.meta-row > span:not(.pill):not(:first-child)::before { content: "·"; margin-right: 6px; }
.chat { display: flex; flex-direction: column; background: var(--soft) !important; min-width: 0; }
.chat .head { display: flex; gap: 12px; align-items: center; background: var(--bg); padding: 11px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chat .head b { color: var(--ink); }
.window-bar { display: flex; align-items: center; gap: 10px; background: #fff7ed; color: #7c2d12; font-size: 12.5px; padding: 9px 18px; border-bottom: 1px solid #fed7aa; }
.window-bar .btn { margin-left: auto; }
.msgs { flex: 1; overflow: auto; padding: 22px 26px; display: flex; flex-direction: column; gap: 6px; background-image: radial-gradient(color-mix(in srgb, var(--brand) 9%, transparent) 1px, transparent 1px); background-size: 22px 22px; }
.msg { max-width: min(68%, 560px); padding: 8px 12px 6px; border-radius: 14px 14px 14px 4px; background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow-sm); animation: rise .25s var(--ease) both; }
.msg .txt { white-space: pre-wrap; word-wrap: break-word; }
.msg.out { align-self: flex-end; background: var(--brand); color: #fff; border-color: transparent; border-radius: 14px 14px 4px 14px; }
.msg.out.ai { background: var(--ink); }
.msg.note { align-self: center; background: #fffbeb; border: 1px dashed #fcd34d; color: #713f12; font-size: 12.5px; border-radius: 10px; max-width: 80%; }
.msg .meta { display: flex; gap: 6px; justify-content: flex-end; align-items: center; font-size: 10.5px; margin-top: 3px; color: var(--faint); }
.msg.out .meta { color: rgba(255, 255, 255, .75); }
.tick .ic { width: 14px; height: 14px; } .tick.read .ic { color: #7dd3fc; } .tick.failed .ic { color: #fecaca; }
.msg.in .tick.read .ic { color: var(--brand); }
.m-img { display: block; max-width: 280px; max-height: 280px; border-radius: 10px; margin: 2px 0 4px; }
.msg audio { max-width: 260px; height: 36px; }
.m-doc { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; background: rgba(0, 0, 0, .05); margin-bottom: 4px; font-size: 13px; }
.msg.out .m-doc { background: rgba(255, 255, 255, .15); }
.m-tag { display: flex; align-items: center; gap: 5px; font-size: 11px; opacity: .8; margin-top: 4px; }
.m-tag .ic { width: 12px; height: 12px; }
.m-btns { display: grid; gap: 4px; margin-top: 6px; }
.m-btns span { text-align: center; font-size: 12.5px; padding: 5px; border-radius: 8px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); }
.msg.in .m-btns span { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-600); }
.compose { position: relative; display: flex; gap: 8px; align-items: flex-end; background: var(--bg); padding: 10px 14px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.compose .tools { display: flex; gap: 2px; width: 100%; }
.compose textarea { flex: 1; min-height: 42px; max-height: 140px; height: 42px; border-radius: 12px; padding: 10px 14px; resize: none; background: var(--soft); border-color: transparent; }
.compose textarea:focus { background: #fff; }
.compose textarea.note { background: #fffbeb; border-color: #fcd34d; }
.compose textarea:disabled { opacity: .6; }
.compose.closed { align-items: center; color: var(--muted); }
.compose.closed .btn { margin-left: auto; }
.send { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform .15s, background .15s; }
.send:hover { background: var(--brand-600); transform: scale(1.04); }
.send .ic { width: 18px; height: 18px; }
.qr-pop { position: absolute; bottom: calc(100% - 4px); left: 14px; right: 14px; max-width: 480px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 5; animation: pop .15s var(--ease) both; }
.qr-pop div { display: flex; gap: 10px; padding: 7px 10px; cursor: pointer; border-radius: 8px; font-size: 13px; }
.qr-pop div:hover { background: var(--brand-50); }
.info { padding: 18px; }
.profile { text-align: center; padding: 6px 0 14px; display: grid; justify-items: center; gap: 4px; }
.profile.row { text-align: left; display: flex; gap: 14px; }
.profile h3 { font-size: 16px; margin-top: 6px; }
.info section, .dsec { padding: 14px 0; border-top: 1px solid var(--line); }
.info h4, .dsec h4 { display: flex; align-items: center; gap: 7px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.info h4 .ic, .dsec h4 .ic { width: 14px; height: 14px; }
.count { background: var(--soft); color: var(--muted); border-radius: 99px; font-size: 11px; padding: 0 7px; font-weight: 600; }
.tag-input { margin-top: 6px; padding: 6px 10px; font-size: 12.5px; }
.mini-card { display: grid; gap: 1px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; font-size: 13px; transition: border-color .15s; }
.mini-card:hover { border-color: var(--brand); } .mini-card span { color: var(--muted); font-size: 12px; }
.task-line { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.task-line .ic { color: var(--brand); } .task-line.done { color: var(--faint); text-decoration: line-through; }
.hist { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; font-weight: 500; }
.hist:hover { color: var(--brand); }
.wa-preview { background: #e7f7ee; border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; font-size: 13.5px; border: 1px solid #cdeedb; position: relative; }

/* ============ Funil ============ */
.kanban { display: flex; gap: 14px; overflow-x: auto; align-items: flex-start; padding-bottom: 14px; min-height: calc(100vh - 150px); }
.col { min-width: 280px; width: 280px; background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 10px; transition: background .15s, border-color .15s; }
.col.over { background: var(--brand-50); border-color: var(--brand); border-style: dashed; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-size: 13px; }
.col-head b { color: var(--ink); }
.col-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.drop { display: grid; gap: 8px; min-height: 60px; }
.drop-empty { border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 18px; text-align: center; color: var(--faint); font-size: 12px; }
.deal { background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; cursor: grab; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; }
.deal:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.deal.dragging { opacity: .5; transform: rotate(2deg); }
.deal b { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.deal .v { color: var(--brand-600); font-weight: 650; margin: 3px 0 8px; font-size: 13px; }
.deal-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.deal-foot span { display: inline-flex; align-items: center; gap: 4px; } .deal-foot .ic { width: 12px; height: 12px; }
.deal-foot .avatar { margin-left: auto; }
.stage-list { display: grid; gap: 8px; }
.stage-list .row { flex-wrap: nowrap; }
.swatch { width: 40px !important; flex: none; }

/* ============ Automações ============ */
.flow-mini { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.flow-mini .sep { width: 12px; height: 12px; color: var(--faint); }
.flow { display: grid; justify-items: stretch; }
.flow-node { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--bg); box-shadow: var(--shadow-sm); animation: rise .25s var(--ease) both; }
.flow-node > .row { margin-bottom: 4px; flex-wrap: nowrap; }
.flow-node .field { margin: 12px 0 0; }
.flow-node.trigger { display: flex; gap: 12px; align-items: center; background: var(--brand); border-color: var(--brand); color: #fff; }
.flow-node.trigger .chip-ic { background: rgba(255, 255, 255, .18); color: #fff; }
.flow-node.trigger small { display: block; opacity: .8; font-size: 11.5px; } .flow-node.trigger b { color: #fff; }
.flow-line { width: 2px; height: 20px; background: linear-gradient(var(--brand-100), var(--line-2)); justify-self: center; position: relative; }
.flow-line::after { content: ""; position: absolute; bottom: -2px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-100); }
.add-step { display: flex; gap: 8px; border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 10px; }

/* ============ Canais / Integrações / Planos ============ */
.connect-hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; background: linear-gradient(120deg, var(--brand-50), #fff 60%); padding: 26px; }
.connect-hero h3 { font-size: 18px; margin: 12px 0 4px; } .connect-hero p { margin: 0; max-width: 560px; }
.ch-logo { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #fff; flex: none; }
.ch-logo .ic { width: 20px; height: 20px; }
.ch-logo.whatsapp { background: #16a34a; } .ch-logo.instagram { background: linear-gradient(135deg, #f59e0b, #db2777 55%, #7c3aed); } .ch-logo.webchat { background: var(--brand); }
.ch-logo.lg { width: 50px; height: 50px; border-radius: 14px; } .ch-logo.lg .ic { width: 26px; height: 26px; }
.channel { display: grid; gap: 14px; transition: box-shadow .2s, transform .2s var(--ease); }
.channel:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.channel b { color: var(--ink); }
.add-card { display: grid; place-items: center; gap: 6px; border: 1.5px dashed var(--line-2); background: transparent; color: var(--muted); cursor: pointer; min-height: 150px; box-shadow: none; font-weight: 500; transition: all .15s; }
.add-card:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.integ { display: grid; gap: 8px; align-content: start; transition: transform .2s var(--ease), box-shadow .2s; }
.integ:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.integ b { color: var(--ink); } .integ p { margin: 0; }
.settings { display: grid; gap: 14px; max-width: 720px; }
.plan { display: grid; gap: 14px; align-content: start; transition: transform .2s var(--ease), box-shadow .2s; }
.plan:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.plan.featured { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.plan-name { font-size: 15px; color: var(--ink); }
.price { font-size: 28px; font-weight: 700; color: var(--ink); letter-spacing: -.03em; } .price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.limits { display: grid; gap: 6px; font-size: 13px; } .limits div { display: flex; gap: 8px; align-items: center; } .limits .ic { color: var(--brand); }
.feat { list-style: none; padding: 14px 0 0; margin: 0; border-top: 1px solid var(--line); display: grid; gap: 7px; font-size: 13px; }
.feat li { display: flex; gap: 8px; align-items: center; } .feat .ic { color: var(--ok); width: 15px; } .feat li.off { color: var(--faint); } .feat li.off .ic { color: var(--faint); }

/* ============ Chat da equipe ============ */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 100%); background: var(--bg); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); z-index: 40; display: flex; flex-direction: column; animation: drawer .28s var(--ease) both; }
.drawer.out { transform: translateX(100%); transition: transform .2s; }
@keyframes drawer { from { transform: translateX(100%); } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-head .ic { color: var(--brand); }
.drawer-msgs { flex: 1; overflow: auto; padding: 16px 18px; display: grid; align-content: start; gap: 14px; }
.tmsg { display: flex; gap: 10px; animation: rise .2s var(--ease) both; }
.tmsg b { font-size: 13px; color: var(--ink); } .tmsg p { margin: 2px 0 0; font-size: 13.5px; white-space: pre-wrap; }
.tmsg.mine .avatar { background: var(--brand); color: #fff; }
.drawer-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }

/* ============ Responsivo ============ */
@media (max-width: 1200px) { .inbox { grid-template-columns: 300px minmax(0, 1fr); } .inbox .info { display: none; } .split { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 45; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
  .side.show { transform: none; }
  #menu { display: inline-grid; }
  .top { padding: 12px 16px; } .top .pill-btn { display: none; }
  .content { padding: 16px; }
  .inbox { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
  .g2 { grid-template-columns: 1fr; }
  .search input { min-width: 0; }
}

/* ajustes de layout */
.g4, .hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4, .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .g4, .hero-stats { grid-template-columns: 1fr; } }
.stat > div { min-width: 0; }
.vbars { overflow: hidden; }
.vbar { min-width: 0; }
.vbar small { white-space: nowrap; font-size: 10px; }
.tabs { flex-wrap: wrap; overflow: visible; }
.nm .ellipsis, .lm .ellipsis { flex: 1; }
.inbox { grid-template-columns: 300px minmax(0, 1fr) 280px; }
.chat .head { flex-wrap: nowrap; }
.chat .head > div:nth-child(2) { min-width: 0; }
.head-actions { display: flex; gap: 6px; flex: none; }
.head-actions .btn span:not(.ic) { display: inline; }
@media (max-width: 1360px) { .head-actions .btn .lbl { display: none; } .head-actions .btn { padding: 6px 8px; } }
.hist { flex-wrap: wrap; }
.conv-main { grid-template-columns: minmax(0, 1fr); }

/* Canais: conexão por link / QR */
.tiles .ch-tile { display: grid; gap: 12px; align-content: start; }
.ch-brand { width: 40px; height: 40px; flex: none; }
.ch-brand.sm { width: 34px; height: 34px; }
.ch-tile b { font-size: 15px; color: var(--ink); }
.feat-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.feat-mini li { display: flex; gap: 8px; align-items: center; } .feat-mini .ic { color: var(--ok); width: 14px; height: 14px; }
.hint.small { font-size: 12.5px; margin: 0; }
.share { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
.share .qr { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: #fff; }
.share .qr svg { width: 100%; height: 100%; display: block; }
.copy-row { display: flex; gap: 6px; } .copy-row input { font: 12px var(--mono, monospace); }
@media (max-width: 600px) { .share { grid-template-columns: 1fr; } .share .qr { justify-self: center; } }
/* Configuração da plataforma */
.settings.wide { max-width: 980px; }
.steps { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; color: #3d4250; }
.ai-keys { display: grid; gap: 10px; }
.ai-key { display: flex; gap: 12px; align-items: center; }
.ai-key > img { width: 26px; height: 26px; margin-top: 8px; }
.ai-key .field { margin: 0; }
