/* Acelera Cortex — componentes. Só usa variáveis de tokens.css. Tailwind cuida de espaçamento/grid;
   cores, tipografia e componentes de identidade ficam aqui. */

/* ---------- base ---------- */
html { background: var(--bg-0); }
body { margin: 0; background: var(--bg-0); color: var(--text); font-family: var(--font-body); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .t-display, .t-h2 { font-family: var(--font-display); font-weight: 500; letter-spacing: -.01em; }
h1 { font-size: 26px; line-height: 1.15; }
h2 { font-size: 18px; line-height: 1.25; }
h3 { font-size: 15px; line-height: 1.3; }
.t-display { font-size: 34px; line-height: 1.05; letter-spacing: -.02em; }
.t-num, .num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
a { color: inherit; text-decoration: none; }
.link { color: var(--accent-text); }
.link:hover { text-decoration: underline; }
.faint { color: var(--text-3); }
.muted { color: var(--text-2); }
::selection { background: var(--lime); color: var(--lime-ink); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
[x-cloak] { display: none !important; }
hr { border: 0; border-top: 1px solid var(--line); }

/* ---------- layout: sidebar + palco ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.app.collapsed { grid-template-columns: var(--sidebar-min) minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; padding: 16px 12px; border-right: 1px solid var(--line); background: var(--bg-1); display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.stage { padding: 22px 26px 96px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 17px; padding: 2px 6px; height: 32px; white-space: nowrap; }
.brand .anel { font-size: 24px; }
.brand .tog { margin-left: auto; color: var(--text-3); width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; }
.brand .tog:hover { background: var(--bg-3); color: var(--text); }
.navl { display: flex; flex-direction: column; gap: 2px; }
.navl a, .navl button { display: flex; align-items: center; gap: 10px; color: var(--text-2); padding: 7px 10px; border-radius: var(--r-sm); font-size: 13.5px; position: relative; white-space: nowrap; width: 100%; text-align: left; background: none; border: 0; font: inherit; cursor: pointer; }
.navl a:hover, .navl button:hover { background: var(--bg-3); color: var(--text); }
.navl a.on { background: var(--accent-soft); color: var(--text); }
.navl a.on .ic { color: var(--accent-text); }
.navl a .ic { font-size: 18px; color: var(--text-3); }
.navl a .cnt { margin-left: auto; }
.navl a.soon { opacity: .45; cursor: default; }
.navl .sec { font-size: 11.5px; color: var(--text-3); padding: 12px 10px 4px; white-space: nowrap; }
.navl a .ava { font-size: 22px; }
.navl a .sub { display: block; font-size: 11px; color: var(--text-3); line-height: 1.2; }
.me { margin-top: auto; display: grid; gap: 8px; font-size: 13px; padding: 6px; }
.me .who { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; }
.me .who b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.collapsed .navl a span, .collapsed .navl .sec, .collapsed .brand span, .collapsed .me .who span, .collapsed .theme, .collapsed .me .sair { display: none; }
.collapsed .brand .tog { margin-left: 0; }
.collapsed .brand { justify-content: center; padding: 2px 0; }
.collapsed .navl a, .collapsed .navl button { justify-content: center; padding: 8px 0; }
.collapsed .navl a .cnt { display: grid; position: absolute; top: 2px; right: 6px; width: 14px; height: 14px; padding: 0; font-size: 9px; place-items: center; border-radius: 50%; }
.collapsed .me .who { justify-content: center; }
.cnt { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; background: var(--lime); color: var(--lime-ink); }
.cnt.crit { background: var(--crit); color: #fff; }
.cnt.soft { background: var(--bg-3); color: var(--text-2); }
.tip { position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); background: var(--text); color: var(--bg-0); font-size: 12px; padding: 5px 9px; border-radius: 7px; white-space: nowrap; box-shadow: var(--shadow); z-index: 30; pointer-events: none; opacity: 0; transition: opacity .12s; }
.collapsed .navl a:hover .tip { opacity: 1; }
.theme { display: flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; width: max-content; }
.theme button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 12px; padding: 4px 10px; border-radius: var(--r-pill); cursor: pointer; }
.theme button[aria-pressed="true"] { background: var(--lime); color: var(--lime-ink); font-weight: 600; }
.pagehead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pagehead h1 { margin-right: auto; }
.pagehead .crumb { color: var(--text-3); font-size: 13px; }
.pagehead .crumb:hover { color: var(--text); }
@media (max-width: 900px) {
  .app, .app.collapsed { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: var(--sidebar); transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .stage { padding: 14px 14px 96px; }
}

/* ---------- anel (7 estados) ---------- */
/* Cada cápsula fica num <g> rotacionado; animações de cápsula agem no <rect>, que não tem transform próprio. */
.anel { display: inline-block; width: 1em; height: 1em; vertical-align: middle; flex: none; overflow: visible; }
.anel rect { fill: var(--lime); transform-box: fill-box; transform-origin: center; }
.anel.thinking { animation: spin 2.4s linear infinite; }
.anel.thinking rect { animation: pulse 1.2s ease-in-out infinite; }
.anel.attn { animation: breathe 1.8s ease-in-out infinite; }
.anel.attn g:nth-child(1) rect { animation: blink 1.8s ease-in-out infinite; }
.anel.ping { animation: tick .9s cubic-bezier(.2,.8,.2,1) 1 both; }
.anel.ping rect { animation: lightup .9s ease-out 1 both; }
.anel.listen rect { animation: bar 1s ease-in-out infinite; }
.anel.done rect { opacity: .25; animation: fillin .35s ease-out forwards; }
.anel.err { animation: shake .5s ease-in-out 1; }
.anel.err rect { fill: var(--crit); }
.anel.err g:nth-child(odd) rect { opacity: .35; }
.anel.meter rect { fill: var(--line-strong); }
.anel.meter[data-on="1"] g:nth-child(-n+1) rect, .anel.meter[data-on="2"] g:nth-child(-n+2) rect, .anel.meter[data-on="3"] g:nth-child(-n+3) rect, .anel.meter[data-on="4"] g:nth-child(-n+4) rect,
.anel.meter[data-on="5"] g:nth-child(-n+5) rect, .anel.meter[data-on="6"] g:nth-child(-n+6) rect, .anel.meter[data-on="7"] g:nth-child(-n+7) rect, .anel.meter[data-on="8"] g:nth-child(-n+8) rect { fill: var(--meter, var(--lime)); }
.anel.idle rect { fill: var(--line-strong); }
.anel.ink rect { fill: var(--lime-ink); }
.anel g:nth-child(2) rect { animation-delay: .15s; } .anel g:nth-child(3) rect { animation-delay: .3s; } .anel g:nth-child(4) rect { animation-delay: .45s; }
.anel g:nth-child(5) rect { animation-delay: .6s; } .anel g:nth-child(6) rect { animation-delay: .75s; } .anel g:nth-child(7) rect { animation-delay: .9s; } .anel g:nth-child(8) rect { animation-delay: 1.05s; }
.anel.done g:nth-child(2) rect { animation-delay: .1s; } .anel.done g:nth-child(3) rect { animation-delay: .2s; } .anel.done g:nth-child(4) rect { animation-delay: .3s; }
.anel.done g:nth-child(5) rect { animation-delay: .4s; } .anel.done g:nth-child(6) rect { animation-delay: .5s; } .anel.done g:nth-child(7) rect { animation-delay: .6s; } .anel.done g:nth-child(8) rect { animation-delay: .7s; }
.anel.ping g:nth-child(2) rect { animation-delay: .06s; } .anel.ping g:nth-child(3) rect { animation-delay: .12s; } .anel.ping g:nth-child(4) rect { animation-delay: .18s; }
.anel.ping g:nth-child(5) rect { animation-delay: .24s; } .anel.ping g:nth-child(6) rect { animation-delay: .3s; } .anel.ping g:nth-child(7) rect { animation-delay: .36s; } .anel.ping g:nth-child(8) rect { animation-delay: .42s; }
.anel.listen g:nth-child(2) rect { animation-delay: .12s; animation-duration: .8s; } .anel.listen g:nth-child(3) rect { animation-delay: .25s; animation-duration: 1.1s; } .anel.listen g:nth-child(4) rect { animation-delay: .05s; animation-duration: .7s; }
.anel.listen g:nth-child(5) rect { animation-delay: .3s; } .anel.listen g:nth-child(6) rect { animation-delay: .18s; animation-duration: .9s; } .anel.listen g:nth-child(7) rect { animation-delay: .4s; animation-duration: 1.2s; } .anel.listen g:nth-child(8) rect { animation-delay: .1s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes blink { 0%, 60%, 100% { opacity: 1; } 30% { opacity: .25; } }
@keyframes tick { from { transform: rotate(-90deg); } to { transform: rotate(0); } }
@keyframes lightup { 0% { opacity: .2; } 40% { opacity: 1; } 100% { opacity: 1; } }
@keyframes bar { 0%, 100% { transform: scaleY(.7); opacity: .6; } 50% { transform: scaleY(1.3); opacity: 1; } }
@keyframes fillin { to { opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 10%, 50% { transform: translateX(-3%); } 30%, 70% { transform: translateX(3%); } 20%, 40%, 60%, 80% { transform: translateX(0); } }
@keyframes halo { 70% { box-shadow: 0 0 0 12px rgba(172,217,38,0); } 100% { box-shadow: 0 0 0 0 rgba(172,217,38,0); } }
@keyframes appear { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- ícones, canais, avatares ---------- */
.ic { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; flex: none; }
.ic .d { fill: var(--lime); stroke: none; opacity: .25; }
.canal { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.canal .ic { font-size: 14px; color: var(--text-2); }
.canal.solo .ic { font-size: 16px; }
.ava { display: inline-block; width: 1em; height: 1em; border-radius: 50%; flex: none; overflow: hidden; vertical-align: middle; }
.avatar { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; background: var(--teal); flex: none; overflow: hidden; font-family: var(--font-display); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; border-radius: 11px; }
.avatar.xl { width: 56px; height: 56px; font-size: 18px; border-radius: 14px; }
.avatar.a2 { background: #3B6C2E; } .avatar.a3 { background: #5A4D8C; } .avatar.a4 { background: #8C5A2E; } .avatar.a5 { background: #2E7C8C; } .avatar.a6 { background: #6D2E8C; } .avatar.a7 { background: #8C2E4F; }

/* ---------- cards, botões, pílulas ---------- */
.card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; min-width: 0; }
.card.tight { padding: 12px 14px; }
.card .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card .hd h2, .card .hd h3 { margin-right: auto; }
.card.soft { background: var(--bg-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r-pill); padding: 8px 15px; font: inherit; font-weight: 600; font-size: 13px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; color: var(--text); background: var(--bg-2); line-height: 1.2; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--lime); color: var(--lime-ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-primary .anel rect { fill: var(--lime-ink); }
.btn-secondary { background: var(--bg-2); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-3); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-3); color: var(--text); }
.btn-danger { background: var(--crit-soft); color: var(--crit); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-xs { padding: 3px 9px; font-size: 12px; font-weight: 500; }
.btn-icon { width: 34px; height: 34px; padding: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-pill); padding: 4px 11px; font-size: 12.5px; border: 1px solid var(--line); color: var(--text-2); background: var(--bg-2); white-space: nowrap; cursor: pointer; }
.pill:hover { color: var(--text); border-color: var(--line-strong); }
.pill.on { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.tag { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-pill); padding: 2px 9px; font-size: 11.5px; font-weight: 500; border: 1px solid var(--line); color: var(--text-2); background: var(--bg-2); white-space: nowrap; line-height: 1.5; }
.tag.ok { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.tag.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.tag.crit { color: var(--crit); background: var(--crit-soft); border-color: transparent; }
.tag.idle { color: var(--idle); }
.tag.ia { color: var(--accent-text); border-color: rgba(172,217,38,.35); }
.tag.mono { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; flex: none; }
.seg a, .seg span, .seg button { padding: 4px 11px; border-radius: var(--r-pill); font-size: 12.5px; color: var(--text-2); cursor: pointer; border: 0; background: transparent; font: inherit; white-space: nowrap; }
.seg .on { background: var(--bg-0); color: var(--text); }
[data-theme="light"] .seg .on { background: #fff; box-shadow: 0 1px 2px rgba(2,16,43,.12); }
.delta { font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; color: var(--text-3); }
.delta.up { color: var(--accent-text); }
.delta.down { color: var(--crit); }
.note { border-left: 3px solid var(--lime); padding: 10px 14px; background: var(--accent-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 13.5px; }
.note.warn { border-color: var(--warn); background: var(--warn-soft); }
.note.crit { border-color: var(--crit); background: var(--crit-soft); }
.aviso { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-sm); font-size: 13px; background: var(--accent-soft); color: var(--accent-text); }
.aviso.erro { background: var(--crit-soft); color: var(--crit); }
.empty { color: var(--text-3); font-size: 13.5px; padding: 8px 0; }

/* semáforo dos sinais (severidade → cor) */
.sev-critico, .sev-vermelho { color: var(--crit); }
.sev-alto, .sev-laranja { color: var(--warn); }
.sev-atencao, .sev-amarelo { color: var(--warn); }
.sev-oportunidade, .sev-verde { color: var(--accent-text); }
.sev-interno, .sev-cinza { color: var(--idle); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--idle); }
.dot-critico, .dot-vermelho { background: var(--crit); }
.dot-alto, .dot-laranja { background: var(--warn); }
.dot-atencao, .dot-amarelo { background: var(--warn); opacity: .75; }
.dot-oportunidade, .dot-verde { background: var(--lime); }
.dot-interno, .dot-cinza { background: var(--idle); }
.tag-critico { color: var(--crit); background: var(--crit-soft); border-color: transparent; }
.tag-alto, .tag-atencao { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.tag-oportunidade { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.tag-interno { color: var(--idle); }
.st-proposta { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.st-aprovada { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.st-executada { color: var(--accent-text); border-color: rgba(172,217,38,.35); }
.st-falhou { color: var(--crit); background: var(--crit-soft); border-color: transparent; }
.st-rejeitada, .st-expirada { color: var(--idle); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1180px) { .kpis { grid-template-columns: repeat(6, 1fr); } }
.kpi { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 13px; display: grid; gap: 3px; position: relative; min-height: 84px; align-content: start; min-width: 0; color: inherit; }
.kpi .l { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.kpi .l .ic { font-size: 14px; color: var(--text-3); }
.kpi .v { font-family: var(--font-display); font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
.kpi .v .delta { margin-left: 6px; vertical-align: middle; }
.kpi .f { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.hero { background: var(--lime); color: var(--lime-ink); border-color: transparent; }
.kpi.hero .l, .kpi.hero .f { color: rgba(2,16,43,.7); }
.kpi.hero .l .ic { color: rgba(2,16,43,.6); }
.kpi.hero .delta { color: rgba(2,16,43,.75); }
.kpi.click { cursor: pointer; border-color: var(--line-strong); }
.kpi.click:hover { background: var(--bg-2); }
.kpi.click .v { color: var(--crit); }
.kpi.click.w .v { color: var(--warn); }
.kpi.click.i .v { color: var(--text); }
.kpi.click.g .v { color: var(--accent-text); }
.kpi.zero .v { color: var(--text-3); }

/* ---------- sinais (faixa + corpo) ---------- */
.strip { display: flex; gap: 10px; overflow-x: auto; overflow-y: visible; position: relative; align-items: flex-start; padding: 4px 2px 12px; scroll-snap-type: x proximity; }
.sg { flex: 0 0 300px; height: 92px; background: var(--sig-bg); border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-content: start; position: relative; cursor: pointer; scroll-snap-align: start; --sev: var(--idle); }
.sg .mk { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-1); border: 1px solid var(--line); margin-top: 2px; }
.sg .mk .anel { font-size: 18px; }
.sg .mk .anel rect { fill: var(--sev); }
.sg .lb { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); display: flex; gap: 6px; align-items: center; min-width: 0; }
.sg .lb .sv { color: var(--sev); }
.sg .tt { font-weight: 600; font-size: 13px; line-height: 1.3; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sg .h { display: grid; gap: 2px; min-width: 0; }
.sg.crit { --sev: var(--crit); } .sg.alto, .sg.atencao { --sev: var(--warn); } .sg.ok, .sg.oportunidade { --sev: var(--lime); }
.sg.new { border-color: rgba(172,217,38,.55); box-shadow: 0 0 0 3px var(--accent-soft); }
.sg.new .mk { background: var(--lime); border-color: transparent; }
.sg.new .mk .anel rect { fill: var(--lime-ink); }
.sg.live .mk .anel { animation: spin 2.4s linear infinite; }
.sg.checked, .sg.resolved { opacity: .7; }
.sg.checked .mk .anel rect, .sg.resolved .mk .anel rect { fill: var(--line-strong); }
.sg.resolved .tt { text-decoration: line-through; color: var(--text-2); }
.sg .body { display: none; position: absolute; left: 0; top: calc(100% + 6px); width: min(560px, calc(100vw - 60px)); background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 12px 14px; z-index: 20; cursor: default; grid-column: 1 / -1; animation: appear .15s ease-out; text-align: left; }
.sg.open { z-index: 21; }
.sg.open .body { display: block; }
.sg .body p { color: var(--text-2); font-size: 13px; margin: 0; }
.sg .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.sg .st { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; display: grid; gap: 2px; min-width: 0; }
.sg .st span { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg .st b { font-family: var(--font-display); font-weight: 500; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg .st b.good { color: var(--accent-text); } .sg .st b.bad { color: var(--crit); }
.sg .acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.sg .acts .sp { flex: 1; }
.estado { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.estado.novo { color: var(--accent-text); } .estado.live { color: var(--accent-text); } .estado.resolvido { color: var(--text-3); }

/* lista de sinais (tela Sinais) */
.sinal { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; --sev: var(--idle); }
.sinal.critico { --sev: var(--crit); } .sinal.alto, .sinal.atencao { --sev: var(--warn); } .sinal.oportunidade { --sev: var(--lime); }
.sinal .mk { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line); }
.sinal .mk .anel { font-size: 18px; } .sinal .mk .anel rect { fill: var(--sev); }
.sinal.novo .mk { background: var(--lime); border-color: transparent; } .sinal.novo .mk .anel rect { fill: var(--lime-ink); }
.sinal.live .mk .anel { animation: spin 2.4s linear infinite; }
.sinal.fechado { opacity: .65; }
.sinal .tt { font-weight: 600; font-size: 14px; line-height: 1.35; }
.sinal .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--text-3); }
.sinal .stats { display: flex; flex-wrap: wrap; gap: 8px; }
.sinal .st { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 10px; display: grid; gap: 1px; min-width: 110px; }
.sinal .st span { font-size: 11px; color: var(--text-3); } .sinal .st b { font-family: var(--font-display); font-weight: 500; font-size: 15px; font-variant-numeric: tabular-nums; }
.sinal .acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---------- tabelas ---------- */
.tblwrap { overflow-x: auto; position: relative; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-1); }
.tbl, table.dados { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, table.dados th { font-weight: 500; color: var(--text-3); font-size: 12px; text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td, table.dados td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td, table.dados tr:last-child td { border-bottom: 0; }
.tbl th.num, .tbl td.num, table.dados th.num, table.dados td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr.c { cursor: pointer; }
.tbl tbody tr.c:hover td, table.dados tbody tr:hover td { background: var(--bg-2); }
.tbl tr.open td { background: var(--bg-2); border-bottom: 0; }
.tbl .cl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tbl .cl b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl .cl .ex { color: var(--text-3); font-size: 12px; width: 14px; transition: transform .15s; display: inline-block; }
.tbl tr.open .cl .ex { transform: rotate(90deg); }
.tbl .chs { display: inline-flex; gap: 6px; }
.tbl tfoot td { color: var(--text-2); font-weight: 500; border-bottom: 0; border-top: 1px solid var(--line-strong); }
.expand td { padding: 0 12px 16px 46px; background: var(--bg-2); white-space: normal; border-bottom: 1px solid var(--line); }
.exp { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; font-size: 13px; padding-top: 6px; }
.exp > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.exp h4 { font-size: 11.5px; color: var(--text-3); font-weight: 500; margin: 0 0 6px; text-transform: none; }
.exp p { color: var(--text); margin: 0; white-space: pre-line; }
.exp ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.exp li { display: flex; gap: 8px; align-items: flex-start; }
.exp .sev { width: 6px; height: 6px; border-radius: 50%; margin-top: 7px; flex: none; }
@media (max-width: 900px) { .exp { grid-template-columns: 1fr; } .exp > div + div { padding-left: 0; border-left: 0; padding-top: 10px; border-top: 1px solid var(--line); } }
.li { display: grid; grid-template-columns: auto 28px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.li:last-child { border-bottom: 0; }
.li .rk { color: var(--text-3); width: 16px; font-family: var(--font-display); }
.li .sub { font-size: 12px; color: var(--text-3); }
.act { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.act:last-child { border-bottom: 0; }
.act .ava { font-size: 26px; margin-top: 1px; }
.act .w b { font-weight: 500; }
.act .w .sub { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.act .tm { font-size: 12px; color: var(--text-3); white-space: nowrap; text-align: right; display: grid; gap: 4px; justify-items: end; }
.barra { height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.barra > span { display: block; height: 100%; border-radius: 3px; background: var(--lime); }
.barra > span.acima { background: var(--crit); }
.barra > span.abaixo { background: var(--warn); }
.days { display: inline-flex; align-items: center; gap: 8px; }
.days .bar { width: 46px; height: 5px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.days .bar i { display: block; height: 100%; background: var(--lime); }
.days.w .bar i { background: var(--warn); } .days.c .bar i { background: var(--crit); }

/* ---------- cards de cliente ---------- */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.cc { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; display: grid; gap: 10px; position: relative; color: inherit; }
.cc:hover { border-color: var(--line-strong); background: var(--bg-2); }
.cc .top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cc .top b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc .ln { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--text-3); }
.cc .nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cc .nums .l { font-size: 11px; color: var(--text-3); }
.cc .nums .v { font-family: var(--font-display); font-size: 17px; font-variant-numeric: tabular-nums; }
.cc .sin { font-size: 12px; display: grid; gap: 3px; }
.cc .sin div { display: flex; gap: 6px; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- formulários ---------- */
.input, input.f, select.f, textarea.f { display: block; width: 100%; background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 8px 12px; color: var(--text); font: inherit; font-size: 13.5px; line-height: 1.4; }
input.f:focus, select.f:focus, textarea.f:focus { outline: 2px solid var(--lime); outline-offset: 0; border-color: transparent; }
input.f::placeholder, textarea.f::placeholder { color: var(--text-3); }
select.f { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input.f.sm, select.f.sm { padding: 5px 9px; font-size: 12.5px; }
select.f.sm { padding-right: 26px; }
.f.auto { width: auto; display: inline-block; }
textarea.f.mono { font-family: var(--mono); font-size: 12px; }
label.f { display: block; font-size: 13px; }
label.f > span { display: block; color: var(--text-2); margin-bottom: 4px; font-size: 12.5px; }
input[type=checkbox], input[type=radio] { accent-color: var(--lime); width: 15px; height: 15px; }
input[type=file] { font-size: 12.5px; color: var(--text-2); }
input[type=file]::file-selector-button { font: inherit; font-size: 12.5px; padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--text); margin-right: 8px; cursor: pointer; }
.pre { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; color: var(--text-2); max-height: 320px; overflow: auto; }
.ia { background: var(--accent-soft); border-left: 3px solid var(--lime); border-radius: 0 var(--r-md) var(--r-md) 0; }
.ia-box { background: var(--bg-2); border: 1px solid rgba(172,217,38,.28); border-radius: var(--r-md); }
.ia-box .hd { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--text-2); }
.ia-box .hd .anel { font-size: 16px; }
.ia-box .bd { padding: 12px; }
.acoes-hover { opacity: 0; transition: opacity .15s; }
.cc:hover .acoes-hover, .card:hover .acoes-hover { opacity: 1; }

/* ---------- painel lateral (chat) ---------- */
.dim { position: fixed; inset: 0; background: var(--dim); backdrop-filter: blur(3px); z-index: 45; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--drawer), 100vw); background: var(--bg-1); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; z-index: 50;
  background-image: radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,.06) 1px, transparent 1.5px); background-size: 18px 18px; }
[data-theme="light"] .drawer { background-image: radial-gradient(1px 1px at 50% 50%, rgba(2,16,43,.06) 1px, transparent 1.5px); }
.drawer.wide { position: static; width: auto; height: calc(100vh - 44px); box-shadow: none; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.drawer .dh { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: linear-gradient(135deg, var(--bg-3), var(--bg-2)); border-bottom: 1px solid var(--line-strong); position: relative; }
[data-theme="light"] .drawer .dh { background: linear-gradient(135deg, #E9EEDC, #F4F7EA); }
.drawer .dh::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--lime), transparent 70%); }
.drawer .dh .ava { font-size: 40px; box-shadow: 0 0 0 3px var(--bg-1), 0 0 0 5px var(--lime); }
.drawer .dh h3 { font-size: 15px; margin: 0; white-space: nowrap; }
.drawer .dh .st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.drawer .dh .st i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px var(--accent-soft); }
.drawer .dh .sp { flex: 1; min-width: 0; }
.drawer .dh .x { display: flex; gap: 4px; }
.drawer .dc { padding: 10px 16px 0; }
.ctx { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--sig-bg); font-size: 12.5px; --sev: var(--idle); }
.ctx.critico { --sev: var(--crit); } .ctx.alto, .ctx.atencao { --sev: var(--warn); } .ctx.oportunidade { --sev: var(--lime); }
.ctx .mk { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-1); border: 1px solid var(--line); display: grid; place-items: center; }
.ctx .mk .anel { font-size: 16px; } .ctx .mk .anel rect { fill: var(--sev); }
.ctx .lb { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.ctx .tt { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer .dm { padding: 14px 16px; display: grid; gap: 14px; align-content: start; overflow-y: auto; }
.msg { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.msg .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.msg .av .ava { font-size: 28px; }
.msg .body { display: grid; gap: 8px; min-width: 0; }
.msg .txt { font-size: 13.5px; line-height: 1.55; background: var(--bg-1); border: 1px solid var(--line); border-radius: 6px 16px 16px 16px; padding: 10px 14px; overflow-wrap: anywhere; }
.msg.user { grid-template-columns: 1fr; }
.msg.user .txt { background: var(--lime); color: var(--lime-ink); border: 0; border-radius: 16px 16px 6px 16px; padding: 8px 14px; max-width: 85%; justify-self: end; }
.msg .tools { font-size: 11px; color: var(--text-3); }
.composer { background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 8px 8px 8px 12px; display: grid; gap: 6px; }
.composer textarea { background: transparent; border: 0; color: var(--text); font: inherit; font-size: 13.5px; resize: none; width: 100%; outline: none; padding: 4px 0; }
.composer .row { display: flex; align-items: center; gap: 6px; }
.composer .row .sp { flex: 1; font-size: 11px; color: var(--text-3); }
.send { width: 32px; height: 32px; border-radius: 50%; background: var(--lime); color: var(--lime-ink); display: grid; place-items: center; border: 0; cursor: pointer; }
.send:disabled { opacity: .4; cursor: default; }
.drawer .df { padding: 10px 16px 14px; }
.sug { display: flex; flex-wrap: wrap; gap: 6px; }
.fab { position: fixed; right: 22px; bottom: 22px; width: 52px; height: 52px; border-radius: 50%; background: var(--bg-1); border: 1px solid var(--line-strong); box-shadow: var(--shadow); display: grid; place-items: center; z-index: 40; cursor: pointer; }
.fab .anel { font-size: 30px; }
.fab.attn { box-shadow: 0 0 0 0 rgba(172,217,38,.45); animation: halo 1.8s ease-out infinite; }
.fab .b { position: absolute; top: -2px; right: -2px; width: 16px; height: 16px; border-radius: 50%; background: var(--lime); color: var(--lime-ink); font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.prose-chat p { margin: 0 0 .5rem; } .prose-chat p:last-child { margin: 0; }
.prose-chat ul, .prose-chat ol { margin: .25rem 0 .5rem 1.1rem; } .prose-chat ul { list-style: disc; } .prose-chat ol { list-style: decimal; }
.prose-chat li { margin: .1rem 0; } .prose-chat strong { font-weight: 600; } .prose-chat h1, .prose-chat h2, .prose-chat h3 { font-weight: 600; margin: .5rem 0 .25rem; font-size: .95rem; font-family: var(--font-body); }
.prose-chat code { background: var(--bg-2); padding: 0 .25rem; border-radius: 3px; font-size: .85em; font-family: var(--mono); }
.prose-chat table { font-size: .8rem; border-collapse: collapse; } .prose-chat td, .prose-chat th { border: 1px solid var(--line); padding: 2px 6px; }
.prose-chat a { color: var(--accent-text); text-decoration: underline; }

/* ---------- utilidades ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.side-by { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.side-by.narrow { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 1000px) { .side-by, .side-by.narrow { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 8px 12px; font-size: 13px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-color: var(--lime); font-weight: 500; }
.thumb { aspect-ratio: 1; background: var(--bg-2); display: grid; place-items: center; overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: contain; }
.chart-wrap { position: relative; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- ajustes da rodada 2 (feedback do Edu, 05/09) ---------- */
@media (min-width: 1700px) { :root { --drawer: 560px; } }
.drawer .dh .st { min-width: 0; }
.drawer .dh .st span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer .dm { padding: 14px 16px; display: grid; gap: 14px; align-content: start; overflow-y: auto; min-height: 0; }
.drawer.wide { height: calc(100vh - 120px); min-height: 520px; }
.msg .who { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.msg .body > .txt + .txt { margin-top: 6px; }
.datacard { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-2); overflow: hidden; font-size: 13px; }
.datacard .rw { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.datacard .rw:last-child { border-bottom: 0; }
.datacard .rw span:first-child { color: var(--text-2); } .datacard .rw span:last-child { color: var(--text-3); font-size: 12px; text-align: right; }
.composer .pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.composer .pill { padding: 3px 9px; font-size: 12px; }
.mic { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-1); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-3); cursor: default; }
.mic .ic { font-size: 15px; }
.composer textarea { min-height: 44px; max-height: 160px; }
.chat-page { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .chat-page { grid-template-columns: 1fr; } }
.chat-page .drawer.wide .dm { max-width: 980px; width: 100%; justify-self: center; }
.chat-page .drawer.wide .df { max-width: 1012px; width: 100%; justify-self: center; }

/* sinais: linha do cliente no card */
.sg { height: 104px; }
.sg .cl { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.sg .cl .avatar.mini { width: 16px; height: 16px; font-size: 8px; border-radius: 4px; }
.sg .cl .ic { font-size: 13px; color: var(--text-3); }
.sg .cl .quando { color: var(--text-3); margin-left: auto; padding-left: 6px; }
.sg .tt { -webkit-line-clamp: 2; font-size: 12.5px; }
.sg .lb .sv { overflow: hidden; text-overflow: ellipsis; }

/* indicadores: menu, adicionar, modo de edição */
.kpis { position: relative; }
.kpi .more { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--text-3); background: var(--bg-2); border: 1px solid var(--line); font-size: 12px; opacity: 0; transition: opacity .12s; cursor: pointer; }
.kpi:hover .more, .kpi .more.on { opacity: 1; }
.kpi.hero .more { background: rgba(2,16,43,.12); color: var(--lime-ink); border-color: transparent; }
.kpi .menu { position: absolute; top: 34px; right: 8px; background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: var(--r-sm); box-shadow: var(--shadow); font-size: 12.5px; display: grid; min-width: 170px; z-index: 6; color: var(--text); overflow: hidden; }
.kpi .menu button { padding: 7px 12px; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.kpi .menu button:hover { background: var(--bg-2); }
.kpi .menu button:last-child { border-bottom: 0; color: var(--crit); }
.kpi.add { border-style: dashed; border-color: var(--line-strong); background: transparent; display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--text-2); cursor: pointer; text-align: center; font-size: 13px; }
.kpi.add:hover { border-color: var(--lime); color: var(--accent-text); }
.kpi.add .f { white-space: normal; }
.kpi.zero .v, .kpi.zero .l, .kpi.zero .f { color: var(--text-3); }
.kpi.zero .f { color: var(--warn); opacity: .85; }
.kpis.editing .kpi { animation: jiggle .28s ease-in-out infinite alternate; cursor: grab; border-style: dashed; border-color: var(--line-strong); user-select: none; }
.kpis.editing .kpi:nth-child(2n) { animation-delay: -.14s; }
.kpis.editing .kpi:nth-child(3n) { animation-duration: .32s; }
.kpis.editing .kpi.add { animation: none; border-color: var(--lime); color: var(--accent-text); }
.kpis.editing .kpi .more, .kpis.editing .kpi .menu { display: none; }
.kpis.editing .kpi.dragging { opacity: .35; }
.kpis.editing .kpi.over { outline: 2px solid var(--lime); outline-offset: 2px; }
.kpi .del, .kpi .pin { display: none; position: absolute; top: -8px; width: 22px; height: 22px; border-radius: 50%; place-items: center; font-size: 13px; font-weight: 700; box-shadow: var(--shadow); z-index: 2; border: 0; cursor: pointer; font-family: var(--font-body); }
.kpi .del { left: -8px; background: var(--text); color: var(--bg-0); }
.kpi .pin { right: -8px; background: var(--bg-3); color: var(--text-2); font-size: 11px; }
.kpi.hero .pin { background: var(--lime); color: var(--lime-ink); }
.kpis.editing .kpi .del, .kpis.editing .kpi .pin { display: grid; }
.editbar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 8px 8px 8px 16px; box-shadow: var(--shadow); font-size: 13px; z-index: 44; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--text); color: var(--bg-0); border-radius: var(--r-pill); padding: 8px 8px 8px 16px; font-size: 13px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); z-index: 46; animation: appear .15s ease-out; }
.toast button { background: var(--lime); color: var(--lime-ink); border: 0; border-radius: var(--r-pill); padding: 4px 10px; font: inherit; font-weight: 600; cursor: pointer; }
@keyframes jiggle { from { transform: rotate(-.9deg); } to { transform: rotate(.9deg); } }
@media (prefers-reduced-motion: reduce) { .kpis.editing .kpi { animation: none; } }

/* catálogo de indicadores */
.kpanel { background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow); display: grid; grid-template-columns: 1.6fr 1fr; overflow: hidden; animation: appear .15s ease-out; }
@media (max-width: 900px) { .kpanel { grid-template-columns: 1fr; } }
.kpanel .kl { padding: 16px 18px; border-right: 1px solid var(--line); display: grid; gap: 12px; align-content: start; }
.kpanel .kh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kpanel .kh h3 { margin-right: auto; }
.kpanel .kg { display: grid; gap: 4px; }
.kpanel .kg h4 { font-size: 12px; color: var(--text-3); font-family: var(--font-body); font-weight: 500; padding-top: 6px; margin: 0; }
.kpanel .ki { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: var(--r-sm); font-size: 13px; cursor: pointer; border: 0; background: none; color: var(--text); font-family: inherit; text-align: left; width: 100%; }
.kpanel .ki:hover { background: var(--bg-2); }
.kpanel .ki:disabled { cursor: default; opacity: .6; }
.kpanel .ki .cb { width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 11px; }
.kpanel .ki .cb.on { background: var(--lime); border-color: transparent; color: var(--lime-ink); }
.kpanel .ki .d { font-size: 11.5px; color: var(--text-3); }
.kpanel .ki.off > span:nth-child(2) { color: var(--text-2); }
.kpanel .kr { padding: 16px 18px; display: grid; gap: 12px; align-content: start; background: var(--sig-bg); }
.kpanel .kr h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.kpanel .kr .ask { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; font-size: 13px; color: var(--text-3); min-height: 64px; }
.kpanel .kf { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); flex-wrap: wrap; }
.kpanel .kf .sp { flex: 1; }

/* tabela de clientes da home: 10 linhas + rolagem, cabeçalho fixo, filtros e colunas */
.tblwrap.scroll { max-height: 548px; overflow: auto; }
.tblwrap.scroll thead th { position: sticky; top: 0; background: var(--bg-1); z-index: 2; }
.tblwrap.scroll .tbl th:first-child, .tblwrap.scroll .tbl td:first-child { position: sticky; left: 0; background: var(--bg-1); z-index: 1; }
.tblwrap.scroll .tbl thead th:first-child { z-index: 3; }
.tbl th .ic { font-size: 13px; vertical-align: -2px; margin-left: 3px; color: var(--text-3); }
.tbl td .num { font-family: var(--font-display); font-variant-numeric: tabular-nums; display: block; line-height: 1.1; font-size: 13.5px; }
.tbl td .delta { display: block; margin-top: 2px; }
.tbl tr.c:hover td { background: var(--bg-2); }
.tbl tr.open td:first-child, .tbl tr.c:hover td:first-child { background: var(--bg-2); }
.tbl .sd { display: inline-flex; align-items: center; justify-content: flex-end; }
.tblhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: relative; }
.tblhead h2 { margin-right: auto; }
.tblhead .busca { display: flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px 10px; }
.tblhead .busca input { background: transparent; border: 0; color: var(--text); font: inherit; font-size: 12.5px; width: 120px; outline: none; }
.colpop { position: absolute; right: 0; top: 40px; width: 340px; background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow); z-index: 25; font-size: 13px; display: grid; animation: appear .15s ease-out; }
.colpop .ph { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.colpop .rows { max-height: 320px; overflow: auto; padding: 6px 0; }
.colpop .r { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: center; padding: 6px 14px; cursor: pointer; border: 0; background: none; color: var(--text); width: 100%; text-align: left; font: inherit; }
.colpop .r:hover { background: var(--bg-2); }
.colpop .r .cb { width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 11px; }
.colpop .r .cb.on { background: var(--lime); border-color: transparent; color: var(--lime-ink); }
.colpop .pf { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-3); }
.colpop .pf .sp { flex: 1; }

/* saldos, churn e tarefas na home */
.balsum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.balsum .b { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 10px; display: grid; gap: 2px; }
.balsum .b span { font-size: 11px; color: var(--text-3); }
.balsum .b b { font-family: var(--font-display); font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; }
.balsum .b.c b { color: var(--crit); } .balsum .b.w b { color: var(--warn); } .balsum .b.g b { color: var(--accent-text); }
.bl { display: grid; grid-template-columns: 28px 1fr auto auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.bl:last-child { border-bottom: 0; }
.bl .sub { font-size: 11.5px; color: var(--text-3); }
.score { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-family: var(--font-display); font-size: 13px; font-variant-numeric: tabular-nums; background: conic-gradient(var(--sc, var(--crit)) calc(var(--p) * 1%), var(--line) 0); position: relative; flex: none; }
.score::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--bg-1); }
.score b { position: relative; font-weight: 500; }
.cr-row { display: grid; grid-template-columns: 36px 28px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.cr-row:last-child { border-bottom: 0; }
.cr-row .nm { font-weight: 500; }
.cr-row .why { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.cr-row .why .tag { padding: 1px 7px; font-size: 11px; }
.tk { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.tk:last-child { border-bottom: 0; }
.tk .cb { width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--line-strong); display: grid; place-items: center; background: none; color: var(--lime-ink); font-size: 11px; cursor: pointer; padding: 0; }
.tk .cb:hover { border-color: var(--lime); }
.tk .cb.on { background: var(--lime); border-color: transparent; }
.tk .t { font-weight: 500; }
.tk .m { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tk .m .avatar { width: 16px; height: 16px; font-size: 8px; border-radius: 4px; }
.tk .m .ava { font-size: 16px; }
.tk.done .t { text-decoration: line-through; color: var(--text-3); }
.tk .when { font-size: 12px; color: var(--text-3); white-space: nowrap; text-align: right; display: grid; gap: 4px; justify-items: end; }
.newtask { display: grid; gap: 6px; background: var(--bg-2); border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 10px 12px; font-size: 13px; margin-bottom: 8px; }
.newtask .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
/* painel lateral: cabeçalho e composer nunca estouram a largura */
.drawer .dh { flex-wrap: wrap; row-gap: 8px; }
.drawer .dh .sp { flex: 1 1 140px; }
.drawer .dh .x { display: flex; gap: 4px; align-items: center; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.drawer .dh .x select { max-width: 110px; }
.composer .row { flex-wrap: nowrap; min-width: 0; }
.composer .pills { flex-wrap: nowrap; overflow: hidden; min-width: 0; flex: 0 1 auto; }
.composer .row .sp { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text-3); }
.composer .mic, .composer .send { flex: none; }

/* véu de processamento (envio pelo WhatsApp): conteúdo desfocado atrás, cartão central */
.veu { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: color-mix(in srgb, var(--bg-0) 55%, transparent); -webkit-backdrop-filter: blur(9px) saturate(.8); backdrop-filter: blur(9px) saturate(.8); animation: veu-in .18s ease-out; }
.veu[hidden] { display: none; }
.veu-cx { display: grid; justify-items: center; gap: 12px; text-align: center; max-width: 420px; padding: 34px 38px; background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: 0 24px 80px color-mix(in srgb, var(--bg-0) 70%, transparent); }
.veu-t { font-family: var(--display, inherit); font-size: 21px; font-weight: 600; color: var(--text); }
.veu-s { font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.veu-s.faint { color: var(--text-3); font-size: 12.5px; }
body.com-veu { overflow: hidden; }
@keyframes veu-in { from { opacity: 0; } to { opacity: 1; } }
