/* ===== Pantoja CRM — tema escuro com dourado, modo claro, animações ===== */
:root {
  --bg: #0b0b0d; --bg2: #111114; --card: rgba(21, 21, 25, .78); --card-solid: #151519; --card2: #1b1b20;
  --line: rgba(255, 255, 255, .07); --line2: rgba(255, 255, 255, .12);
  --text: #f4f0e8; --muted: #9b968c; --faint: #6a665f;
  --gold: #e9a93a; --gold2: #f5c35a; --gold-soft: rgba(233, 169, 58, .14); --on-gold: #1a1204;
  --green: #2fd182; --green-soft: rgba(47, 209, 130, .13); --bubble-bot: #12382a; --bubble-in: #1c1c22; --bubble-user: #3a2a0c;
  --note: #3b3212; --note-line: #6f5d1d;
  --red: #ff6b6b; --red-soft: rgba(255, 107, 107, .12); --blue: #6db3ff; --violet: #a78bfa;
  --hot: #ff7a45; --warm: #f5c35a; --cold: #58b8ff;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .6); --radius: 18px; --radius-s: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; --serif: 'Instrument Serif', Georgia, serif;
  --aurora-a: rgba(233, 169, 58, .30); --aurora-b: rgba(47, 209, 130, .14); --aurora-c: rgba(167, 139, 250, .14);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f3ec; --bg2: #efeadf; --card: rgba(255, 255, 255, .82); --card-solid: #fff; --card2: #f6f2ea;
  --line: rgba(20, 16, 8, .08); --line2: rgba(20, 16, 8, .14);
  --text: #19160f; --muted: #6d675b; --faint: #a39d90;
  --gold: #c98a12; --gold2: #b07607; --gold-soft: rgba(201, 138, 18, .12); --on-gold: #fff;
  --green: #12a462; --green-soft: rgba(18, 164, 98, .1); --bubble-bot: #dcf6e6; --bubble-in: #fff; --bubble-user: #fbefd5;
  --note: #fdf3c9; --note-line: #ecd57a; --red: #d93c3c; --red-soft: rgba(217, 60, 60, .1);
  --shadow: 0 20px 50px -24px rgba(60, 40, 0, .25);
  --aurora-a: rgba(233, 169, 58, .22); --aurora-b: rgba(18, 164, 98, .10); --aurora-c: rgba(167, 139, 250, .10);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f6f3ec; --bg2: #efeadf; --card: rgba(255, 255, 255, .82); --card-solid: #fff; --card2: #f6f2ea;
    --line: rgba(20, 16, 8, .08); --line2: rgba(20, 16, 8, .14); --text: #19160f; --muted: #6d675b; --faint: #a39d90;
    --gold: #c98a12; --gold2: #b07607; --gold-soft: rgba(201, 138, 18, .12); --on-gold: #fff;
    --green: #12a462; --green-soft: rgba(18, 164, 98, .1); --bubble-bot: #dcf6e6; --bubble-in: #fff; --bubble-user: #fbefd5;
    --note: #fdf3c9; --note-line: #ecd57a; --red: #d93c3c; --red-soft: rgba(217, 60, 60, .1); --shadow: 0 20px 50px -24px rgba(60, 40, 0, .25);
    --aurora-a: rgba(233, 169, 58, .22); --aurora-b: rgba(18, 164, 98, .10); --aurora-c: rgba(167, 139, 250, .10);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); background: var(--card2); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; width: 100%; outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--gold); }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
