/* disparo.css — tela Disparo */

/* ═══════════════════════════════════════════════════════════════
   LEGADO — mantido enquanto o Painel B migra o HTML
   ═══════════════════════════════════════════════════════════════ */

/* ── Header ─────────────────────────────────────────────────── */
.disparo__header {
  margin-bottom: 24px;
}

.disparo__header h1 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 4px;
}

.disparo__sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Faixa de contas (wrapper legado convertido para flex strip) ─ */
/* O JS agora gera .conta-chip (desenhados para flex row), não .conta (cards). */
.contas-wrapper {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  max-width: 100%;
  min-width: 0;
  scrollbar-width: none;
}
.contas-wrapper::-webkit-scrollbar { display: none; }

#contas {
  display: contents;
}

.contas__placeholder {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.contas__placeholder--erro {
  color: #dc2626;
}

/* ── Card de conta (legado) ──────────────────────────────────── */
.conta {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
  position: relative;
}

.conta:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.conta--inativa { opacity: 0.55; }

.conta__avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--accent-soft), rgba(19,192,138,0.16));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-strong);
  text-transform: uppercase;
}
.conta__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.conta__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.conta__nome {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conta__numero {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conta__tipo {
  width: max-content;
  margin-top: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
}
.conta__tipo--api { color: #0f7a4d; background: rgba(15,122,77,0.12); }
.conta__tipo--web { color: #b7791f; background: rgba(183,121,31,0.12); }

.conta__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.conta__status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.conta__status--conectado  { color: #0f7a4d; background: rgba(15,122,77,0.12); }
.conta__status--conectado::before { background: #0f7a4d; }
.conta__status--desconectado { color: #e11d2e; background: rgba(225,29,46,0.1); }
.conta__status--desconectado::before { background: #e11d2e; }
.conta__status--conectando { color: #b7791f; background: rgba(183,121,31,0.12); }
.conta__status--conectando::before { background: #b7791f; animation: pulsar-chip 1.4s ease-in-out infinite; }

.conta--add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  padding: 10px 16px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-family: inherit;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  min-height: 64px;
  min-width: 120px;
  flex-shrink: 0;
  white-space: nowrap;
}
.conta--add:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}
.conta--add:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.conta--add__icone {
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
}

/* ── Ações da conta (menu ⋮) ─────────────────────────────────── */
/* `fixed`, não `absolute`: a faixa `.contas-wrapper` é `overflow-x: auto` (l. 29)
   e recortaria um dropdown absoluto. `top`/`left` são escritos inline pelo JS a
   partir do rect do botão — não os declare aqui (ADR-P002). */
.conta__menu {
  position: fixed; z-index: 20; min-width: 150px;
  background: var(--panel-bg); border: 1px solid var(--border);
  border-radius: var(--r-sm); box-shadow: var(--shadow-md); padding: 4px; margin-top: 4px;
  display: flex; flex-direction: column;
}
.conta__menu[hidden] { display: none; }
.conta__menu-item {
  text-align: left; border: none; background: transparent; color: var(--text);
  font: inherit; font-size: 13.5px; padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.conta__menu-item:hover { background: var(--panel-bg-hover); }
.conta__menu-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.conta__menu-item--perigo { color: #e11d2e; }

/* ═══════════════════════════════════════════════════════════════
   MODAL (legado + novo)
   ═══════════════════════════════════════════════════════════════ */
.modal {
  margin: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  width: 430px;
  max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-lg);
  background: var(--panel-bg);
  animation: modalIn 0.2s ease both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  @keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
}
.modal::backdrop {
  background: rgba(10, 16, 14, 0.45);
  backdrop-filter: blur(2px);
}

.modal--conta { width: 460px; }
.modal__cabecalho { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 4px; }
.modal__cabecalho-icone {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
}
.modal__cabecalho-icone svg { width: 22px; height: 22px; }
.modal__cabecalho-icone--api { background: var(--accent-soft); color: var(--accent-strong); }
.modal__sub { margin: 3px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.45; }
.modal__titulo { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.modal__intro { margin: -8px 0 2px; color: var(--text-muted); font-size: .875rem; }
.modal__ajuda { margin: -4px 0 0; color: var(--text-muted); font-size: 0.78rem; line-height: 1.45; }
.modal__nota {
  display: flex; align-items: flex-start; gap: 9px;
  margin: 2px 0 0; padding: 10px 12px;
  background: var(--panel-bg-hover); border-radius: var(--r-sm);
  color: var(--text-muted); font-size: 12px; line-height: 1.45;
}
.modal__nota svg { flex-shrink: 0; width: 16px; height: 16px; color: var(--accent-strong); margin-top: 1px; }
.modal__form { display: flex; flex-direction: column; gap: 16px; }
.modal__acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ── Campos ──────────────────────────────────────────────────── */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo__label { font-size: 0.8125rem; font-weight: 500; color: var(--text); }
.campo__input {
  font-family: inherit; font-size: 0.9375rem; color: var(--text);
  background: var(--panel-bg); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 9px 12px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.campo__input::placeholder { color: var(--text-muted); }
.campo__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.campo__hint { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.campo__senha { position: relative; display: flex; align-items: center; }
.campo__senha .campo__input { flex: 1; padding-right: 40px; }
.campo__olho {
  position: absolute; right: 6px; border: none; background: transparent;
  color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: 6px; display: inline-flex;
}
.campo__olho:hover { color: var(--text); background: var(--panel-bg-hover); }
.campo__olho:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 3px var(--accent-ring); }
.campo__olho svg { width: 17px; height: 17px; }
.campo__olho.is-on { color: var(--accent-strong); }

/* ── Tipo de conexão ─────────────────────────────────────────── */
.tipo-conexao {
  position: relative; display: grid; grid-template-columns: 44px 1fr auto; gap: 12px;
  align-items: center; width: 100%; padding: 15px; text-align: left; font: inherit;
  color: var(--text); background: var(--panel-bg); border: 1px solid var(--border);
  border-radius: var(--r-md); cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease, background 0.15s ease;
}
.tipo-conexao:hover { border-color: var(--accent); background: var(--panel-bg-hover); transform: translateY(-1px); }
.tipo-conexao:hover .tipo-conexao__icone { transform: scale(1.05); }
.tipo-conexao:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 4px var(--accent-ring); }
.tipo-conexao__icone {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  transition: transform 0.15s ease;
}
.tipo-conexao__icone svg { width: 21px; height: 21px; }
.tipo-conexao--segura .tipo-conexao__icone { color: var(--accent-strong); background: var(--accent-soft); }
.tipo-conexao--risco .tipo-conexao__icone { color: #b7791f; background: rgba(183,121,31,0.12); }
.tipo-conexao__texto strong { display: block; font-size: 14.5px; }
.tipo-conexao__texto small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.tipo-conexao__selo {
  align-self: flex-start; font-size: .64rem; font-weight: 700; white-space: nowrap;
  padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em;
}
.tipo-conexao__selo--ok { color: var(--accent-strong); background: var(--accent-soft); }
.tipo-conexao__selo--risco { color: #b7791f; background: rgba(183,121,31,0.12); }
.tipo-conexao__selo--erro { color: #e11d2e; background: rgba(225,29,46,0.12); }
.tipo-manual { background: none; border: none; padding: 2px; font: inherit; font-size: .8rem; color: var(--text-muted); text-decoration: underline; cursor: pointer; align-self: center; }
.tipo-manual:hover { color: var(--accent-strong); }

/* QR */
.alerta-risco { padding: 11px 12px; color: #b7791f; background: rgba(183,121,31,0.1); border: 1px solid rgba(183,121,31,0.3); border-radius: var(--r-sm); font-size: .8rem; line-height: 1.45; }
.qr-area { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qr-frame { position: relative; width: 260px; height: 260px; display: grid; place-items: center; background: #ffffff; border-radius: 16px; padding: 14px; box-shadow: 0 10px 30px -10px rgba(0,0,0,0.6), 0 0 0 1px var(--border); }
.qr-imagem { width: 100%; height: 100%; border-radius: 6px; display: block; }
.qr-carregando { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; }
.qr-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(225,29,46,0.2); border-top-color: var(--accent); animation: qrspin 0.8s linear infinite; }
@keyframes qrspin { to { transform: rotate(360deg); } }
.qr-status { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; }
.qr-pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: qrpulse 1.6s ease-out infinite; }
@keyframes qrpulse {
  0%   { box-shadow: 0 0 0 0 rgba(225,29,46,0.4); }
  70%  { box-shadow: 0 0 0 9px rgba(225,29,46,0); }
  100% { box-shadow: 0 0 0 0 rgba(225,29,46,0); }
}
.qr-ok { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--accent-strong); font-weight: 700; }
.qr-ok[hidden] { display: none; }
.qr-ok svg { width: 46px; height: 46px; color: var(--accent); }
.qr-passos { margin: 0; padding-left: 22px; color: var(--text-muted); font-size: .8rem; line-height: 1.6; }

/* Estados QR são mutuamente exclusivos: display:flex não pode vencer [hidden]. */
.qr-carregando[hidden], .qr-status[hidden], .qr-imagem[hidden] { display: none !important; }


/* ═══════════════════════════════════════════════════════════════
   NOVO — contrato Disparo empresarial
   ═══════════════════════════════════════════════════════════════ */

/* ── Faixa de contas compacta ────────────────────────────────── */
.disparo__contas {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
  max-width: 100%;
  min-width: 0;
}
.disparo__contas::-webkit-scrollbar { display: none; }

/* Cartão de conta: retângulo 2 linhas — nome/ponto + número/tipo. */
.conta-chip {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 3px;
  align-items: center;
  padding: 10px 14px;
  min-height: 64px;
  min-width: 180px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel-bg);
  color: var(--text);
  cursor: default;
  transition: box-shadow 0.14s ease;
}
.conta-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.conta-chip__avatar {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.875rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  text-transform: uppercase;
}

.conta-chip__nome {
  grid-column: 2;
  grid-row: 1;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conta-chip__numero {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conta-chip__tipo {
  grid-column: 3;
  grid-row: 2;
  align-self: start;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.conta-chip__tipo--api { color: #0f7a4d; background: rgba(15,122,77,0.12); }
.conta-chip__tipo--web { color: #b7791f; background: rgba(183,121,31,0.12); }

/* Ponto de saúde: cor informa estado, borda permanece neutra. */
.conta-chip__saude {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  justify-self: end;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.conta-chip.is-conectado  .conta-chip__saude { background: #0f7a4d; }
.conta-chip.is-conectando .conta-chip__saude { background: #b7791f; animation: pulsar-chip 1.4s ease-in-out infinite; }
.conta-chip.is-erro       .conta-chip__saude { background: #e11d2e; }

@keyframes pulsar-chip {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* Botão kebab do chip de conta — ocupa grid-col3/row1 via auto-placement. */
.conta-chip__menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  justify-self: end;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: background 0.12s ease, opacity 0.14s ease;
}
.conta-chip:hover .conta-chip__menu-btn,
.conta-chip:focus-within .conta-chip__menu-btn { opacity: 1; }
.conta-chip__menu-btn:hover { background: var(--panel-bg-hover); color: var(--text); }
.conta-chip__menu-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  opacity: 1;
}

/* ── Faixa de KPI ────────────────────────────────────────────── */
.disparo__resumo {
  display: flex;
  gap: 0;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 16px;
  max-width: 100%;
  min-width: 0;
}

.resumo__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 10px 14px;
  border-right: 1px solid var(--border);
}
.resumo__item:last-child { border-right: none; }

.resumo__valor {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--text);
}

.resumo__rotulo {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.disparo__toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  min-width: 0;
}

/* ── Busca da toolbar ─────────────────────────────────────────── */
/* Wrapper (quando JS futuramente embrulhar o input num div) */
.toolbar__busca {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 300px;
}
.toolbar__busca input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--text);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.toolbar__busca input::placeholder { color: var(--text-muted); }
.toolbar__busca input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.toolbar__busca:not(input)::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M9 3.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11ZM2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Z' clip-rule='evenodd'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Quando o JS coloca a classe diretamente no <input> (estado atual) */
input.toolbar__busca {
  padding: 7px 10px;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--text);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
  box-sizing: border-box;
}
input.toolbar__busca::placeholder { color: var(--text-muted); }
input.toolbar__busca:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.toolbar__filtros {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.toolbar__periodo {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  margin-left: 4px;
}
.toolbar__periodo > span:first-child {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.toolbar__exportar {
  flex-shrink: 0;
  margin-left: auto;
}

.filtro-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}
.filtro-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--panel-bg-hover);
}
.filtro-chip.is-ativo {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}
.filtro-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.toolbar__ordem {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.toolbar__ordem select {
  font: inherit;
  font-size: 0.78rem;
  color: var(--text);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 8px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.14s ease;
}
.toolbar__ordem select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.toolbar__acoes {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Paginação ───────────────────────────────────────────────── */
.disparo__paginacao {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 0 4px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  min-width: 0;
  flex-wrap: wrap;
}

/* "Mostrando X–Y de Z" — texto informativo à esquerda da paginação. */
.paginacao-mostrando {
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.disparo__paginacao-controles {
  display: flex;
  align-items: center;
  gap: 4px;
}

.paginacao-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.paginacao-btn:hover:not(:disabled) {
  background: var(--panel-bg-hover);
  border-color: var(--border-strong);
}
.paginacao-btn.is-ativo {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.paginacao-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.paginacao-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.paginacao-itens-por-pagina {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.paginacao-itens-por-pagina select {
  font: inherit;
  font-size: 0.78rem;
  color: var(--text);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 4px 6px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.14s ease;
}
.paginacao-itens-por-pagina select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ── Drawer de detalhe ───────────────────────────────────────── */
/* clip-path em vez de translateX(100%): o elemento fica em right:0
   mas clipado a zero — não empurra o scrollWidth do documento. */
.campanha-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--panel-bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  clip-path: inset(0 0 0 100%);
  transition: clip-path 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.campanha-drawer.is-aberto {
  clip-path: inset(0);
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .campanha-drawer { transition: none; }
}

/* Seções internas do drawer (criadas pelo JS sem .campanha-drawer__corpo) */
.campanha-drawer__secao {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.campanha-drawer__secao:last-child {
  border-bottom: none;
  flex: 1;
  overflow-y: auto;
}
/* Primeira seção do drawer: identifica a conta da campanha. Usada sempre em
   conjunto com .campanha-drawer__secao, só reforça a hierarquia visual. */
.campanha-drawer__conta {
  background: var(--panel-bg-hover);
}
.campanha-drawer__conta p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text);
}
.campanha-drawer__secao h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.campanha-drawer__cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.campanha-drawer__titulo {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.campanha-drawer__fechar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease;
}
.campanha-drawer__fechar:hover { background: var(--panel-bg-hover); color: var(--text); }
.campanha-drawer__fechar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.campanha-drawer__corpo {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.campanha-drawer__metricas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.drawer-metrica {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--r-sm);
}
.drawer-metrica__valor {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.drawer-metrica__rotulo {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.campanha-drawer__erros h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.drawer-erro {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(225,29,46,0.05);
  border: 1px solid rgba(225,29,46,0.15);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
}
.drawer-erro__codigo {
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #e11d2e;
  flex-shrink: 0;
  padding: 2px 6px;
  background: rgba(225,29,46,0.1);
  border-radius: var(--r-sm);
  margin-top: 1px;
}
.drawer-erro__info { flex: 1; min-width: 0; }
.drawer-erro__rotulo { font-size: 0.8125rem; font-weight: 600; color: var(--text); }
.drawer-erro__total { font-size: 0.75rem; color: #e11d2e; font-weight: 600; }
.drawer-erro__acao { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ── Estados (carregando / vazio / erro) ─────────────────────── */
.disparo__estado {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
}
.disparo__estado.is-carregando,
.disparo__estado.is-vazio,
.disparo__estado.is-erro {
  display: flex;
}

.disparo__estado-icone {
  font-size: 2rem;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0.5;
}
.disparo__estado.is-erro .disparo__estado-icone { color: #e11d2e; opacity: 0.7; }

.disparo__estado-texto {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}
.disparo__estado-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  max-width: 320px;
}

/* ── Skeleton ────────────────────────────────────────────────── */
.skeleton {
  background: var(--border);
  border-radius: var(--r-sm);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.18) 50%,
    transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.skeleton-row:last-child { border-bottom: none; }
.skeleton--nome  { width: 40%; height: 14px; }
.skeleton--num   { width: 10%; height: 14px; }
.skeleton--bar   { width: 15%; height: 8px; border-radius: var(--r-pill); }
.skeleton--chip  { width: 60px; height: 20px; border-radius: var(--r-pill); }

/* ── Overlay de fundo ao abrir drawer em mobile ──────────────── */
.disparo__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 199;
}
.disparo__overlay.is-visivel { display: block; }
