/* =====================================================================================
   CENTRAL DE ATENDIMENTO (Marketplaces → Atendimento) — 08/11/2026
   Padrão visual da loja: fundo cinza, cartões brancos, faixa escura com aba verde, campos com
   contorno forte, sugestão da IA em azul tracejado, prazos em placa amarela com número vermelho.
   ===================================================================================== */
.atd { display: flex; flex-direction: column; gap: 12px; }
.atd-topo { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.atd-kpis { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; }
.atd-kpis .fin-kpi { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.atd-kpis .fin-kpi:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -10px rgba(0,0,0,.35); }
.atd-kpis .fin-kpi.alerta { border-left-color: #C0392B; } .atd-kpis .fin-kpi.alerta > b { color: #C0392B; }
.atd-kpis .fin-kpi.ouro { border-left-color: #D9A21B; } .atd-kpis .fin-kpi.ouro > b { color: #9A6B00; }
.atd-kpis .fin-kpi.ativo { outline: 2px solid var(--ink); outline-offset: -1px; }
@media (max-width: 900px) { .atd-kpis { grid-template-columns: repeat(2, 1fr); } }

.atd-alerta { background: #FFF1EF; border: 1.5px solid #C0392B; color: #8E2A20; border-radius: 10px; padding: 10px 14px; font-weight: 700; font-size: 13.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.atd-alerta button { margin-left: auto; }

.atd-filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.atd-filtros select { height: 36px; }
.atd-filtros .mlc-busca { flex: 1; min-width: 200px; }
.atd-filtros .mlc-seg button .n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: #E6E8EB; color: var(--text); font-size: 11px; font-family: 'IBM Plex Mono', monospace; }
.atd-filtros .mlc-seg button.active .n { background: rgba(255,255,255,.2); color: #fff; }

/* caixa de entrada: lista · conversa · pedido/anúncio */
.atd-caixa { display: grid; grid-template-columns: 330px minmax(0, 1fr) 290px; gap: 10px; align-items: start; }
.atd-col { background: #fff; border: 1.5px solid #D2D4CE; border-radius: 10px; min-width: 0; display: flex; flex-direction: column; }
.atd-col-h { padding: 10px 12px; border-bottom: 1.5px solid #E3E5E8; font-weight: 700; font-size: 13.5px; display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.atd-lista { max-height: calc(100vh - 300px); min-height: 360px; overflow-y: auto; }
.atd-item { padding: 10px 12px; border-bottom: 1px solid #ECEDEF; display: flex; flex-direction: column; gap: 4px; cursor: pointer; font-size: 13px; position: relative; }
.atd-item:hover { background: #F7F8F6; }
.atd-item.sel { background: #EEF0EC; box-shadow: inset 4px 0 0 var(--accent); }
.atd-item.urg { background: #FFF5F3; box-shadow: inset 4px 0 0 #C0392B; }
.atd-item.urg.sel { background: #FBE7E3; }
.atd-item .t { font-weight: 700; font-size: 13.5px; line-height: 1.3; display: flex; gap: 6px; justify-content: space-between; }
.atd-item .t span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atd-item .t small { font-weight: 500; color: var(--text-dim); white-space: nowrap; font-size: 11.5px; }
.atd-item .s { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atd-item .m { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.atd-vazio { padding: 40px 16px; text-align: center; color: var(--text-dim); font-size: 13px; }
.atd-vazio b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.atd-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; border: 1px solid transparent; }
.atd-pill.ml { background: #FFE600; color: #2D3277; }
.atd-pill.shopee { background: #EE4D2D; color: #fff; }
.atd-pill.perg { background: #E8EEF9; color: #23498F; }
.atd-pill.msg { background: #EAF4EE; color: #1E7A45; }
.atd-pill.recl { background: #FBE3DF; color: #A6392E; }
.atd-pill.vermelho { background: #C0392B; color: #fff; }
.atd-pill.azul { background: #DCE7FB; color: #1D4ED8; }
.atd-pill.verde { background: #DDF3E5; color: #1E7A45; }
.atd-pill.ouro { background: #FFF2C6; color: #8A5E00; border-color: #E8C65A; }
.atd-pill.cinza { background: #EEF0F2; color: #5B6168; }

/* conversa */
.atd-conv-h { padding: 12px 14px; border-bottom: 1.5px solid #E3E5E8; display: flex; flex-direction: column; gap: 6px; }
.atd-conv-h h3 { margin: 0; font-size: 16px; line-height: 1.3; }
.atd-conv-h .linha { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--text-dim); }
.atd-conv-h .acoes { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.atd-msgs { padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #F7F8F6; max-height: calc(100vh - 560px); min-height: 160px; overflow-y: auto; }
.atd-msg { max-width: 82%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 0 rgba(0,0,0,.05); }
.atd-msg small { display: block; font-size: 11px; color: var(--text-dim); margin-top: 4px; white-space: normal; }
.atd-msg.cliente { background: #fff; border: 1px solid #E1E3E6; align-self: flex-start; border-top-left-radius: 3px; }
.atd-msg.loja { background: #DDF3E5; border: 1px solid #BFE3CB; align-self: flex-end; border-top-right-radius: 3px; }
.atd-msg.ml, .atd-msg.mediador { background: #FFF8DC; border: 1px solid #F0DFA8; align-self: center; max-width: 92%; font-size: 13px; }
.atd-msg .anexo { display: inline-block; margin-top: 4px; font-size: 12px; color: #23498F; }

.atd-prazo { margin: 12px 14px 0; background: #FFF7DD; border: 1.5px solid #D9A21B; border-radius: 10px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13.5px; }
.atd-prazo .big { font-family: 'IBM Plex Mono', monospace; font-size: 22px; color: #C0392B; }
.atd-prazo.ok .big { color: #9A6B00; }
.atd-acoes-ml { margin: 8px 14px 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.atd-bloq { margin: 12px 14px 0; background: #FFF1EF; border: 1.5px solid #E2A198; color: #8E2A20; border-radius: 8px; padding: 8px 12px; font-size: 13px; font-weight: 600; }

.atd-ia { margin: 12px 14px 0; border: 2px dashed #1D4ED8; background: #EEF3FD; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.atd-ia-h { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; font-weight: 700; color: #1D4ED8; }
.atd-ia-h .pills { display: flex; gap: 5px; flex-wrap: wrap; }
.atd-ia-txt { background: #fff; border: 1.5px solid #AFC3EE; border-radius: 8px; padding: 9px 11px; white-space: pre-wrap; line-height: 1.45; font-size: 14px; }
.atd-ia-resumo { font-size: 13px; line-height: 1.45; }
.atd-ia-aviso { background: #FFF1EF; border-left: 4px solid #C0392B; padding: 6px 10px; border-radius: 4px; font-size: 12.5px; color: #8E2A20; font-weight: 600; }
.atd-ia-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.atd-ia-btns .dica { font-size: 11.5px; color: var(--text-dim); margin-left: auto; }
.atd-ia.carregando { border-style: dotted; color: #1D4ED8; font-weight: 600; }
.atd-ia.erro { border-color: #C0392B; background: #FFF5F3; color: #8E2A20; }

.atd-resp { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.atd-resp label { font-weight: 700; font-size: 12.5px; color: var(--label, #3F454D); display: flex; justify-content: space-between; gap: 8px; }
.atd-resp textarea { width: 100%; min-height: 96px; resize: vertical; box-sizing: border-box; font: inherit; font-size: 14.5px; padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--campo-borda, #A9B0B9); background: #fff; }
.atd-resp textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,174,89,.22); }
.atd-resp .conta { font-family: 'IBM Plex Mono', monospace; font-weight: 500; color: var(--text-dim); }
.atd-resp .conta.estouro { color: #C0392B; font-weight: 700; }
.atd-resp .erro { color: #C0392B; font-weight: 700; font-size: 13px; }
.atd-resp .erro:empty { display: none; }
.atd-resp .btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.atd-resp .btns .esp { margin-left: auto; }
.atd-resp .btn-solid { min-width: 150px; }
.atd-prontas { position: relative; }
.atd-prontas-menu { position: absolute; bottom: 100%; left: 0; z-index: 30; background: #fff; border: 1.5px solid #C5CAD1; border-radius: 10px; box-shadow: 0 12px 30px -12px rgba(0,0,0,.35); width: 340px; max-height: 300px; overflow-y: auto; padding: 4px; margin-bottom: 4px; }
.atd-prontas-menu button { display: block; width: 100%; text-align: left; background: none; border: none; padding: 8px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.atd-prontas-menu button:hover, .atd-prontas-menu button:focus { background: #F1F3F5; outline: none; }
.atd-prontas-menu button b { display: block; font-size: 13px; }
.atd-prontas-menu button span { display: block; color: var(--text-dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* lateral: anúncio / pedido */
.atd-lado { padding: 12px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.atd-prod { display: flex; gap: 10px; align-items: center; }
.atd-foto { width: 58px; height: 58px; border-radius: 8px; overflow: hidden; background: #ECEEF1; flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-dim); }
.atd-foto img { width: 100%; height: 100%; object-fit: cover; }
.atd-prod b { display: block; line-height: 1.3; }
.atd-row { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted #D2D4CE; padding-bottom: 5px; }
.atd-row span:first-child { color: var(--text-dim); }
.atd-row b { text-align: right; }
.atd-lado .btn { width: 100%; justify-content: center; }
.atd-lado h4 { margin: 4px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); }
.atd-itens { display: flex; flex-direction: column; gap: 4px; }
.atd-itens div { background: #F7F8F6; border-radius: 6px; padding: 5px 8px; }

.atd-atalhos { font-size: 11.5px; color: var(--text-dim); display: flex; gap: 12px; flex-wrap: wrap; }
.atd-atalhos kbd { font-family: 'IBM Plex Mono', monospace; background: #fff; border: 1px solid #C5CAD1; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 11px; color: var(--text); }

@media (max-width: 1360px) {
  .atd-caixa { grid-template-columns: 300px minmax(0, 1fr); }
  .atd-caixa > .atd-col.lado { grid-column: 2; }
}
@media (max-width: 820px) {
  .atd-caixa { grid-template-columns: 1fr; }
  .atd-caixa > .atd-col.lado { grid-column: auto; }
  .atd-lista { max-height: 300px; min-height: 0; }
  .atd-msgs { max-height: none; }
}

/* painel */
.atd-painel { display: flex; flex-direction: column; gap: 12px; }
.atd-painel .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.atd-card { background: #fff; border: 1.5px solid #D2D4CE; border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.atd-card h3 { margin: 0; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.atd-card h3::before { content: ""; width: 5px; height: 16px; background: var(--accent); border-radius: 2px; }
.atd-barras { display: flex; align-items: flex-end; gap: 4px; height: 140px; border-bottom: 1.5px solid #D2D4CE; }
.atd-barras .dia { flex: 1; display: flex; flex-direction: column-reverse; gap: 1px; min-width: 6px; height: 100%; }
.atd-barras .ia { background: #2FAE59; border-radius: 2px 2px 0 0; }
.atd-barras .pe { background: #1D4ED8; border-radius: 2px 2px 0 0; }
.atd-barras-l { display: flex; gap: 4px; font-size: 10.5px; color: var(--text-dim); font-family: 'IBM Plex Mono', monospace; }
.atd-barras-l span { flex: 1; text-align: center; min-width: 6px; overflow: hidden; }
.atd-legenda { display: flex; gap: 12px; font-size: 12px; color: var(--text-dim); }
.atd-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.atd-rank { display: flex; flex-direction: column; gap: 6px; }
.atd-rank div { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; align-items: center; font-size: 13px; }
.atd-rank .barra { grid-column: 1 / -1; height: 6px; background: #ECEEF1; border-radius: 3px; overflow: hidden; }
.atd-rank .barra i { display: block; height: 100%; background: var(--ink); }
.atd-rank b { text-align: right; font-family: 'IBM Plex Mono', monospace; }
.atd-rank span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* respostas e IA */
.atd-cfg { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 12px; align-items: start; }
.atd-cfg .atd-card.larga { grid-column: 1 / -1; }
.atd-opt { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dotted #D2D4CE; }
.atd-opt > div:first-child b { display: block; font-size: 13.5px; }
.atd-opt > div:first-child small { color: var(--text-dim); font-size: 12px; }
.atd-chks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px; }
.atd-chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 6px 8px; border-radius: 6px; border: 1px solid #E3E5E8; background: #FAFAF9; }
.atd-chk.nunca { opacity: .7; background: #FFF5F3; border-color: #F2C4BD; }
.atd-chk input { margin-top: 2px; }
.atd-chk small { display: block; color: var(--text-dim); font-size: 11.5px; }
.atd-cfg textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 13.5px; padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--campo-borda, #A9B0B9); min-height: 220px; resize: vertical; line-height: 1.5; }
.atd-cfg input[type=text], .atd-cfg input[type=time], .atd-cfg input[type=number], .atd-cfg select { height: 36px; padding: 0 10px; border-radius: 6px; border: 1.5px solid var(--campo-borda, #A9B0B9); background: #fff; font: inherit; font-size: 13.5px; }
.atd-dias { display: flex; gap: 4px; flex-wrap: wrap; }
.atd-dias label { display: inline-flex; gap: 4px; align-items: center; padding: 4px 8px; border: 1.5px solid #C5CAD1; border-radius: 6px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.atd-dias label:has(input:checked) { background: var(--ink); color: #fff; border-color: var(--ink); }
.atd-dias input { display: none; }
.atd-salvar { position: sticky; bottom: 0; z-index: 5; background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.atd-salvar span { font-size: 13px; color: #C9CDD3; }
.atd-teste-res { display: flex; flex-direction: column; gap: 8px; }
.atd-teste-res:empty { display: none; }
.atd-pr-lista { display: flex; flex-direction: column; gap: 6px; }
.atd-pr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid #E3E5E8; border-radius: 8px; background: #FAFAF9; font-size: 13px; }
.atd-pr b { display: block; }
.atd-pr span { color: var(--text-dim); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atd-ia-info { font-size: 12.5px; color: var(--text-dim); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mlc-tab .atd-badge { background: #C0392B; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; font-family: 'IBM Plex Mono', monospace; }
#nav [data-page="marketplaces"] .atd-nav-badge { margin-left: auto; background: #C0392B; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 18px; }
/* ajustes finais */
.atd h3, .atd h4 { font-family: inherit; }
.atd-card .atd-row { font-size: 13.5px; }
.atd-painel .grid2 { grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); }
@media (max-width: 960px) { .atd-painel .grid2 { grid-template-columns: 1fr; } }
.atd-teste-res .atd-ia { margin: 0; }
@media (max-width: 1360px) {
  .atd-caixa > .atd-col.lado .atd-lado { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); column-gap: 18px; align-items: start; }
  .atd-caixa > .atd-col.lado .atd-lado > h4, .atd-caixa > .atd-col.lado .atd-lado > .atd-itens, .atd-caixa > .atd-col.lado .atd-lado > .hint { grid-column: 1 / -1; }
}
.atd-col[hidden] { display: none; }