label > small { font-weight: 400; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
p { margin: 0; }
code { background: var(--card2); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.ic { width: 20px; height: 20px; flex: none; }
.ic.tiny { width: 14px; height: 14px; vertical-align: -2px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .grow { flex: 1; min-width: 0; }
.mt { margin-top: 14px; } .gold-t { color: var(--gold2); } .ok-t { color: var(--green); } .err-t { color: var(--red); }
.row { display: flex; align-items: center; } .row.wrap { flex-wrap: wrap; } .gap { gap: 10px; } .gap-s { gap: 6px; } .end { justify-content: flex-end; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2 .full { grid-column: 1 / -1; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--gold2); letter-spacing: 0; }

/* ===== Fundo vivo ===== */
.aurora { position: fixed; inset: -20%; z-index: 0; pointer-events: none; filter: blur(70px); opacity: .9; }
.aurora i { position: absolute; border-radius: 50%; mix-blend-mode: screen; animation: drift 26s var(--ease) infinite alternate; }
:root[data-theme="light"] .aurora i { mix-blend-mode: multiply; }
.aurora i:nth-child(1) { width: 52vw; height: 52vw; left: 0; top: 0; background: radial-gradient(circle, var(--aurora-a), transparent 65%); }
.aurora i:nth-child(2) { width: 46vw; height: 46vw; right: 0; top: 20%; background: radial-gradient(circle, var(--aurora-b), transparent 65%); animation-duration: 32s; animation-delay: -8s; }
.aurora i:nth-child(3) { width: 40vw; height: 40vw; left: 30%; bottom: 0; background: radial-gradient(circle, var(--aurora-c), transparent 65%); animation-duration: 38s; animation-delay: -14s; }
.aurora i:nth-child(4) { width: 30vw; height: 30vw; right: 20%; bottom: 10%; background: radial-gradient(circle, var(--aurora-a), transparent 65%); animation-duration: 44s; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(8vw, 6vh) scale(1.15); } 100% { transform: translate(-6vw, 10vh) scale(.92); } }
.grain { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .05; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ===== Abertura ===== */
#splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #0b0b0d; clip-path: inset(0 0 0 0); transition: clip-path .9s var(--ease); }
#splash:not(.play) { display: none; }
#splash.out { clip-path: inset(0 0 100% 0); }
.splash-inner { text-align: center; display: grid; justify-items: center; gap: 14px; color: #f4f0e8; }
.splash-logo { width: 92px; height: 92px; filter: drop-shadow(0 0 30px rgba(245, 195, 90, .35)); }
.splash-logo .draw { stroke-dasharray: 200; stroke-dashoffset: 200; animation: draw 1.1s var(--ease) forwards; }
.splash-logo .d2 { animation-delay: .6s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.splash-title { font-size: clamp(38px, 7vw, 64px); font-weight: 800; letter-spacing: -.04em; overflow: hidden; line-height: 1.1; padding-bottom: 6px; }
.splash-title span, .splash-title em { display: inline-block; transform: translateY(110%); animation: rise .9s var(--ease) forwards; animation-delay: .35s; }
.splash-title em { animation-delay: .5s; color: #f5c35a; }
.splash-sub { color: #9b968c; font-size: 15px; max-width: 420px; }
.splash-sub span { display: inline-block; opacity: 0; transform: translateY(12px); animation: rise .7s var(--ease) forwards; }
.splash-sub span:nth-child(1) { animation-delay: .75s; } .splash-sub span:nth-child(2) { animation-delay: .82s; } .splash-sub span:nth-child(3) { animation-delay: .89s; }
.splash-sub span:nth-child(4) { animation-delay: .96s; } .splash-sub span:nth-child(5) { animation-delay: 1.03s; } .splash-sub span:nth-child(6) { animation-delay: 1.1s; } .splash-sub span:nth-child(7) { animation-delay: 1.17s; }
@keyframes rise { to { transform: none; opacity: 1; } }
.splash-bar { width: 160px; height: 2px; background: rgba(255, 255, 255, .08); border-radius: 2px; overflow: hidden; margin-top: 10px; }
.splash-bar i { display: block; height: 100%; background: linear-gradient(90deg, #e9a93a, #f5c35a); transform: scaleX(0); transform-origin: left; animation: load 1.6s var(--ease) .2s forwards; }
@keyframes load { to { transform: scaleX(1); } }

/* ===== Botões ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line2); background: var(--card2); padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; transition: transform .2s var(--spring), box-shadow .25s, background .2s, border-color .2s; white-space: nowrap; text-decoration: none !important; color: var(--text); }
.btn:hover { transform: translateY(-1px); border-color: var(--gold); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn .ic { width: 17px; height: 17px; }
.btn.gold { background: linear-gradient(135deg, var(--gold2), var(--gold)); color: var(--on-gold); border-color: transparent; box-shadow: 0 8px 24px -10px var(--gold); }
.btn.gold:hover { box-shadow: 0 12px 30px -10px var(--gold); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--red); color: #fff; border-color: transparent; }
.btn.danger.ghost { background: transparent; color: var(--red); border-color: var(--red-soft); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.xs { padding: 5px 9px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn.xs .ic { width: 14px; height: 14px; }
.btn.block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; border: 1px solid transparent; background: transparent; color: var(--muted); transition: background .2s, color .2s, transform .2s var(--spring); flex: none; }
.icon-btn:hover { background: var(--card2); color: var(--text); }
.icon-btn:active { transform: scale(.9); }
.icon-btn:disabled { opacity: .3; pointer-events: none; }
.icon-btn.sm { width: 32px; height: 32px; } .icon-btn.sm .ic { width: 17px; height: 17px; }
.icon-btn.xs { width: 28px; height: 28px; border-radius: 8px; } .icon-btn.xs .ic { width: 15px; height: 15px; }
.icon-btn.spin .ic { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }

/* ===== Shell ===== */
#app { position: relative; z-index: 2; height: 100%; }
.shell { display: grid; grid-template-columns: 248px 1fr; height: 100%; }
.side { display: flex; flex-direction: column; gap: 22px; padding: 22px 16px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(20px); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none !important; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(135deg, var(--gold2), var(--gold)); color: var(--on-gold); box-shadow: 0 10px 30px -10px var(--gold); flex: none; }
.brand-mark.big { width: 56px; height: 56px; border-radius: 17px; }
.brand-mark.big .ic { width: 28px; height: 28px; }
.brand-txt { display: grid; line-height: 1.2; min-width: 0; }
.brand-txt b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-txt small { color: var(--muted); font-size: 12px; }
.nav { position: relative; display: grid; gap: 4px; }
.nav a { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--muted); font-weight: 600; text-decoration: none; transition: color .25s; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); }
.nav a.active .ic { color: var(--gold2); }
.nav-pill { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 12px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); transition: transform .5s var(--spring), width .3s, height .3s; opacity: 0; }
.nav-pill.on { opacity: 1; }
.nav-badge { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; background: var(--red); color: #fff; transform: scale(0); transition: transform .35s var(--spring); }
.nav-badge.on { transform: scale(1); }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.wa-pill { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); font-size: 13px; font-weight: 600; }
.wa-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.wa-pill.on i { background: var(--green); box-shadow: 0 0 0 0 var(--green); animation: ping 2s infinite; }
.wa-pill.wait i { background: var(--gold); animation: blink 1s infinite; }
.wa-pill.off i { background: var(--red); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes blink { 50% { opacity: .3; } }
.main { overflow: auto; padding: 28px clamp(16px, 3vw, 40px) 40px; height: 100%; scroll-behavior: smooth; }
.main.enter > * { animation: viewIn .6s var(--ease) both; }
.main.enter > *:nth-child(2) { animation-delay: .05s; } .main.enter > *:nth-child(3) { animation-delay: .1s; } .main.enter > *:nth-child(4) { animation-delay: .15s; }
@keyframes viewIn { from { opacity: 0; transform: translateY(16px); } }
.rv { animation: viewIn .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-title { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.page-title em { font-size: 1.08em; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold2); margin-bottom: 6px; }

/* ===== Cartões ===== */
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(16px); box-shadow: var(--shadow); display: grid; gap: 12px; align-content: start; }
.card + .card, .card + section, .sec-body > * + * { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.glow { position: relative; overflow: hidden; }
.glow::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(420px circle at var(--mx, -999px) var(--my, -999px), var(--gold-soft), transparent 45%); opacity: 0; transition: opacity .35s; border-radius: inherit; }
.glow:hover::before { opacity: 1; }
.empty { display: grid; place-items: center; gap: 10px; text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; color: var(--gold); }
.empty.small { padding: 30px 16px; }
.note { font-size: 13px; color: var(--muted); padding: 10px 12px; border-radius: 10px; background: var(--gold-soft); border: 1px dashed color-mix(in srgb, var(--gold) 40%, transparent); }

/* ===== Chips, tags, seg ===== */
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips button, .chip-btn { flex: none; border: 1px solid var(--line2); background: transparent; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); transition: all .25s var(--ease); }
.chips button:hover, .chip-btn:hover { color: var(--text); border-color: var(--gold); }
.chips button.on { background: var(--gold-soft); color: var(--gold2); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--card2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; text-decoration: none !important; }
.tag .ic { width: 12px; height: 12px; }
.tag.bot, .tag.ok { color: var(--green); background: var(--green-soft); border-color: transparent; }
.tag.hand { color: var(--hot); background: rgba(255, 122, 69, .12); border-color: transparent; }
.tag.human { color: var(--blue); background: rgba(109, 179, 255, .12); border-color: transparent; }
.tag.stage, .tag.gold { color: var(--gold2); background: var(--gold-soft); border-color: transparent; }
.chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.chip.phase { background: var(--green-soft); color: var(--green); }
.chip.phase:empty { display: none; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--card2); border: 1px solid var(--line); }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 7px 13px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); transition: all .25s var(--ease); white-space: nowrap; }
.seg button .ic { width: 15px; height: 15px; }
.seg button.on { background: var(--card-solid); color: var(--text); box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .4); }
.seg.tabs { margin-bottom: 14px; overflow-x: auto; max-width: 100%; }
.temp-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--card2); }
.temp-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.temp-pill .ic { width: 13px; height: 13px; }
.temp-pill.hot { color: var(--hot); } .temp-pill.warm { color: var(--warm); } .temp-pill.cold { color: var(--cold); }
.temp-pill:empty { display: none; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--faint); }
.dot.on { background: var(--green); animation: ping 2s infinite; } .dot.off { background: var(--red); }

