:root {
  --bg:#101619; --card:#192226; --card2:#212d32; --bd:#2c3a40; --bd2:#40545b;
  --tx:#edf5f1; --mut:#a3b7b6; --ac:#8de2c3; --ok:#8de2c3; --wn:#f2c47d; --er:#ff9a9d;
  --rail:#131d21; --paper:#141d21; --selected:#1a3934; --accent-fill:#a0e9cf; --accent-ink:#102720;
  --s-open:#77cef4; --s-open-bg:#203640; --s-wait:#f2c47d; --s-wait-bg:#3b3225;
  --s-active:#8de2c3; --s-active-bg:#244039; --s-closed:#c1c9cb; --s-closed-bg:#303a3e;
  --shadow:0 14px 42px #050d1430;
}
:root[data-tema="claro"] {
  --bg:#f3f5ef; --card:#fffefb; --card2:#eaf0e9; --bd:#d9e2d9; --bd2:#a8bdb3;
  --tx:#182a26; --mut:#506862; --ac:#12664f; --ok:#11644f; --wn:#815011; --er:#a22e43;
  --rail:#e9efe8; --paper:#fbfcf7; --selected:#deeee5; --accent-fill:#155e4b; --accent-ink:#ffffff;
  --s-open:#175978; --s-open-bg:#e2f0f7; --s-wait:#75501b; --s-wait-bg:#f8eedb;
  --s-active:#145a46; --s-active-bg:#dcefe5; --s-closed:#455553; --s-closed-bg:#e8eeea;
  --shadow:0 14px 42px #183d2b16;
}
html body { background:var(--bg); color:var(--tx); font-family:Manrope,"Segoe UI",system-ui,sans-serif }
html #app { min-height:100dvh }
html #app > header,html #app [data-ticket] > header {
  background:var(--paper); border-color:var(--bd); min-height:68px; z-index:3;
}
html #app header h1 { font-size:clamp(20px,2vw,27px); letter-spacing:-.045em }
html #app header button { min-width:42px; min-height:42px }
html #app button,html .plus-dialog button { border-radius:9px }
html #app button:not(.sec),html .plus-dialog button:not(.sec),
html[data-tema="claro"] #app button:not(.sec),html[data-tema="claro"] .plus-dialog button:not(.sec) {
  background:var(--accent-fill); color:var(--accent-ink);
}
html #app button.sec,html .plus-dialog button.sec {
  background:var(--card); color:var(--tx); border:1px solid var(--bd);
}
html #app button.sec:hover,html[data-tema="claro"] #app button.sec:not(.on):hover { background:var(--card2); color:var(--tx); border-color:var(--bd2) }
html #app :is(input,textarea,select),html .plus-dialog :is(input,select) {
  background:var(--card); border-color:var(--bd2); color:var(--tx); border-radius:9px;
}
html #app :is(input,textarea)::placeholder,html[data-tema="claro"] #app :is(input,textarea)::placeholder { color:var(--mut) }
html #app .nav,html[data-tema="claro"] #app .nav { background:var(--rail); border-color:var(--bd) }
html #app .nav button,html[data-tema="claro"] #app .nav button { background:transparent; color:var(--mut); border-radius:9px }
html #app .nav button.on,html[data-tema="claro"] #app .nav button.on { background:var(--selected); color:var(--ac); border:1px solid var(--bd) }
html #app .nav button:hover { background:var(--card2); color:var(--tx) }
html #app .nav button i { display:grid; place-items:center }
html #app :is(.card,.kpi,.item) { border-color:var(--bd); border-radius:13px; background:var(--card) }
html #app .login { border-radius:20px; box-shadow:var(--shadow) }
html #app .kpi strong { font-size:32px; letter-spacing:-.055em }
html #app .tab button,html #app .tabs button { border-radius:9px }
html #app .tabs button.on,html[data-tema="claro"] #app .tabs button.on { background:var(--selected); color:var(--ac); border-color:var(--bd2) }
.desk-brand { display:none }
.desk-queue-card { display:grid; gap:7px; padding:11px 12px; cursor:pointer; min-width:0; border:1px solid var(--bd); border-radius:11px; background:var(--card) }
.desk-queue-card:hover { border-color:var(--bd2); background:var(--card2) }
.desk-queue-card.plus-selected { outline:0; border-color:var(--ac); background:var(--selected); box-shadow:inset 3px 0 var(--ac) }
.desk-queue-top,.desk-queue-bottom { display:flex; flex-wrap:wrap; align-items:center; gap:6px 9px; color:var(--mut); font-size:11px; line-height:1.35 }
.desk-queue-top time { margin-left:auto; font-variant-numeric:tabular-nums }
.desk-queue-title { color:var(--tx); font-size:14px; line-height:1.35; overflow-wrap:anywhere }
.desk-pill { display:inline-flex; align-items:center; padding:3px 7px; border-radius:5px; font-size:11px; font-weight:700; background:var(--s-closed-bg); color:var(--s-closed); line-height:1.35 }
.desk-pill[data-kind="open"] { background:var(--s-open-bg); color:var(--s-open) }
.desk-pill[data-kind="waiting"] { background:var(--s-wait-bg); color:var(--s-wait) }
.desk-pill[data-kind="active"] { background:var(--s-active-bg); color:var(--s-active) }
.desk-priority { color:var(--mut); font-weight:700 }
.desk-priority.is-urgent { color:var(--er) }
html #app #lista .desk-queue-card { min-height:98px }
.desk-detail-head { display:grid; gap:8px; min-width:0 }
.desk-ticket-ref { color:var(--ac); font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase }
html #app [data-ticket] .desk-detail-head h1 { font-size:clamp(19px,2.3vw,30px); overflow:visible; white-space:normal; line-height:1.18; overflow-wrap:anywhere }
html #app [data-ticket] .desk-top-meta { display:flex; align-items:center; flex-wrap:wrap; gap:6px 9px; margin:0; font-size:12px }
html #app .desk-top-meta :is(.tag,.desk-pill) { margin:0 }
.desk-context { color:var(--mut) }
html #app [data-ticket] .desk-detail-bar { padding-top:14px; padding-bottom:14px; border-bottom:1px solid var(--bd); background:var(--paper) }
.desk-detail-bar > div:empty { display:none !important }
.desk-detail-bar .ticket-status { display:flex; align-items:center; flex-wrap:wrap; gap:7px 10px; font-weight:700 }
html #app [data-ticket] .ticket-status select { width:auto; min-height:39px }
html #app .plus-tools { padding-top:13px; padding-bottom:13px; gap:8px }
html #app .plus-tools details,html #app .plus-sidebar details,html #app .plus-dialog {
  background:var(--card); border-color:var(--bd); border-radius:10px;
}
html #app .plus-sidebar details > summary,html #app .plus-tools summary { color:var(--tx); font-size:13px }
html #app .plus-sidebar .plus-filtros { flex-direction:column }
html #app .plus-sidebar .plus-filtros label { flex:auto }
html #app .plus-sidebar #plus-tema { font-size:12px; padding:7px 8px; min-height:36px; white-space:nowrap }
html #app .plus-sidebar #plus-q { min-height:42px; font-size:13px }
html #app .plus-sidebar #plus-status-filtro { min-height:37px; width:auto; margin-left:6px; font-size:12px }
.desk-conversation { margin:10px 0 0; padding:0 16px; color:var(--mut); font-size:12px; font-weight:800; letter-spacing:.07em; text-transform:uppercase }
html #app [data-ticket] .msgs { padding-top:10px; gap:10px }
html #app [data-ticket] .msgs .m {
  background:var(--card); border:1px solid var(--bd); border-radius:11px; padding:10px 13px; color:var(--tx);
}
html #app [data-ticket] .msgs .m.admin { background:var(--selected); border-color:var(--bd2) }
html #app [data-ticket] .msgs .m.sistema { border:0; color:var(--mut); background:transparent }
html #app [data-ticket] .msgs .m:not([data-plus-msg]) { align-self:stretch; max-width:none; border-left:3px solid var(--ac) }
html #app [data-ticket] .send { background:var(--paper); border-color:var(--bd) }
html #app [data-ticket] .send button { min-width:74px }
html #app [data-ticket] .qr button { font-size:12px }
@media (min-width:768px) { .desk-conversation { padding-inline:24px } }
@media (min-width:1000px) {
  html body.plus-ticket-open #app { max-width:none; height:100dvh; overflow:hidden }
  html body.plus-ticket-open #app > .plus-split { grid-template-columns:minmax(274px,31%) minmax(0,1fr); min-height:0; flex:1; height:100%; max-width:none }
  html #app .plus-sidebar { padding:18px 14px; background:var(--rail); gap:10px }
  html #app .plus-sidebar-top h2 { font-size:20px; letter-spacing:-.05em }
  html #app [data-ticket] { display:flex; flex-direction:column; padding-bottom:0; background:var(--bg) }
  html #app [data-ticket] > :not(.send) { flex:none }
  html #app [data-ticket] .send { margin-top:auto }
  html #app .plus-sidebar .plus-pagina { gap:6px; margin-inline:0 }
}
@media (min-width:1024px) {
  html #app { padding-left:calc(174px + env(safe-area-inset-left,0px)) }
  html #app .nav { width:174px; padding:20px 10px; gap:5px }
  html #app .nav::before { content:none }
  .desk-brand { display:flex; align-items:center; gap:9px; margin:0 2px 16px; color:var(--tx); font-size:14px; font-weight:800; letter-spacing:-.02em }
  .desk-brand img { width:32px; height:32px; border-radius:7px }
  html #app .nav button { padding:10px; font-size:13px }
  html #app .nav button svg { width:18px; height:18px }
  html body.plus-ticket-open #app > .plus-split { grid-template-columns:clamp(275px,25vw,365px) minmax(0,1fr) }
  .desk-conversation { padding-inline:32px }
}
#desk-tema-lista { width:auto; padding:7px 10px; font-size:12px; white-space:nowrap }
html #app .desk-detail-bar { display:flex; flex-direction:row; flex-wrap:wrap; align-items:center; gap:8px 12px }
html #app .desk-detail-bar[hidden] { display:none }
html #app .desk-detail-bar .ticket-status + #os-btn { margin-left:4px }
.desk-disclosure { color:var(--tx); border:1px solid var(--bd); background:var(--card); border-radius:9px; padding:0 11px }
.desk-disclosure > summary { padding:9px 0; cursor:pointer; font-size:13px; font-weight:700 }
.desk-detail-bar .desk-disclosure[open] { flex-basis:100% }
html #app .desk-disclosure #cq-quadro { margin:0 0 10px !important }
html #app [data-ticket] .desk-remote { margin:12px 16px 0 }
html #app [data-ticket] .desk-remote > .box { padding:5px 0 10px !important }
@media (min-width:768px) { html #app [data-ticket] .desk-remote { margin-inline:24px } }
@media (min-width:1024px) { html #app [data-ticket] .desk-remote { margin-inline:32px } }
#app .desk-view select { min-height:39px; font-weight:650 }
#app .desk-view { min-width:min(205px,100%) }
#app #desk-pendentes {
  display:flex; align-items:center; gap:7px; max-width:100%; margin-left:auto; white-space:nowrap;
  color:var(--wn); background:var(--s-wait-bg); border-radius:9px; padding:4px 7px; font-size:12px; font-weight:700;
}
#app #desk-pendentes button { width:auto; min-height:34px; padding:5px 8px; font-size:12px }
.plus-dialog.desk-preview { width:min(1000px,calc(100% - 28px)); padding:12px }
.desk-preview-bar { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:10px }
.desk-preview-bar h2 { flex:1; min-width:140px; margin:0; overflow-wrap:anywhere; font-size:15px }
.desk-preview-image { overflow:auto; text-align:center; max-height:72dvh; border-radius:8px; background:var(--bg) }
.desk-preview-image img { display:block; margin:auto; max-width:100%; max-height:71dvh; object-fit:contain }
.desk-preview.ampliada img { max-width:none; max-height:none }
.desk-proxima-acao {
  margin:6px 16px 14px; padding:12px 14px; display:flex; gap:10px; align-items:center; justify-content:space-between;
  background:var(--s-wait-bg); color:var(--s-wait); border-radius:10px; border:1px solid var(--bd);
}
.desk-proxima-acao p { margin:3px 0 0; }
.desk-historico-lista,.desk-incidente-acoes { display:grid; gap:8px; padding:4px 0 10px; overflow-wrap:anywhere }
.desk-historico-lista .m { max-width:none }
.desk-operacoes { margin-bottom:8px }
.plus-dialog .desk-dia { display:inline-flex; align-items:center; gap:5px; margin:4px; }
.plus-dialog .desk-dia input { width:auto; }
.desk-agenda-item { display:grid; gap:5px; border:1px solid var(--bd); border-radius:9px; padding:8px }
.desk-agenda-item small { color:var(--mut) }
.desk-agenda-item button { margin:3px }
html #app [data-ticket] .send #desk-seguir { font-size:12px; white-space:normal }
@media (max-width:580px) {
  html #app [data-ticket] .send:has(#desk-seguir) { display:grid; grid-template-columns:minmax(0,1fr) auto; }
  html #app [data-ticket] .send #desk-seguir { grid-column:1/-1; min-height:36px; }
}
@media (max-width:640px) {
  #app header:has(#desk-pendentes) { flex-wrap:wrap }
  #app header:has(#desk-pendentes) .desk-detail-head { flex:1 0 calc(100% - 56px) }
}
@media (max-width:580px) {
  html #app [data-ticket] > header { padding:10px 12px; gap:8px }
  html #app [data-ticket] > header #voltar { align-self:flex-start }
  html #app .desk-top-meta { gap:4px }
  html #app [data-ticket] .desk-detail-bar { padding:10px 12px }
}
.desk-workarea { min-height:0; min-width:0; }
.desk-chat { display:flex; flex-direction:column; min-width:0; min-height:0; }
.desk-info { min-width:0; background:var(--paper); border:1px solid var(--bd); padding:12px; }
.desk-info[hidden],.desk-public-compose[hidden],.desk-compose-toolbar [hidden] { display:none !important; }
.desk-info > h2 { font-size:14px; margin:0 0 9px; letter-spacing:-.015em; }
html #app [data-ticket] .desk-info :is(.box,.desk-detail-bar) { padding:8px 0; }
html #app [data-ticket] .desk-info .desk-remote { margin:8px 0; }
html #app [data-ticket] .desk-info .plus-tools { margin:0; }
html #app [data-ticket] .desk-info .plus-actions { align-items:center; }
html #app [data-ticket] .desk-info #plus-tempo { flex-wrap:wrap; }
html #app [data-ticket] .desk-info .desk-detail-bar .ticket-status + #os-btn { margin-left:0; }
html #app [data-ticket] .desk-info-toggle { width:auto; padding:6px 10px; height:auto; font-size:12px; min-height:39px; margin-left:auto; }
html #app [data-ticket] .desk-chat .send { position:sticky; bottom:0; z-index:2; display:grid; grid-template-columns:minmax(0,1fr); gap:7px; padding:10px 14px; margin-top:auto; }
.desk-compose-toolbar,.desk-compose-modes { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.desk-compose-toolbar { justify-content:flex-start; }
html #app [data-ticket] .desk-compose-toolbar button { min-width:0; min-height:33px; padding:5px 8px; font-size:12px; }
html #app .desk-compose-modes button[aria-pressed="true"] { border-color:var(--ac); background:var(--selected); color:var(--ac); }
html #app [data-ticket] .desk-chat .desk-note-mode { background:var(--s-wait-bg); }
html #app .desk-note-mode .desk-compose-modes button[aria-pressed="true"] { border-color:var(--s-wait); color:var(--s-wait); background:var(--card); }
.desk-public-compose,.desk-note-mode > form { display:flex; align-items:end; gap:7px; min-width:0; }
html #app .desk-note-mode > form > textarea,html #app .desk-public-compose > textarea { flex:1; min-width:0; }
.desk-rapidas { position:relative; font-size:12px; }
.desk-rapidas summary { cursor:pointer; color:var(--tx); border:1px solid var(--bd); border-radius:8px; padding:6px 8px; }
html #app .desk-rapidas .qr { position:absolute; z-index:4; bottom:calc(100% + 6px); right:0; display:grid; overflow:auto; max-height:220px; background:var(--card); border:1px solid var(--bd); border-radius:8px; padding:6px; }
html #app .desk-compacta .desk-queue-card { min-height:0!important; gap:4px; padding:7px 9px; }
.desk-compacta .desk-queue-title { font-size:13px }
.desk-queue-company { margin-left:auto; }
#app .desk-densidade { align-self:flex-start; min-height:37px; }
@media(min-width:1000px){
  html #app [data-ticket] { overflow:hidden; }
  html body.plus-ticket-open #app [data-ticket] > .desk-workarea { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); flex:1 1 auto; }
  html body.plus-ticket-open #app [data-ticket] > .desk-workarea.com-detalhes { grid-template-columns:minmax(0,1fr) clamp(245px,23vw,315px); }
  .desk-chat,.desk-info { overflow:auto; }
  html #app [data-ticket] .desk-info { border-width:0 0 0 1px; }
}
@media(max-width:999px){
  .desk-workarea { display:flex; flex-direction:column-reverse; }
  html #app [data-ticket] .desk-chat .send { bottom:0; }
}
@media(max-width:580px){
  .desk-public-compose { flex-wrap:wrap; }
  html #app [data-ticket] .desk-public-compose #desk-seguir { min-height:34px; }
  html #app [data-ticket] .desk-chat .msgs { padding-inline:12px; }
  html #app [data-ticket] .desk-chat .send:has(#desk-seguir) { grid-template-columns:minmax(0,1fr); }
}
.desk-operacoes:empty { display:none; }
html #app .desk-chat .desk-msg-antigas { align-self:center; margin:9px 0 0; padding:6px 9px; min-height:34px; font-size:12px; }
.desk-msg-antigas[hidden] { display:none!important; }
.desk-atencao { background:var(--card); }
.desk-atencao-top { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.desk-atencao-top h2,.desk-empresa-painel h2 { font-size:16px; margin:0; }
html #app .desk-atencao-item { display:flex; width:100%; justify-content:space-between; align-items:center; gap:8px; text-align:left; padding:9px; }
.desk-atencao-item small { color:var(--wn); }
.desk-empresa-abas { display:flex; gap:8px; overflow:auto; }
.desk-empresa-abas button { white-space:nowrap; }
html #app .desk-empresa-abas button[aria-selected="true"] { border-color:var(--ac); color:var(--ac); background:var(--selected); }
.desk-empresa-status { display:flex; gap:13px; flex-wrap:wrap; color:var(--mut); }
.desk-empresa-status b { color:var(--ac); }
.desk-empresa-painel { display:grid; gap:12px; }
.desk-empresa-painel[hidden] { display:none; }
#desk-empresa-fila { display:grid; gap:6px; }
.desk-portal-home { display:flex; gap:14px; justify-content:space-between; align-items:center; flex-wrap:wrap; margin:12px auto; padding:16px; background:var(--selected); border:1px solid var(--bd); border-radius:12px; }
.desk-portal-home h2 { margin:0; font-size:19px; }
.desk-portal-home p { margin:3px 0 0; color:var(--mut); }
html #app>.desk-portal-home { width:calc(100% - 28px); }
@media(max-width:580px){ .desk-portal-home .acoes { width:100%; } .desk-portal-home .acoes button { flex:1 1 auto; padding-inline:10px; } }
.nexo-ia [hidden] { display:none !important; }
.nexo-ia p,.nexo-ia small { margin:0; color:var(--mut); font-size:12px; }
#nia-msg { color:var(--ac); font-size:13px; }
.desk-info .nexo-triagem { margin:0 0 9px; }
.nexo-triagem-resumo { color:var(--mut); padding-bottom:8px; font-size:13px; }
.nexo-triagem-resumo dl { margin:4px 0; }
.nexo-triagem-resumo dt { font-weight:800; color:var(--tx); }
.nexo-triagem-resumo dd { margin:0 0 6px; white-space:pre-wrap; overflow-wrap:anywhere; }
html #app [data-ticket] .msgs .m.nexo-bot-msg {
  align-self:flex-start; background:var(--card2); border:1px solid var(--bd2);
  border-left:3px solid var(--ac); border-radius:12px 12px 12px 4px;
  padding:10px 13px; color:var(--tx); max-width:min(92%,560px);
}
html #app .m.nexo-bot-msg small { color:var(--ac); font-weight:800; }
