/* ============================================================
   ia99 — /dsh (CRM interno)
   ============================================================ */

:root{
  --bg:#0a0f12;
  --bg-2:#0d1418;
  --panel:#111b21;
  --panel-2:#16222a;
  --line:rgba(233,237,239,.08);
  --line-2:rgba(233,237,239,.14);
  --text:#e9edef;
  --muted:#e2e8ec;
  --muted-2:#b6c2c9;
  --green:#00a884;
  --green-2:#0b7c65;
  --green-soft:rgba(0,168,132,.14);
  --out:#005c4b;
  --in:#202c33;
  --blue:#53bdeb;
  --red:#f15c6d;
  --amber:#ffbc38;
  --r:14px;
  --sidebar:248px;
  --ease:cubic-bezier(.22,.61,.36,1);
}

*,*::before,*::after{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;background:var(--bg);color:var(--text);
  font-family:"Segoe UI",system-ui,-apple-system,Roboto,Helvetica,Arial,sans-serif;
  font-size:14px;line-height:1.45;-webkit-font-smoothing:antialiased;
  overflow:hidden;
}
a{color:inherit;text-decoration:none}
button{font-family:inherit}
img{display:block;max-width:100%}
:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
input,textarea,select{font-family:inherit}

/* ---------- shell ---------- */
.shell{
  display:grid;grid-template-columns:var(--sidebar) 1fr;
  height:100dvh;overflow:hidden;
}
.side{
  display:flex;flex-direction:column;gap:.2rem;
  background:var(--bg-2);border-right:1px solid var(--line);
  padding:.7rem .55rem;overflow-y:auto;
}
.side-brand{display:flex;align-items:center;gap:.55rem;padding:.35rem .4rem .9rem}
.side-brand .mark{
  width:32px;height:32px;border-radius:9px;display:grid;place-items:center;
  background:linear-gradient(135deg,#12b886,#075e54);color:#fff;font-weight:800;font-size:.78rem;
}
.side-brand b{font-size:.92rem;letter-spacing:-.01em}
.side-brand small{display:block;color:var(--muted-2);font-size:.68rem;letter-spacing:.1em;text-transform:uppercase}
.side-group{font-size:.66rem;letter-spacing:.14em;text-transform:uppercase;color:var(--muted-2);padding:.9rem .55rem .35rem}
.nav-item{
  display:flex;align-items:center;gap:.6rem;width:100%;
  padding:.55rem .6rem;border-radius:9px;border:0;background:transparent;
  color:var(--muted);font-size:.88rem;text-align:left;cursor:pointer;
  transition:background .2s,color .2s;
}
.nav-item svg{width:17px;height:17px;flex:none;opacity:.85}
.nav-item:hover{background:rgba(255,255,255,.04);color:var(--text)}
.nav-item.on{background:var(--green-soft);color:#d8fff4}
.nav-item.on svg{opacity:1;color:var(--green)}
.nav-item .badge{margin-left:auto;font-size:.68rem;background:var(--green);color:#04140f;border-radius:20px;padding:.05rem .4rem;font-weight:700}
.side-foot{margin-top:auto;padding:.6rem .4rem .2rem;border-top:1px solid var(--line);display:flex;align-items:center;gap:.5rem}
.side-foot .who{display:grid;font-size:.76rem;color:var(--muted);min-width:0}
.side-foot .who b{color:var(--text);font-size:.8rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.side-foot img, .side-foot .ava{width:30px;height:30px;border-radius:50%;flex:none;object-fit:cover;background:var(--panel-2);display:grid;place-items:center;font-size:.75rem;color:var(--green)}

.main{display:flex;flex-direction:column;min-width:0;overflow:hidden}
.topbar{
  display:flex;align-items:center;gap:.7rem;
  padding:.65rem 1rem;border-bottom:1px solid var(--line);background:var(--bg-2);
}
.topbar h1{font-size:.98rem;margin:0;font-weight:600;letter-spacing:-.01em}
.topbar .sub{color:var(--muted-2);font-size:.76rem}
.topbar .spacer{margin-left:auto}
.view{flex:1;min-height:0;overflow:auto}
.view.no-pad{overflow:hidden;padding:0}

/* ---------- componentes ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.4rem;
  padding:.55rem .85rem;border-radius:10px;border:1px solid var(--line-2);
  background:var(--panel-2);color:var(--text);font-size:.84rem;font-weight:600;cursor:pointer;
  transition:filter .2s,background .2s,transform .12s;
}
.btn:hover{background:#1d2c35}
.btn:active{transform:scale(.99)}
.btn.green{background:var(--green);border-color:transparent;color:#04140f}
.btn.green:hover{filter:brightness(1.07)}
.btn.ghost{background:transparent}
.btn.danger{background:rgba(241,92,109,.12);border-color:rgba(241,92,109,.35);color:#ffb3bc}
.btn.sm{padding:.35rem .6rem;font-size:.76rem;border-radius:8px}
.btn svg{width:15px;height:15px}

.pad{padding:1.1rem clamp(.9rem,3vw,1.4rem)}
.grid{display:grid;gap:.8rem}
.card{
  background:var(--panel);border:1px solid var(--line);border-radius:var(--r);padding:1rem;
}
.card h2, .card h3{margin:0 0 .2rem;font-size:.92rem;font-weight:600}
.card .hint{color:var(--muted-2);font-size:.78rem;margin:.1rem 0 .9rem}

.field{display:grid;gap:.3rem;margin-bottom:.75rem}
.field label{font-size:.75rem;color:var(--muted);letter-spacing:.02em}
.field .help{font-size:.7rem;color:var(--muted-2)}
input[type=text],input[type=password],input[type=email],input[type=number],input[type=url],textarea,select{
  width:100%;padding:.55rem .65rem;border-radius:9px;border:1px solid var(--line-2);
  background:#0c151a;color:var(--text);font-size:.86rem;
  transition:border-color .2s,box-shadow .2s;
}
textarea{min-height:74px;resize:vertical}
input:focus,textarea:focus,select:focus{outline:none;border-color:var(--green);box-shadow:0 0 0 3px rgba(0,168,132,.14)}
.row{display:grid;gap:.7rem;grid-template-columns:1fr 1fr}
@media (max-width:760px){.row{grid-template-columns:1fr}}
.tag{display:inline-flex;align-items:center;gap:.3rem;padding:.15rem .5rem;border-radius:20px;font-size:.7rem;background:var(--green-soft);color:#9ff0d8}
.tag.gray{background:rgba(255,255,255,.06);color:var(--muted)}
.tag.amber{background:rgba(255,188,56,.14);color:var(--amber)}
.empty{display:grid;place-items:center;gap:.4rem;padding:2.4rem 1rem;color:var(--muted-2);text-align:center;font-size:.86rem}
.empty b{color:var(--text);font-size:.95rem}

/* ---------- chat ---------- */
.chat-wrap{display:grid;grid-template-columns:320px 1fr;height:100%;min-height:0}
.chat-wrap.with-ai{grid-template-columns:300px 1fr 330px}
.chat-list{display:flex;flex-direction:column;border-right:1px solid var(--line);min-height:0;background:var(--bg-2)}
.chat-search{padding:.6rem;border-bottom:1px solid var(--line)}
.chat-search input{background:#0c151a}
.threads{overflow-y:auto;flex:1}
.thread{
  display:flex;gap:.6rem;width:100%;text-align:left;padding:.6rem .7rem;border:0;background:transparent;
  cursor:pointer;border-bottom:1px solid rgba(255,255,255,.03);color:inherit;
}
.thread:hover{background:rgba(255,255,255,.03)}
.thread.on{background:rgba(0,168,132,.09)}
.thread .ava{
  width:38px;height:38px;border-radius:50%;flex:none;display:grid;place-items:center;
  background:#123a34;color:#8ff0d8;font-weight:700;font-size:.85rem;
}
.thread .info{min-width:0;flex:1;display:grid;gap:.1rem}
.thread .info b{font-size:.85rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.thread .info span{font-size:.74rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.thread .when{font-size:.66rem;color:var(--muted-2);white-space:nowrap}
.thread .dot{width:8px;height:8px;border-radius:50%;background:var(--green);margin-top:.35rem}

.chat-open{display:flex;flex-direction:column;min-height:0;background:var(--bg);position:relative}
.chat-open::before{
  content:"";position:absolute;inset:0;pointer-events:none;
  background-image:radial-gradient(rgba(233,237,239,.028) 1px,transparent 1px);
  background-size:22px 22px;
}
.chat-head{
  display:flex;align-items:center;gap:.6rem;padding:.55rem .8rem;
  background:var(--in);border-bottom:1px solid rgba(0,0,0,.3);z-index:2;
}
.chat-head .ava{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#123a34;color:#8ff0d8;font-weight:700}
.chat-head .peer{display:grid;min-width:0}
.chat-head .peer b{font-size:.88rem}
.chat-head .peer span{font-size:.72rem;color:var(--muted)}
.chat-head .acts{margin-left:auto;display:flex;gap:.1rem}
.ai-toggle{position:relative}
.ai-toggle::after{content:"";position:absolute;top:6px;right:6px;width:6px;height:6px;border-radius:50%;background:var(--green)}
.messages{flex:1;overflow-y:auto;padding:1rem .8rem;display:grid;align-content:start;gap:.35rem;z-index:1}
.day{align-self:center;margin:.3rem auto .7rem;padding:.22rem .6rem;border-radius:7px;background:#182229;color:var(--muted);font-size:.68rem;letter-spacing:.05em;text-transform:uppercase}
.msg{max-width:min(78%,560px);padding:.42rem .55rem .3rem;border-radius:10px;font-size:.87rem;position:relative;box-shadow:0 1px 1px rgba(0,0,0,.2)}
.msg.in{background:var(--in);justify-self:start;border-top-left-radius:3px}
.msg.out{background:var(--out);justify-self:end;border-top-right-radius:3px}
.msg .meta{display:flex;align-items:center;justify-content:flex-end;gap:.25rem;margin:.3rem 0 -.1rem .6rem;font-size:.64rem;color:rgba(233,237,239,.6)}
.msg.out .meta svg{width:13px;height:13px;color:var(--blue)}
.msg .cap{font-size:.86rem;word-wrap:break-word;white-space:pre-wrap}
.msg .media{display:block;border-radius:7px;overflow:hidden;margin-bottom:.25rem;max-width:280px}
.msg .media img,.msg .media video{display:block;width:100%;height:auto}
.msg .file{
  display:flex;align-items:center;gap:.6rem;padding:.5rem .6rem;border-radius:8px;
  background:rgba(0,0,0,.22);min-width:220px;
}
.msg .file .ico{width:34px;height:34px;border-radius:8px;display:grid;place-items:center;background:rgba(255,255,255,.08);font-size:.62rem;font-weight:700;color:#cfe9e3}
.msg .file .nm{font-size:.78rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:170px}
.msg .file .sz{font-size:.68rem;color:rgba(233,237,239,.6)}
.msg .file a.dl{margin-left:auto;color:var(--blue);display:grid;place-items:center;width:28px;height:28px;border-radius:50%}
.msg .file a.dl:hover{background:rgba(83,189,235,.14)}
.wave{display:flex;align-items:center;gap:2px;height:24px}
.wave i{width:2px;border-radius:2px;background:rgba(233,237,239,.8)}
.audio-row{display:flex;align-items:center;gap:.5rem;min-width:200px}
.audio-row .play{width:30px;height:30px;border-radius:50%;border:0;background:rgba(255,255,255,.14);color:#fff;display:grid;place-items:center;cursor:pointer}
.audio-row .dur{font-size:.68rem;color:rgba(233,237,239,.7)}

.composer{display:flex;align-items:flex-end;gap:.45rem;padding:.5rem .6rem;background:var(--in);border-top:1px solid rgba(0,0,0,.3);z-index:2}
.composer .pill{flex:1;display:flex;align-items:center;gap:.3rem;background:#2a3942;border-radius:20px;padding:.2rem .35rem}
.composer input[type=text]{background:transparent;border:0;padding:.45rem .4rem;font-size:.88rem}
.composer input[type=text]:focus{box-shadow:none}
.icon-btn{
  display:grid;place-items:center;width:36px;height:36px;border-radius:50%;
  border:0;background:transparent;color:var(--text);cursor:pointer;flex:none;position:relative;
}
.icon-btn:hover{background:rgba(255,255,255,.07)}
.icon-btn svg{width:20px;height:20px}
.send{width:42px;height:42px;border-radius:50%;border:0;background:var(--green);color:#04140f;display:grid;place-items:center;cursor:pointer;flex:none}
.send:active{transform:scale(.95)}
.send svg{width:20px;height:20px}
.send.rec{background:var(--red);color:#fff;animation:pulse 1.1s infinite}
@keyframes pulse{50%{box-shadow:0 0 0 8px rgba(241,92,109,.16)}}
.rec-time{position:absolute;inset:auto 0 calc(100% + 8px) 0;margin:auto;width:max-content;background:var(--red);color:#fff;font-size:.72rem;padding:.18rem .5rem;border-radius:7px}

.attach-menu{
  position:absolute;bottom:64px;left:.6rem;z-index:5;min-width:210px;
  background:var(--panel-2);border:1px solid var(--line-2);border-radius:12px;padding:.35rem;
  box-shadow:0 20px 50px -20px rgba(0,0,0,.9);display:none;
}
.attach-menu.open{display:block}
.attach-menu button{
  display:flex;align-items:center;gap:.55rem;width:100%;padding:.5rem .55rem;border:0;border-radius:8px;
  background:transparent;color:var(--text);font-size:.84rem;cursor:pointer;text-align:left;
}
.attach-menu button:hover{background:rgba(255,255,255,.06)}
.attach-menu .k{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-size:.7rem;font-weight:700}
.attach-menu .k.img{background:rgba(124,92,255,.2);color:#c4b5fd}
.attach-menu .k.vid{background:rgba(241,92,109,.18);color:#ffb3bc}
.attach-menu .k.doc{background:rgba(83,189,235,.18);color:#a9e2f7}
.attach-menu .k.zip{background:rgba(255,188,56,.18);color:#ffd98a}

/* ---------- sidebar IA ---------- */
.ai-panel{
  border-left:1px solid var(--line);background:var(--bg-2);
  display:flex;flex-direction:column;min-height:0;
}
.ai-panel[hidden]{display:none}
.ai-head{padding:.7rem .8rem;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:.5rem}
.ai-head b{font-size:.86rem}
.ai-head .tag{margin-left:auto}
.ai-body{flex:1;overflow-y:auto;padding:.7rem .8rem;display:grid;gap:.6rem;align-content:start}
.ai-msg{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:.55rem .65rem;font-size:.82rem}
.ai-msg.me{background:rgba(0,168,132,.1);border-color:rgba(0,168,132,.25)}
.ai-msg .who{font-size:.66rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted-2);margin-bottom:.2rem}
.ai-tools{display:flex;flex-wrap:wrap;gap:.3rem;margin-top:.45rem}
.ai-tools button{font-size:.7rem;padding:.2rem .45rem;border-radius:6px;border:1px solid var(--line-2);background:transparent;color:var(--muted);cursor:pointer}
.ai-tools button:hover{color:var(--text);border-color:var(--green)}
.ai-input{display:flex;gap:.35rem;padding:.55rem;border-top:1px solid var(--line)}
.ai-input input{flex:1}

/* ---------- listas / forms ---------- */
.toolbar{display:flex;gap:.5rem;align-items:center;margin-bottom:.9rem;flex-wrap:wrap}
.toolbar .spacer{margin-left:auto}
.items{display:grid;gap:.6rem}
.item{
  display:flex;gap:.75rem;align-items:flex-start;
  background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:.8rem .9rem;
}
.item .grow{flex:1;min-width:0}
.item b{font-size:.9rem}
.item p{margin:.2rem 0 0;color:var(--muted);font-size:.8rem}
.item .acts{display:flex;gap:.3rem;flex:none}
.item .color{width:10px;border-radius:6px;align-self:stretch;background:var(--green)}
.skills{display:flex;flex-wrap:wrap;gap:.3rem;margin-top:.4rem}
.skill{display:inline-flex;align-items:center;gap:.3rem;background:rgba(255,255,255,.05);border:1px solid var(--line);border-radius:20px;padding:.12rem .5rem;font-size:.72rem;color:var(--muted)}
.skill button{border:0;background:transparent;color:var(--muted-2);cursor:pointer;font-size:.9rem;line-height:1;padding:0}
.skill button:hover{color:var(--red)}
.modal-bg{
  position:fixed;inset:0;z-index:50;background:rgba(3,7,9,.72);backdrop-filter:blur(3px);
  display:grid;place-items:center;padding:1rem;
}
.modal-bg[hidden]{display:none}
.modal{
  width:min(680px,100%);max-height:88vh;overflow-y:auto;
  background:var(--bg-2);border:1px solid var(--line-2);border-radius:16px;padding:1.1rem;
  box-shadow:0 30px 80px -30px rgba(0,0,0,.9);
}
.modal header{display:flex;align-items:center;margin-bottom:.8rem}
.modal header h3{margin:0;font-size:.98rem}
.modal header .x{margin-left:auto}
.modal footer{display:flex;gap:.5rem;justify-content:flex-end;margin-top:1rem}

table{width:100%;border-collapse:collapse;font-size:.82rem}
th,td{text-align:left;padding:.5rem .55rem;border-bottom:1px solid var(--line)}
th{color:var(--muted-2);font-weight:600;font-size:.72rem;letter-spacing:.06em;text-transform:uppercase}
td.num, th.num{text-align:right;font-variant-numeric:tabular-nums}
tr:hover td{background:rgba(255,255,255,.02)}

.upload{
  display:flex;align-items:center;gap:.6rem;padding:.5rem .6rem;border:1px dashed var(--line-2);
  border-radius:10px;color:var(--muted);font-size:.8rem;cursor:pointer;
}
.upload:hover{border-color:var(--green);color:var(--text)}
.thumb{width:42px;height:42px;border-radius:8px;object-fit:cover;background:var(--panel-2)}

.toast{
  position:fixed;bottom:1rem;left:50%;transform:translateX(-50%) translateY(20px);
  background:var(--green);color:#04140f;font-weight:600;font-size:.84rem;
  padding:.6rem .9rem;border-radius:10px;opacity:0;pointer-events:none;z-index:80;
  transition:opacity .25s,transform .25s;
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

@media (max-width:900px){
  .shell{grid-template-columns:72px 1fr}
  .side-brand b, .side-brand small, .nav-item span, .side-group{display:none}
  .nav-item{justify-content:center}
  .chat-wrap, .chat-wrap.with-ai{grid-template-columns:1fr}
  .chat-list{display:none}
  .chat-wrap.show-list .chat-list{display:flex}
  .chat-wrap.show-list .chat-open{display:none}
  .ai-panel{position:fixed;inset:0 0 0 auto;width:min(340px,88vw);z-index:40;box-shadow:-20px 0 60px rgba(0,0,0,.6)}
}

/* ---------- módulo Meta ---------- */
.meta-wrap{display:grid;grid-template-columns:minmax(0,1fr);height:100%;min-height:0}
.meta-wrap.with-ai{grid-template-columns:minmax(0,1fr) 340px}
.meta-main{overflow:auto;min-height:0}
.tabs{display:flex;gap:.25rem;flex-wrap:wrap;margin-bottom:1rem;border-bottom:1px solid var(--line);padding-bottom:.4rem}
.tab{border:0;background:transparent;color:var(--muted);font-size:.82rem;padding:.45rem .7rem;border-radius:8px;cursor:pointer}
.tab:hover{color:var(--text);background:rgba(255,255,255,.04)}
.tab.on{background:var(--green-soft);color:#d8fff4;font-weight:600}
.kpis{display:grid;gap:.6rem;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));margin-bottom:1rem}
.kpi{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:.75rem .85rem;display:grid;gap:.15rem}
.kpi span{font-size:.68rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted-2)}
.kpi b{font-size:1.35rem;letter-spacing:-.02em}
.kpi em{font-size:.72rem;color:var(--muted);font-style:normal}
.funil{display:grid;gap:.45rem}
.funil-row{display:grid;grid-template-columns:96px minmax(0,1fr) 74px 52px;align-items:center;gap:.5rem}
.funil-row .lbl{font-size:.76rem;color:var(--muted)}
.funil-row .bar{height:16px;border-radius:5px;background:linear-gradient(90deg,rgba(0,168,132,.85),rgba(83,189,235,.55));display:block}
.funil-row .val{font-size:.78rem;font-variant-numeric:tabular-nums;text-align:right}
.funil-row .taxa{font-size:.7rem;color:var(--muted-2);text-align:right}
.diag{list-style:none;margin:.2rem 0 0;padding:0;display:grid;gap:.6rem}
.diag li{font-size:.82rem;color:var(--muted);padding-left:.7rem;border-left:2px solid var(--green)}
.diag li b{display:block;color:var(--text);font-size:.85rem;margin-bottom:.1rem}
.code{background:#08110f;border:1px solid var(--line);border-radius:10px;padding:.7rem .8rem;font-size:.74rem;line-height:1.5;overflow-x:auto;color:#bfe9dd;font-family:ui-monospace,Consolas,monospace}
@media (max-width:1100px){.meta-wrap.with-ai{grid-template-columns:minmax(0,1fr)} .meta-wrap .ai-panel{position:fixed;inset:0 0 0 auto;width:min(340px,90vw);z-index:40;box-shadow:-20px 0 60px rgba(0,0,0,.6)}}

/* ---------- toggle IA e painel do chefe ---------- */
.ia-switch{
  display:inline-flex;align-items:center;gap:.3rem;height:30px;padding:0 .5rem 0 .35rem;
  border-radius:20px;border:1px solid var(--line-2);background:#0d181d;color:var(--muted);
  font-size:.68rem;font-weight:700;letter-spacing:.04em;cursor:pointer;margin-right:.2rem;
}
.ia-switch .knob{width:22px;height:16px;border-radius:10px;background:#2a3942;position:relative;transition:background .25s}
.ia-switch .knob::after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#e2e8ec;transition:transform .25s,background .25s}
.ia-switch.on{border-color:rgba(0,168,132,.5);color:#9ff0d8}
.ia-switch.on .knob{background:rgba(0,168,132,.3)}
.ia-switch.on .knob::after{transform:translateX(6px);background:#00a884}
.ia-switch em{font-style:normal}

.chefe-block{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:.6rem .7rem}
.chefe-block .who{font-size:.64rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted-2);margin-bottom:.25rem}
.chefe-acoes{display:grid;grid-template-columns:1fr 1fr;gap:.35rem}
.chefe-acoes button{
  border:1px solid var(--line-2);background:#0d181d;color:var(--text);border-radius:9px;
  padding:.5rem .4rem;font-size:.74rem;cursor:pointer;text-align:center;
}
.chefe-acoes button:hover{border-color:var(--green);color:#d8fff4}
.chefe-acoes button:disabled{opacity:.5;cursor:wait}
.chefe-out{background:rgba(0,168,132,.08);border:1px solid rgba(0,168,132,.3);border-radius:10px;padding:.6rem .7rem;display:grid;gap:.45rem}
.chefe-out p{margin:0;font-size:.82rem;white-space:pre-wrap}
.chefe-out .btn{justify-self:start}

/* ---------- filtros e etiquetas no chat ---------- */
.filtros{display:flex;gap:.3rem;overflow-x:auto;padding:.45rem .55rem;border-bottom:1px solid var(--line);scrollbar-width:none}
.filtros::-webkit-scrollbar{display:none}
.filtro{flex:none;border:1px solid var(--line);background:transparent;color:var(--muted);border-radius:20px;padding:.25rem .55rem;font-size:.7rem;cursor:pointer;white-space:nowrap}
.filtro.on{background:var(--green-soft);border-color:rgba(0,168,132,.4);color:#9ff0d8}
.tag-select{
  width:auto;max-width:104px;padding:.28rem .4rem;font-size:.7rem;border-radius:8px;
  background:#2a3942;border:1px solid var(--line);color:var(--muted);
}
.peer-tags{display:flex;gap:.25rem;flex-wrap:wrap;margin-top:.1rem}
.mini-tag{font-style:normal;font-size:.62rem;border:1px solid;border-radius:20px;padding:0 .35rem;line-height:1.4;white-space:nowrap}

/* ---------- agenda ---------- */
.agenda-top{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap;margin-bottom:.9rem}
.mes-nav{display:flex;align-items:center;gap:.2rem}
.mes-nav b{font-size:.95rem;text-transform:capitalize;min-width:150px;text-align:center}
.cal{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:.6rem}
.cal-semana{display:grid;grid-template-columns:repeat(7,1fr);gap:.25rem;margin-bottom:.3rem}
.cal-semana span{text-align:center;font-size:.64rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted-2)}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:.25rem}
.cal-dia{
  position:relative;aspect-ratio:1;border:1px solid transparent;border-radius:10px;background:#0d181d;
  color:var(--text);cursor:pointer;display:grid;align-content:center;justify-items:center;gap:.15rem;
  padding:.15rem;font-size:.8rem;transition:border-color .15s,background .15s;
}
.cal-dia:hover{border-color:var(--line-2)}
.cal-dia.fora{opacity:.35}
.cal-dia.hoje{border-color:rgba(0,168,132,.6)}
.cal-dia.sel{background:rgba(0,168,132,.16);border-color:var(--green)}
.cal-dia .num{font-variant-numeric:tabular-nums}
.cal-dia .pontos{display:flex;gap:2px;height:5px}
.cal-dia .pontos i{width:4px;height:4px;border-radius:50%;display:block}
.cal-legenda{display:flex;gap:.8rem;flex-wrap:wrap;margin:.7rem 0 .2rem;font-size:.7rem;color:var(--muted)}
.cal-legenda span{display:inline-flex;align-items:center;gap:.3rem}
.cal-legenda i{width:7px;height:7px;border-radius:50%;display:block}
.item.reuniao .acts-col{display:grid;gap:.25rem;flex:none}

/* ---------- funis (pipelines) ---------- */
.item.pipe:hover{border-color:rgba(0,168,132,.35);background:rgba(0,168,132,.04)}
.etapa-num{
  flex:none;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;
  border:1px solid var(--line-2);font-size:.78rem;font-weight:700;background:#0d181d;
}
.item.etapa .acts-col{display:grid;gap:.3rem;flex:none}
.pipe-linha{display:flex;align-items:center;gap:.2rem;flex-wrap:wrap;margin-bottom:.8rem;padding:.55rem .6rem;
  background:var(--panel);border:1px solid var(--line);border-radius:12px;overflow-x:auto}
.pipe-dot{width:12px;height:12px;border-radius:50%;flex:none;box-shadow:0 0 0 3px rgba(255,255,255,.04)}
.pipe-seta{color:var(--muted-2);font-style:normal;font-size:.7rem;margin:0 .15rem}

/* ---------- agentes agrupados por funil ---------- */
.grupo-agentes{margin-bottom:1.5rem}
.grupo-agentes > header{display:flex;align-items:center;gap:.5rem;margin-bottom:.15rem;flex-wrap:wrap}
.grupo-agentes > header h3{margin:0;font-size:.92rem;letter-spacing:-.01em}
.grupo-agentes > header .btn{margin-left:auto}
.grupo-agentes > header::after{content:"";flex:1}

/* ---------- funil no cabeçalho do chat ---------- */
.pipe-line{display:block;margin-top:.1rem}
.pipe-select{
  width:auto;max-width:190px;padding:.1rem .3rem;font-size:.66rem;border-radius:6px;
  background:rgba(0,168,132,.12);border:1px solid rgba(0,168,132,.28);color:#9ff0d8;
}

/* ---------- treino da IA por mensagem ---------- */
.msg{position:relative}
.msg .train{
  position:absolute;top:-7px;right:-7px;width:24px;height:24px;border-radius:50%;padding:0;
  background:#0b141a;border:1px solid #00a884;color:#00a884;display:none;place-items:center;cursor:pointer;
}
.msg:hover .train,.msg:focus-within .train{display:grid}
@media (hover:none){.msg .train{display:grid;opacity:.6}}
.msg .train svg{width:13px;height:13px}
.msg .train:hover{background:#00a884;color:#04140f}
.citacao{margin:.5rem 0 .9rem;padding:.6rem .8rem;border-left:3px solid #00a884;background:#0d171d;
  border-radius:0 10px 10px 0;font-size:.86rem;color:#e2e8ec}

/* ---------- meta: navegação em 3 níveis ---------- */
.migalha{display:flex;align-items:center;gap:.4rem;font-size:.82rem;margin-bottom:.2rem;flex-wrap:wrap}
.migalha button{background:none;border:0;color:#4cc9f0;font:inherit;cursor:pointer;padding:0;border-bottom:1px solid rgba(76,201,240,.4)}
.migalha button:hover{color:#00e5a0;border-color:#00e5a0}
.migalha span{color:#e2e8ec}
.migalha span:last-child{color:#fff;font-weight:600}
tr.linha-click{cursor:pointer}
tr.linha-click:hover{background:rgba(0,229,160,.06)}
.vazio-meta{padding:1.2rem;border:1px dashed rgba(0,229,160,.35);border-radius:12px;color:#b6c2c9;font-size:.85rem;text-align:center}

/* botão subir (rascunho -> Meta) */
.btn.subir{border-color:#4cc9f0;color:#4cc9f0;background:transparent}
.btn.subir:hover{background:#4cc9f0;color:#000}

/* ticket médio editável */
.kpi.ticket input{width:100%;background:#000;border:1px solid #00e5a0;border-radius:8px;
  color:#fff;font-size:1.15rem;font-weight:700;padding:.25rem .4rem;margin-top:.2rem}
.kpi.ticket input:focus{outline:none;border-color:#4cc9f0}