/* switch */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line2); transition: background .3s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .35s var(--spring); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.switch input:checked + i { background: linear-gradient(135deg, var(--gold2), var(--gold)); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch.sm { width: 36px; height: 22px; } .switch.sm i::after { width: 16px; height: 16px; } .switch.sm input:checked + i::after { transform: translateX(14px); }
.switch.big { width: 54px; height: 30px; } .switch.big i::after { width: 24px; height: 24px; } .switch.big input:checked + i::after { transform: translateX(24px); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); font-weight: 400; }
.toggle-row:last-of-type { border-bottom: 0; }
.toggle-row > span:first-child { display: grid; gap: 2px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.inline-num { width: 70px; padding: 4px 8px; display: inline-block; }

.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--card2); border: 1px solid var(--line2); border-radius: 12px; color: var(--muted); transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.search input { border: 0; background: transparent; box-shadow: none !important; padding: 11px 0; }

/* ===== Avatar ===== */
.avatar { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none; font-weight: 800; font-size: 14px; color: hsl(var(--h) 70% 82%); background: linear-gradient(135deg, hsl(var(--h) 45% 30%), hsl(calc(var(--h) + 40) 45% 22%)); }
:root[data-theme="light"] .avatar { color: hsl(var(--h) 55% 28%); background: linear-gradient(135deg, hsl(var(--h) 70% 88%), hsl(calc(var(--h) + 40) 70% 82%)); }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.temp-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg); }
.temp-dot.hot { background: var(--hot); } .temp-dot.warm { background: var(--warm); } .temp-dot.cold { background: var(--cold); }

/* ===== Conversas ===== */
.view-conversas { padding: 0; overflow: hidden; }
.conv { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; height: 100%; }
.conv-list { display: flex; flex-direction: column; gap: 12px; padding: 22px 14px 0 18px; border-right: 1px solid var(--line); min-height: 0; background: color-mix(in srgb, var(--bg) 40%, transparent); }
.list-head { display: flex; justify-content: space-between; align-items: flex-start; }
.list-head .page-title { font-size: 28px; }
.conn-line { font-size: 13px; display: flex; align-items: center; gap: 4px; }
.list { overflow-y: auto; flex: 1; margin: 0 -8px; padding: 0 4px 20px; }
.item { display: flex; gap: 12px; padding: 12px; border-radius: 14px; color: var(--text); text-decoration: none !important; transition: background .2s; position: relative; }
.item:hover { background: var(--card2); }
.item.active { background: var(--gold-soft); }
.item.active::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--gold); }
.item.pop { animation: viewIn .5s var(--ease) both; animation-delay: calc(var(--i) * 35ms); }
.item.flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 0% { background: var(--gold-soft); transform: translateX(-6px); } 100% { transform: none; } }
.item-main { display: grid; gap: 3px; min-width: 0; flex: 1; }
.item-top { display: flex; justify-content: space-between; gap: 8px; }
.item-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.item-top time { font-size: 12px; color: var(--muted); flex: none; }
.item.unread .item-top time { color: var(--green); font-weight: 700; }
.item-bot { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.preview { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 4px; align-items: center; }
.preview .ic { color: var(--blue); }
.badge { font-style: normal; background: var(--green); color: #04130b; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; animation: pop .4s var(--spring); }
@keyframes pop { from { transform: scale(0); } }
.item-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.sk-list i { display: block; height: 62px; margin: 8px; border-radius: 14px; background: linear-gradient(90deg, var(--card2), var(--line2), var(--card2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.conv-chat { display: flex; flex-direction: column; min-height: 0; position: relative; }
.empty-chat { margin: auto; display: grid; justify-items: center; gap: 10px; text-align: center; max-width: 340px; padding: 20px; }
.orb { width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; color: var(--gold2); background: radial-gradient(circle at 30% 30%, var(--gold-soft), transparent 70%); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); animation: float 5s ease-in-out infinite; }
.orb .ic { width: 36px; height: 36px; }
@keyframes float { 50% { transform: translateY(-10px); } }
.chat-loading { margin: auto; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(16px); }
.chat-head .back { display: none; }
.head-main { display: grid; text-align: left; border: 0; background: none; padding: 0; min-width: 0; flex: 1; }
.head-main b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-main small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-select { width: auto; max-width: 190px; padding: 7px 10px; font-size: 13px; font-weight: 600; border-radius: 10px; background: var(--gold-soft); border-color: transparent; color: var(--gold2); }
.banner { display: none; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px; font-size: 13.5px; border-bottom: 1px solid var(--line); background: var(--card); }
.banner.show { display: flex; animation: slideDown .45s var(--ease); }
.banner span { display: flex; align-items: center; gap: 8px; }
.banner.warn { background: color-mix(in srgb, var(--hot) 10%, var(--card-solid)); }
.banner.warn .ic { color: var(--hot); }
.banner.bot .ic { color: var(--green); }
.banner.pulse { animation: pulseBan 1.2s 2; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-100%); } }
@keyframes pulseBan { 50% { background: color-mix(in srgb, var(--hot) 25%, var(--card-solid)); } }
.msgs { flex: 1; overflow-y: auto; padding: 18px clamp(12px, 3vw, 40px); min-height: 0; }
.msgs-inner { display: flex; flex-direction: column; gap: 6px; max-width: 860px; margin: 0 auto; }
.msg { max-width: min(76%, 560px); padding: 9px 13px 6px; border-radius: 16px; position: relative; box-shadow: 0 2px 8px -4px rgba(0, 0, 0, .3); }
.msg p { white-space: normal; overflow-wrap: anywhere; font-size: 14.5px; }
.msg time { display: flex; align-items: center; justify-content: flex-end; gap: 3px; font-size: 11px; color: var(--muted); margin-top: 2px; }
.msg time .ic { color: var(--blue); }
.msg .who { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.msg .who .ic { width: 14px; height: 14px; }
.msg.in { align-self: flex-start; background: var(--bubble-in); border: 1px solid var(--line); border-top-left-radius: 5px; }
.msg.out { align-self: flex-end; background: var(--bubble-user); border-top-right-radius: 5px; }
.msg.out .who { color: var(--gold2); }
.msg.out.bot { background: var(--bubble-bot); }
.msg.out.bot .who { color: var(--green); }
.msg.out.phone .who { color: var(--blue); }
.msg.note { align-self: flex-end; background: var(--note); border: 1px solid var(--note-line); max-width: min(86%, 620px); }
.msg.note .who { color: var(--gold2); }
.msg.new { animation: bubble .55s var(--spring) both; animation-delay: var(--d, 0s); }
.msg.in.new { transform-origin: left bottom; } .msg.out.new { transform-origin: right bottom; }
@keyframes bubble { from { opacity: 0; transform: translateY(14px) scale(.9); } }
.media { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); font-style: italic; }
.sys { align-self: center; margin: 4px 0; }
.sys span { font-size: 12px; color: var(--muted); background: var(--card2); padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); }
.sys.new { animation: viewIn .5s var(--ease); }
.day { align-self: center; margin: 12px 0 6px; position: sticky; top: 0; z-index: 1; }
.day span { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--card-solid); padding: 4px 12px; border-radius: 999px; box-shadow: var(--shadow); text-transform: capitalize; }
.msg-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.mini-note { font-size: 12px; color: var(--muted); margin-top: 6px; padding: 6px 8px; background: var(--note); border-radius: 8px; }
.msg-acts { display: flex; justify-content: flex-end; gap: 4px; margin-top: 6px; }
.msg-acts button { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line2); background: var(--card-solid); font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 8px; color: var(--muted); transition: all .2s; }
.msg-acts button:hover { color: var(--gold2); border-color: var(--gold); }
.msg-acts .ic { width: 13px; height: 13px; }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--bubble-in); border-radius: 16px; border: 1px solid var(--line); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: none; opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.typing-row { align-self: flex-end; animation: viewIn .3s; }

/* Copiloto */
.copilot { border-top: 1px solid var(--line); background: var(--card); backdrop-filter: blur(16px); max-height: 62vh; display: flex; flex-direction: column; transition: max-height .45s var(--ease); }
.copilot.collapsed { max-height: 50px; }
.copilot.collapsed .cop-body { opacity: 0; pointer-events: none; }
.cop-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px; min-height: 50px; }
.cop-title { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 0; }
.cop-title .ic { color: var(--green); }
.copilot.stale .cop-title .ic { color: var(--gold2); animation: blink 1.4s infinite; }
.cop-body { overflow-y: auto; padding: 0 16px 14px; display: grid; grid-auto-rows: max-content; align-content: start; gap: 10px; transition: opacity .3s; }
.cop-next { font-size: 15px; } .cop-sum { font-size: 13px; color: var(--muted); }
.cop-sugs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.sug { min-width: 0; height: auto; align-content: start; text-align: left; display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line2); background: var(--card2); transition: transform .3s var(--spring), border-color .2s; animation: viewIn .5s var(--ease) both; animation-delay: calc(var(--i) * 90ms); }
.sug:hover { transform: translateY(-3px); border-color: var(--green); }
.sug small { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; color: var(--green); }
.sug span { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sug.picked { animation: picked .6s var(--spring); }
@keyframes picked { 40% { transform: scale(.95); border-color: var(--gold); } }
.cop-miss { font-size: 12.5px; color: var(--muted); }
.move { justify-self: start; }
.cop-ask { display: flex; gap: 6px; align-items: center; }
.cop-ask input { padding: 8px 12px; font-size: 13px; }
.cop-answer p { font-size: 13.5px; padding: 10px 12px; background: var(--card2); border-radius: 12px; border-left: 3px solid var(--green); animation: viewIn .4s var(--ease); }
.shimmer { display: grid; gap: 8px; }
.shimmer i, .shimmer b { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--card2), var(--line2), var(--card2)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.shimmer b { height: 70px; flex: 1; border-radius: 12px; }

/* Compositor */
.composer { padding: 10px 14px 14px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 80%, transparent); display: grid; gap: 8px; }
.composer .seg { justify-self: start; max-width: 100%; overflow-x: auto; }
.input-row { position: relative; display: flex; align-items: flex-end; gap: 8px; }
.input-row textarea { resize: none; border-radius: 22px; padding: 12px 18px; max-height: 180px; line-height: 1.4; }
.composer.mode-note textarea { background: var(--note); border-color: var(--note-line); }
.composer.mode-learning textarea { background: var(--green-soft); border-color: var(--green); }
.send-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--gold2), var(--gold)); color: var(--on-gold); box-shadow: 0 8px 20px -8px var(--gold); transition: transform .25s var(--spring); }
.send-btn:hover { transform: scale(1.07) rotate(-8deg); }
.send-btn:active { transform: scale(.9); }
.send-btn.sending .ic { animation: fly .6s var(--ease) infinite; }
@keyframes fly { 50% { transform: translate(4px, -4px); opacity: .4; } }
.qr-pop { position: absolute; bottom: calc(100% + 8px); left: 0; right: 54px; background: var(--card-solid); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: grid; gap: 2px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: all .25s var(--ease); z-index: 5; max-height: 280px; overflow: auto; }
.qr-pop.show { opacity: 1; transform: none; pointer-events: auto; }
.qr-pop button { display: grid; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 9px; }
.qr-pop button:hover, .qr-pop button:first-child { background: var(--gold-soft); }
.qr-pop b { color: var(--gold2); font-size: 13px; }
.qr-pop span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Menus, modais, toasts ===== */
.pop-menu { position: fixed; z-index: 60; min-width: 220px; background: var(--card-solid); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: grid; opacity: 0; transform: translateY(-6px) scale(.97); transform-origin: top right; transition: all .25s var(--ease); }
.pop-menu.in { opacity: 1; transform: none; }
.pop-menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 9px 12px; border-radius: 9px; text-align: left; font-size: 14px; }
.pop-menu button:hover { background: var(--card2); }
.pop-menu button.danger { color: var(--red); }
.pop-menu .ic { width: 17px; height: 17px; color: var(--muted); }
.pop-head { display: grid; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pop-head small { color: var(--muted); }
.modal-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0); backdrop-filter: blur(0); transition: all .3s var(--ease); }
.modal-wrap.in { background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); }
.modal { position: relative; width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--card-solid); border: 1px solid var(--line2); border-radius: 22px; padding: 24px; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .6); display: grid; gap: 14px; transform: translateY(30px) scale(.96); opacity: 0; transition: all .45s var(--spring); }
.modal.wide { width: min(680px, 100%); }
.modal-wrap.in .modal { transform: none; opacity: 1; }
.modal h3 { font-size: 20px; padding-right: 30px; }
.modal form { display: grid; gap: 14px; }
.modal-x { position: absolute; right: 14px; top: 14px; }
#toasts { position: fixed; z-index: 90; right: 18px; bottom: 18px; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--card-solid); border: 1px solid var(--line2); box-shadow: var(--shadow); font-size: 14px; animation: toastIn .5s var(--spring); }
.toast .ic { color: var(--green); }
.toast.err .ic { color: var(--red); } .toast.info .ic { color: var(--gold2); }
.toast.out { animation: toastOut .4s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ===== Painel ===== */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 4px; backdrop-filter: blur(16px); transition: transform .35s var(--spring), border-color .3s; }
.kpi:hover { transform: translateY(-4px); border-color: var(--line2); }
.kpi-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--card2); color: var(--muted); margin-bottom: 8px; }
.kpi-v { font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-l { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi.green .kpi-ic { color: var(--green); background: var(--green-soft); }
.kpi.gold .kpi-ic { color: var(--gold2); background: var(--gold-soft); } .kpi.gold .kpi-v { color: var(--gold2); }
.kpi.warn .kpi-ic { color: var(--hot); background: rgba(255, 122, 69, .12); } .kpi.warn { border-color: rgba(255, 122, 69, .35); }
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dash-grid .card { margin: 0; }
.span2 { grid-column: span 2; }
.bars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 4px; height: 190px; align-items: end; padding-bottom: 20px; }
.bar { position: relative; height: 100%; display: flex; align-items: flex-end; }
.bar i { display: block; width: 100%; height: 0; min-height: 2px; border-radius: 5px 5px 2px 2px; background: linear-gradient(to top, color-mix(in srgb, var(--green) 50%, transparent), var(--green)); transition: height 1s var(--spring); transition-delay: calc(var(--i) * 25ms); }
.bar.peak i { background: linear-gradient(to top, var(--gold), var(--gold2)); box-shadow: 0 0 20px -4px var(--gold); }
.grown .bar i { height: var(--h); }
.bar span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.hb-l { font-size: 13px; font-weight: 600; }
.hbar b { font-size: 14px; text-align: right; }
.hb-t { grid-column: 1 / -1; grid-row: 2; height: 8px; border-radius: 4px; background: var(--card2); overflow: hidden; }
.hb-t i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--gold); transition: width 1.1s var(--ease); transition-delay: calc(var(--i) * 80ms); }
.grown .hb-t i { width: var(--w); }
.hbar.won .hb-t i { background: var(--green); } .hbar.lost .hb-t i, .hbar.discard .hb-t i { background: var(--faint); }
.hbar small { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; margin-top: -2px; }
.hbar small:empty { display: none; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:not(:first-child), .tbl th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: 130px; }
.spark .ln { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 2000; stroke-dashoffset: 2000; transition: stroke-dashoffset 2s var(--ease); vector-effect: non-scaling-stroke; }
.grown .spark .ln { stroke-dashoffset: 0; }
.spark .ln.in { stroke: var(--green); } .spark .ln.out { stroke: var(--gold2); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 3px; border-radius: 2px; } .lg.in { background: var(--green); } .lg.out { background: var(--gold2); }

/* ===== Funil ===== */
.summary { font-size: 14px; color: var(--muted); }
.summary b { color: var(--text); }
.board { display: flex; gap: 14px; overflow-x: auto; padding: 16px 2px 14px; scroll-snap-type: x proximity; min-height: 420px; }
.col { flex: 0 0 300px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 10px; background: color-mix(in srgb, var(--card) 60%, transparent); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; transition: border-color .25s, background .25s, transform .3s var(--spring); animation: viewIn .6s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
.col.over { border-color: var(--gold); background: var(--gold-soft); transform: scale(1.01); }
.col header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 8px; padding: 4px 4px 8px; border-bottom: 1px solid var(--line); }
.col header em { font-style: normal; font-family: var(--font); font-size: 12px; font-weight: 800; color: var(--muted); background: var(--card2); padding: 2px 8px; border-radius: 999px; }
.col header small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.col-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.won .col-dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.lost .col-dot { background: var(--red); box-shadow: none; } .discard .col-dot { background: var(--faint); box-shadow: none; }
.col-body { display: grid; grid-auto-rows: max-content; gap: 10px; align-content: start; overflow-y: auto; max-height: calc(100dvh - 330px); padding: 2px; }
.col-empty { font-size: 13px; color: var(--faint); text-align: center; padding: 20px 6px; border: 1px dashed var(--line2); border-radius: 12px; }
.lead { background: var(--card-solid); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 8px; cursor: grab; transition: transform .3s var(--spring), box-shadow .3s, opacity .3s; }
.lead:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.lead.dragging { opacity: .4; transform: rotate(2deg) scale(.98); }
.lead.dropped { animation: drop .6s var(--spring); }
.lead.gone { animation: gone .4s var(--ease) forwards; }
@keyframes drop { from { transform: scale(.85); box-shadow: 0 0 0 3px var(--gold); } }
@keyframes gone { to { opacity: 0; transform: scale(.8); height: 0; padding: 0; margin: 0; } }
.lead-top { display: flex; align-items: center; gap: 8px; }
.lead-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.lead-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.lead-foot { display: flex; gap: 6px; align-items: center; }
.lead-foot select { padding: 5px 8px; font-size: 12px; border-radius: 8px; flex: 1; min-width: 0; }
.value { border: 0; background: none; font-weight: 800; color: var(--gold2); font-size: 14px; display: inline-flex; gap: 4px; align-items: center; padding: 0; white-space: nowrap; }
.value-in { width: 110px; padding: 4px 8px; font-size: 13px; }
.hint { display: none; }

/* ===== Testar IA ===== */
.test-wrap { padding: 0; overflow: hidden; height: calc(100dvh - 190px); min-height: 420px; display: flex; flex-direction: column; gap: 0; }
.test-bar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.test-msgs { flex: 1; }
.test-comp { border-top: 1px solid var(--line); }
.test-empty { margin: 40px auto; text-align: center; display: grid; gap: 14px; justify-items: center; max-width: 520px; }

/* ===== Prospectar ===== */
.pros-grid { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; margin-bottom: 16px; }
.pros-grid > .card { margin: 0; }
.pros-side { display: grid; gap: 16px; }
.pros-side .card { margin: 0; }
.search-form { display: grid; grid-template-columns: 2fr 1.4fr .7fr auto; gap: 10px; align-items: end; }
.res-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; margin-top: 6px; }
.res-list { display: grid; gap: 8px; max-height: 560px; overflow-y: auto; padding-right: 4px; }
.res { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font-weight: 400; cursor: pointer; transition: border-color .2s, transform .3s var(--spring); animation: viewIn .5s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.res:hover { border-color: var(--gold); transform: translateX(3px); }
.res.dim { opacity: .55; }
.res input { margin-top: 4px; }
.res-main { display: grid; gap: 3px; flex: 1; min-width: 0; }
.res-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.score { display: grid; justify-items: center; gap: 2px; width: 44px; flex: none; }
.score i { width: 40px; height: 6px; border-radius: 3px; background: var(--line2); position: relative; overflow: hidden; }
.score i::after { content: ''; position: absolute; inset: 0; width: var(--s); background: linear-gradient(90deg, var(--gold), var(--green)); border-radius: 3px; }
.score small { font-size: 11px; color: var(--muted); font-weight: 700; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--card-solid) 30%); padding-top: 14px; }
.ring-row { display: flex; align-items: center; gap: 16px; }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .tr { stroke: var(--card2); }
.ring .pg { stroke: url(#none); stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); }
.ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring b { font-size: 28px; font-weight: 800; line-height: 1; }
.ring small { font-size: 11px; color: var(--muted); }
.ring-info { display: grid; gap: 4px; }
.pf { display: grid; gap: 12px; }
.pf .pm-tp { display: none; } .pf.mode-tp .pm-tp { display: grid; } .pf.mode-tp .pm-ia { display: none; }
.pf .row input { min-width: 0; }
.days { display: flex; gap: 6px; }
.days label { display: block; }
.days input { position: absolute; opacity: 0; }
.days span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line2); font-weight: 700; color: var(--muted); cursor: pointer; transition: all .25s var(--spring); }
.days input:checked + span { background: var(--gold); color: var(--on-gold); border-color: transparent; transform: scale(1.06); }
.tips { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 13.5px; color: var(--muted); }
.tips b { color: var(--text); }
.queue { display: grid; gap: 8px; }
.qi { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); animation: viewIn .4s var(--ease) both; }
.qi-main { display: grid; gap: 4px; min-width: 0; flex: 1; }
.qi-msg { font-size: 13.5px; padding: 8px 10px; border-radius: 10px; background: var(--bubble-bot); outline: none; }
.qi-msg[contenteditable]:focus { box-shadow: 0 0 0 2px var(--gold); }
.qi-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.qi.st-enviada { border-left: 3px solid var(--green); } .qi.st-erro, .qi.st-sem_whatsapp { border-left: 3px solid var(--red); } .qi.st-fila { border-left: 3px solid var(--gold); } .qi.st-pulada { opacity: .6; }
.tag.st-enviada { color: var(--green); } .tag.st-erro, .tag.st-sem_whatsapp { color: var(--red); } .tag.st-fila { color: var(--gold2); }

/* ===== Ajustes ===== */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-top: 16px; }
.set-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none !important; transition: transform .35s var(--spring), border-color .25s; backdrop-filter: blur(14px); }
.set-card.pop { animation: viewIn .55s var(--ease) both; animation-delay: calc(var(--i) * 35ms); }
.set-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.set-card > span:nth-child(2) { display: grid; flex: 1; }
.set-card small { color: var(--muted); font-size: 12.5px; }
.set-card .chev { color: var(--faint); transition: transform .3s var(--spring); }
.set-card:hover .chev { transform: translateX(4px); color: var(--gold2); }
.sec-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold2); flex: none; }
.crumb { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.sec-head { align-items: center; justify-content: flex-start; }
.sec-body { max-width: 900px; }
.set-form h3 { margin-bottom: 4px; }
.t-rows { display: grid; gap: 8px; }
.t-row { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border-radius: 12px; border: 1px solid transparent; transition: border-color .3s, background .3s; animation: viewIn .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.t-row:hover { background: var(--card2); }
.t-row.saved { border-color: var(--green); }
.t-row.gone { animation: gone .3s forwards; }
.t-row.new { animation: drop .6s var(--spring); }
.t-row input, .t-row textarea, .t-row select { padding: 8px 10px; font-size: 14px; }
.t-row .short, .t-add .short { max-width: 150px; }
.t-row .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold2); font-weight: 800; font-size: 12px; flex: none; margin-top: 6px; }
.t-row .switch { margin-top: 6px; }
.t-add { display: flex; gap: 8px; align-items: flex-start; padding-top: 12px; border-top: 1px dashed var(--line2); flex-wrap: wrap; }
.t-add > input, .t-add > textarea { flex: 1 1 200px; }
.stage-row select { width: auto; }
.stage-row .col-dot { margin-top: 15px; flex: none; }
.user-row { align-items: center; }
.user-row > .grow { display: grid; }
.user-row select { width: auto; }
.xs-sp { width: 28px; }
.providers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.prov { display: grid; gap: 6px; padding: 14px; border-radius: 14px; border: 1px solid var(--line2); background: var(--card2); color: var(--text); cursor: pointer; transition: border-color .25s, transform .3s var(--spring); font-weight: 400; }
.prov:hover { transform: translateY(-2px); }
.prov.on { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.prov input { position: absolute; opacity: 0; }
.prov .tag { justify-self: start; }
.kits { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.kit { display: grid; gap: 6px; justify-items: start; text-align: left; padding: 16px; border-radius: 14px; border: 1px solid var(--line2); background: var(--card2); transition: transform .3s var(--spring), border-color .25s; animation: viewIn .5s var(--ease) both; animation-delay: calc(var(--i) * 50ms); }
.kit:hover { transform: translateY(-3px); border-color: var(--gold); }
.kit .ic { color: var(--gold2); }
.kit small { color: var(--muted); }
.kit.applied { border-color: var(--green); }
.kit.applied small { color: var(--green); }
.days-grid { display: grid; gap: 8px; margin: 10px 0; }
.day-row { display: grid; grid-template-columns: auto 80px 1fr auto 1fr auto 1fr auto 1fr; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--card2); transition: opacity .3s; }
.day-row.off { opacity: .45; }
.day-row input[type="time"] { padding: 6px 8px; font-size: 13px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
.steps b { color: var(--text); }
.code { position: relative; }
.code pre { margin: 0; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 12px; overflow: auto; max-height: 300px; }
.code .btn { position: absolute; right: 10px; top: 10px; }
.copy-box { display: flex; gap: 8px; }
.wa-card { min-height: 120px; }
.wa-status { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.wa-status > div { display: grid; }
.wa-status small { color: var(--muted); font-size: 13px; }
.wa-status .dot { width: 14px; height: 14px; }
.qr { width: 260px; height: 260px; margin: 10px auto 0; padding: 12px; background: #fff; border-radius: 18px; display: grid; place-items: center; animation: drop .6s var(--spring); }
.qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.mev { padding: 10px 12px; border-radius: 12px; background: var(--card2); border-left: 3px solid var(--green); display: grid; gap: 2px; }
.mev.bad { border-left-color: var(--red); }
.mev.bad small { color: var(--red); }
.mev + .mev { margin-top: 8px; }
.info p { font-size: 14px; color: var(--muted); }
.info b { color: var(--text); }
.sec-body .enter > * { animation: viewIn .5s var(--ease) both; }

/* ===== Login ===== */
.login { display: grid; grid-template-columns: 1.1fr 1fr; height: 100%; align-items: center; padding: 24px clamp(16px, 5vw, 80px); gap: 40px; }
.login-art { display: grid; gap: 18px; position: relative; }
.hero-title { font-size: clamp(40px, 6vw, 76px); font-weight: 800; letter-spacing: -.045em; line-height: 1; }
.hero-title span, .hero-title em { display: inline-block; animation: rise .9s var(--ease) both; transform: translateY(40px); opacity: 0; }
.hero-title span:nth-child(2) { animation-delay: .08s; } .hero-title span:nth-child(3) { animation-delay: .16s; } .hero-title em { animation-delay: .26s; }
.login-art p { max-width: 460px; font-size: 17px; animation: viewIn .8s .4s var(--ease) both; }
.login-orbit { position: absolute; width: 380px; height: 380px; right: 0; top: -80px; pointer-events: none; opacity: .6; }
.login-orbit i { position: absolute; inset: 0; border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); border-radius: 50%; animation: spin 30s linear infinite; }
.login-orbit i::after { content: ''; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--gold2); box-shadow: 0 0 20px var(--gold2); }
.login-orbit i:nth-child(2) { inset: 50px; animation-duration: 22s; animation-direction: reverse; }
.login-orbit i:nth-child(3) { inset: 100px; animation-duration: 16s; }
.login-orbit i:nth-child(2)::after { background: var(--green); box-shadow: 0 0 20px var(--green); }
.login-card { width: min(420px, 100%); justify-self: center; display: grid; gap: 16px; padding: 32px; border-radius: 26px; background: var(--card); border: 1px solid var(--line2); backdrop-filter: blur(20px); box-shadow: var(--shadow); animation: viewIn .8s .2s var(--ease) both; }
.login-card h2 { font-size: 28px; }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ===== Responsivo ===== */
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(2, 1fr); } .pros-grid { grid-template-columns: 1fr; } }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }
@media (max-width: 900px) {
  body { overflow: hidden; }
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .side { flex-direction: row; align-items: center; padding: 10px 16px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); padding-top: max(10px, env(safe-area-inset-top)); backdrop-filter: none; background: var(--bg); }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .brand { flex: 1; min-width: 0; }
  .side-foot { margin: 0; display: flex; align-items: center; }
  .wa-pill span { display: none; }
  .wa-pill { padding: 10px; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(20px); border-top: 1px solid var(--line); }
  .nav a { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 10.5px; flex: 1; text-align: center; border-radius: 12px; }
  .nav a .ic { width: 22px; height: 22px; }
  .nav-badge { position: absolute; top: 2px; right: 18%; margin: 0; min-width: 17px; height: 17px; font-size: 10px; }
  .main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .view-conversas { padding: 0 0 calc(70px + env(safe-area-inset-bottom)); }
  .conv { grid-template-columns: 1fr; }
  .conv-list { padding: 16px 16px 0; border-right: 0; }
  .conv[data-open="1"] .conv-list { display: none; }
  .conv[data-open="0"] .conv-chat { display: none; }
  .conv[data-open="1"] .conv-chat { animation: slideIn .4s var(--ease); }
  @keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }
  .chat-head { padding: 10px 10px; gap: 8px; }
  .chat-head .back { display: inline-grid; }
  .chat-head .temp-pill { display: none; }
  .stage-select { max-width: 120px; }
  .msg { max-width: 88%; }
  .copilot { max-height: 65vh; }
  .grid2 { grid-template-columns: 1fr; }
  .search-form { grid-template-columns: 1fr 1fr; }
  .search-form label:first-child { grid-column: 1 / -1; }
  .providers { grid-template-columns: 1fr; }
  .day-row { display: flex; flex-wrap: wrap; }
  .day-row > b { flex: 1 1 60%; }
  .day-row input[type="time"] { flex: 1 1 38%; min-width: 0; }
  .day-row small { flex: 1 1 100%; }
  .login { grid-template-columns: 1fr; align-content: center; overflow: auto; }
  .login-orbit { display: none; }
  .login-art { text-align: center; justify-items: center; }
  .hero-title { font-size: 40px; }
  .hint { display: block; }
  .col { flex-basis: 84vw; }
  .test-wrap { height: calc(100dvh - 250px); }
  #toasts { left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); max-width: none; }
  .qi { flex-direction: column; }
  .qi-acts { justify-content: flex-start; }
  .modal { padding: 20px; }
}
@media (max-width: 520px) {
  .kpis { gap: 10px; } .kpi { padding: 14px; }
  .page-head { margin-bottom: 16px; }
  .composer .seg button { padding: 6px 9px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .aurora { display: none; }
}

/* Copiloto: chance de fechar (não usa o .bar do gráfico) */
.cop-chance { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: baseline; gap: 4px 10px; }
.cop-chance .bar { grid-column: 1 / -1; height: 6px; width: 100%; border-radius: 6px; background: var(--card2); overflow: hidden; display: block; position: static; }
.cop-chance .bar i { display: block; height: 100%; min-height: 0; width: var(--w); border-radius: 6px; background: var(--green); transition: width .8s var(--ease); }
.cop-chance.morno .bar i { background: var(--gold); } .cop-chance.frio .bar i { background: #5aa9ff; }

/* Botão geral do bot */
.bot-pill { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); font-size: 13px; font-weight: 600; cursor: pointer; width: 100%; }
.bot-pill .sw { margin-left: auto; width: 30px; height: 17px; border-radius: 10px; background: var(--faint); position: relative; transition: background .2s; }
.bot-pill .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: transform .2s; }
.bot-pill.on .sw { background: var(--green); } .bot-pill.on .sw::after { transform: translateX(13px); }
.bot-pill.off { border-color: color-mix(in srgb, var(--red) 50%, var(--line2)); }

/* Mídia recebida */
.media-audio { width: min(280px, 100%); height: 40px; display: block; margin-bottom: 4px; }
.media-sticker { width: 140px; height: 140px; object-fit: contain; display: block; }
.media-img { max-width: min(280px, 100%); max-height: 320px; border-radius: 10px; display: block; margin-bottom: 4px; }

/* ---------- Agenda ---------- */
.row.between { justify-content: space-between; align-items: center; }
.link-btn { background: none; border: 0; color: var(--gold); font-weight: 700; font-size: 13px; cursor: pointer; padding: 0; }
.ag-wrap { display: grid; grid-template-columns: 270px 1fr; gap: 16px; align-items: start; }
.ag-side { padding: 16px; display: grid; gap: 18px; position: sticky; top: 12px; }
.ag-month b { font-size: 14px; }
.ag-mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 10px; text-align: center; }
.ag-mgrid small { font-size: 11px; font-weight: 800; color: var(--muted); padding: 4px 0; }
.ag-d { background: none; border: 0; border-radius: 8px; padding: 6px 0; font-size: 13px; color: var(--text); cursor: pointer; font-weight: 600; }
.ag-d:hover { background: var(--card2); }
.ag-d.out { color: var(--faint); }
.ag-d.wk { background: var(--gold-soft); }
.ag-d.today { background: var(--gold); color: var(--on-gold); }
.ag-filters { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.ag-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.ag-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.ag-sum { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.ag-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ag-kpis span { background: var(--card2); border-radius: 10px; padding: 8px 10px; font-size: 12px; color: var(--muted); display: grid; }
.ag-kpis em { font-style: normal; font-size: 16px; font-weight: 800; color: var(--text); }
.ag-main { padding: 0; overflow: hidden; }
.ag-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ag-bar b { margin-left: 6px; }
.ag-grid { max-height: calc(100dvh - 200px); overflow: auto; }
.ag-head { display: grid; grid-template-columns: 60px repeat(7, minmax(110px, 1fr)); position: sticky; top: 0; z-index: 3; background: var(--card-solid); border-bottom: 1px solid var(--line); }
.ag-head > div { padding: 10px 6px; text-align: center; display: flex; gap: 6px; justify-content: center; align-items: baseline; }
.ag-head b { font-size: 18px; } .ag-head small { color: var(--muted); }
.ag-head .today b { background: var(--gold); color: var(--on-gold); border-radius: 8px; padding: 0 7px; }
.ag-body { display: grid; grid-template-columns: 60px repeat(7, minmax(110px, 1fr)); }
.ag-hours div { height: var(--hh); font-size: 11px; color: var(--muted); text-align: right; padding: 0 8px; transform: translateY(-7px); }
.ag-col { position: relative; border-left: 1px solid var(--line); cursor: copy; }
.ag-col.today { background: color-mix(in srgb, var(--gold) 5%, transparent); }
.ag-slot { height: var(--hh); border-top: 1px solid var(--line); }
.ag-slot:hover { background: var(--card2); }
.ag-ev { position: absolute; left: 3px; right: 3px; border: 0; border-radius: 8px; padding: 5px 7px; text-align: left; overflow: hidden; cursor: pointer; display: grid; align-content: start; gap: 1px;
  background: color-mix(in srgb, var(--c) 26%, var(--card-solid)); border-left: 3px solid var(--c); color: var(--text); font-size: 12px; z-index: 1; transition: transform .15s; }
.ag-ev:hover { transform: scale(1.02); z-index: 2; }
.ag-ev b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev b i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c); margin-right: 5px; }
.ag-ev span, .ag-ev small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 11px; }
.ag-ev.cancelado b { text-decoration: line-through; opacity: .7; }
.ag-now { position: absolute; left: 0; right: 0; height: 2px; background: #ef4444; z-index: 2; pointer-events: none; }
.ag-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }
@media (max-width: 900px) {
  .ag-wrap { grid-template-columns: 1fr; }
  .ag-side { position: static; }
  .ag-head, .ag-body { grid-template-columns: 46px repeat(7, 120px); }
}

/* ===== Etiquetas, anexos, entrega, link de conexão ===== */
.tag.label { color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border-color: color-mix(in srgb, var(--c) 35%, transparent); }
.tag-list { display: grid; gap: 8px; max-height: 40vh; overflow-y: auto; }
.tag-filter { width: auto; max-width: 220px; padding: 7px 10px; font-size: 13px; }
input[type="color"] { width: 48px; min-width: 48px; height: 42px; padding: 4px; }
.msg time .ack .ic { color: var(--muted); } .msg time .ack.read .ic { color: var(--blue); } .msg time .ack.failed .ic { color: var(--red); }
.msg.found { outline: 2px solid var(--gold); }
.icon-btn.att { flex: none; align-self: center; }
.mode-note .att, .mode-learning .att { opacity: .4; }
#mic.rec { color: #fff; background: var(--red); animation: ping 1.4s infinite; }
.file-prev { max-width: 100%; max-height: 45vh; border-radius: 12px; }
.connect { height: 100dvh; overflow-y: auto; display: grid; place-items: center; padding: 20px; }
.connect .card { max-width: 420px; display: grid; justify-items: center; gap: 8px; }
.connect .qr { width: min(300px, 80vw); height: min(300px, 80vw); }
