/* =====================================================
   ADMIN – Light theme, azul como acento único (sem gradiente/glow)
   ===================================================== */

:root {
  --bg:           #ffffff;
  --surface:      #ffffff;
  --surface-2:    #f1f5f9;
  --border:       #e2e8f0;
  --border-hover: #2563eb;
  --accent:       #2563eb;
  --accent-end:   #1d4ed8;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --text-soft:    #94a3b8;
  --pink:         #db2777;
  --green:        #16a34a;
  --red:          #dc2626;
  --orange:       #ea580c;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Sem !important, qualquer classe com display (.form-group é flex) vence o
   [hidden] do navegador e o elemento continua visível. */
[hidden] { display: none !important; }

body {
  font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ── Navbar ──────────────────────────────────────── */

/* Menu lateral fixo no desktop — vira barra horizontal com gaveta no celular
   (ver media query abaixo), pra não perder espaço de tela onde já é apertado. */
.admin-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 230px;
  z-index: 100;
  background: rgba(255,255,255,.92);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(12px);
  overflow-y: auto;
}

.admin-nav__inner {
  height: 100%;
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.admin-nav__brand {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: 0 .4rem;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  flex-shrink: 0;
}

.admin-nav__brand .material-icons { font-size: 1.3rem; color: var(--accent); }

/* Seletor de Segmento — o "workspace" ativo, mostrado logo abaixo da marca. */
.segmento-switcher {
  position: relative;
  margin: .2rem .8rem .6rem;
}

.segmento-switcher__atual {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.segmento-switcher__atual::-webkit-details-marker { display: none; }

.segmento-switcher__atual .material-icons:first-child { font-size: 1.05rem; color: var(--accent); }

.segmento-switcher__atual span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.segmento-switcher__chevron { font-size: 1.1rem; color: var(--text-muted); transition: transform .15s; }

.segmento-switcher[open] .segmento-switcher__chevron { transform: rotate(180deg); }

.segmento-switcher__lista {
  position: absolute;
  top: calc(100% + .3rem);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: .3rem;
  display: flex;
  flex-direction: column;
  max-height: 260px;
  overflow-y: auto;
}

.segmento-switcher__item {
  padding: .5rem .6rem;
  border-radius: 8px;
  font-size: .82rem;
  color: var(--text);
}

.segmento-switcher__item:hover { background: var(--surface-2); }

.segmento-switcher__item--ativo { background: rgba(37,99,235,.1); color: var(--accent-end); font-weight: 600; }

.segmento-switcher__gerenciar {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .6rem;
  margin-top: .2rem;
  border-top: 1px solid var(--border);
  font-size: .78rem;
  color: var(--text-muted);
}

.segmento-switcher__gerenciar .material-icons { font-size: .95rem; }

.segmento-switcher--vazio {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .2rem .8rem .6rem;
  padding: .55rem .7rem;
  border-radius: 10px;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: .82rem;
}

/* Links + rodapé (usuário/sair) ficam juntos aqui pra, no celular, abrirem
   como uma gaveta só (ver media query) em vez de duas sobrepostas. */
.admin-nav__drawer {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.admin-nav__links {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.admin-nav__link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .7rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}

.admin-nav__link .material-icons { font-size: 1.1rem; }

.admin-nav__link:hover,
.admin-nav__link--active {
  background: rgba(37,99,235,.1);
  color: var(--accent-end);
}

/* Empurrado pro fim da coluna — fica sempre no rodapé da barra lateral,
   qualquer que seja o número de links acima. */
.admin-nav__rodape {
  margin-top: auto;
  padding-top: .8rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.admin-nav__user {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--text-muted);
  padding: .35rem .4rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background .15s, color .15s;
}

.admin-nav__user::before {
  font-family: 'Material Icons';
  content: 'account_circle';
  font-size: 1.1rem;
}

.admin-nav__user:hover {
  background: var(--surface-hover, rgba(37,99,235,.08));
  color: var(--accent);
}

.admin-nav__logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  background: none;
  border: 1px solid rgba(220,38,38,.3);
  border-radius: 8px;
  color: var(--red);
  font-size: .82rem;
  font-weight: 600;
  padding: .5rem .75rem;
  width: 100%;
  transition: background .15s, border-color .15s;
}

.admin-nav__logout .material-icons { font-size: 1rem; }

.admin-nav__logout:hover {
  background: rgba(220,38,38,.1);
  border-color: var(--red);
}

/* Hamburger (mobile) */
.admin-nav__checkbox { display: none; }

.admin-nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  padding: .3rem .5rem;
  cursor: pointer;
}

/* Abaixo de 640px não sobra largura pra barra lateral — volta a ser uma
   barra no topo com uma gaveta (drawer) que abre por baixo, exatamente como
   o menu superior funcionava antes de virar lateral. */
@media (max-width: 640px) {
  .admin-nav {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    width: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }

  .admin-nav__inner {
    height: 60px;
    padding: 0 1.2rem;
    flex-direction: row;
    align-items: center;
    gap: 0;
  }

  .admin-nav__brand { padding: 0; }

  .admin-nav__toggle { display: flex; margin-left: auto; }

  .admin-nav__drawer {
    display: none;
    position: absolute;
    top: 60px;
    left: 0; right: 0;
    background: rgba(255,255,255,.98);
    border-bottom: 1px solid var(--border);
    padding: .8rem 1rem;
    gap: .8rem;
    backdrop-filter: blur(12px);
  }

  .admin-nav__checkbox:checked ~ .admin-nav .admin-nav__drawer {
    display: flex;
  }

  .admin-nav__links { gap: .4rem; }

  .admin-nav__rodape { margin-top: 0; }
}

/* ── Page layout ─────────────────────────────────── */

.admin-page {
  max-width: 1200px;
  margin: 0;
  padding: 2rem 1.2rem 4rem;
  margin-left: 230px;
}

@media (max-width: 640px) {
  .admin-page { margin-left: 0; }
}

/* ── Equipe e perfis ─────────────────────────────── */

.secao-titulo {
  font-size: .95rem;
  font-weight: 600;
  margin: 1.8rem 0 .7rem;
}

.perfil-troca select {
  font: inherit;
  font-size: .8rem;
  padding: .3rem .5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.perfil-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  align-items: start;
}

.perfil-card { display: flex; flex-direction: column; gap: .5rem; }
.perfil-card__topo { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.perfil-card__uso { font-size: .75rem; color: var(--text-muted); }

.permissoes-lista {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.permissoes-lista li {
  font-size: .72rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: rgba(37,99,235,.08);
  color: var(--accent-end);
}

.perfil-card__editar summary { cursor: pointer; font-size: .82rem; color: var(--accent); }
.perfil-card__editar form { display: flex; flex-direction: column; gap: .7rem; margin-top: .7rem; }

.permissoes-opcoes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem .8rem;
  font-size: .8rem;
}

.permissoes-opcoes label { display: flex; align-items: center; gap: .35rem; cursor: pointer; }

/* ── Chaves de API ───────────────────────────────── */

.chave-criada {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #78350f;
  font-size: .85rem;
}

.chave-criada strong { display: flex; align-items: center; gap: .4rem; }
.chave-criada__valor { display: flex; gap: .5rem; flex-wrap: wrap; }
.chave-criada__valor input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .82rem;
  padding: .55rem .7rem;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  background: #fff;
}

.chaves-formularios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.chaves-form { display: flex; flex-direction: column; gap: .8rem; margin-top: 1rem; }
.chaves-form .btn { align-self: flex-start; }

.chaves-uso { font-size: .85rem; line-height: 1.6; }
.chaves-uso ul { margin: .4rem 0 .8rem; padding-left: 1.2rem; }
.chaves-uso pre {
  overflow-x: auto;
  padding: .7rem .9rem;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: .78rem;
}

/* ── Verificação em duas etapas ─────────────────── */

.passos-verificacao {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  font-size: .82rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.qr-verificacao { width: 190px; max-width: 100%; margin: 0 auto .8rem; }
.qr-verificacao svg { display: block; width: 100%; height: auto; border-radius: 8px; }

.segredo-verificacao {
  display: inline-block;
  margin-top: .3rem;
  font-size: .85rem;
  letter-spacing: .05em;
  word-break: break-all;
}

.campo-codigo {
  font-size: 1.3rem !important;
  letter-spacing: .3em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.codigos-recuperacao {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 .8rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .95rem;
  text-align: center;
}

.codigos-recuperacao li {
  padding: .45rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.auditoria-falha td:first-child { border-left: 3px solid var(--red); }

/* Limites por organização (tela do Administrador da plataforma). */
.limites-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .4rem; }
.limites-form label { display: flex; flex-direction: column; font-size: .68rem; color: var(--text-muted); }
.limites-form input {
  width: 4.2rem;
  font: inherit;
  font-size: .8rem;
  padding: .3rem .4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Administrador da plataforma: lembra em qual organização ele está mexendo. Fica no fluxo
   da página (não fixa) pra não cobrir o cabeçalho de nenhuma tela. */
.faixa-organizacao {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-left: 230px;
  padding: .55rem 1.2rem;
  background: #fef3c7;
  border-bottom: 1px solid #fcd34d;
  color: #78350f;
  font-size: .82rem;
}

.faixa-organizacao .material-icons { font-size: 1.05rem; }
.faixa-organizacao a { color: #92400e; font-weight: 600; margin-left: .3rem; }

@media (max-width: 640px) {
  .faixa-organizacao { margin-left: 0; }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .8rem;
}

.page-header h4 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Buttons ─────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  padding: .6rem 1.2rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-end);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37,99,235,.3);
}

.btn--danger {
  background: var(--red);
}

.btn--danger:hover { background: #b91c1c; box-shadow: 0 6px 16px rgba(220,38,38,.3); }

.btn--ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn--ghost:hover {
  border-color: var(--border-hover);
  color: var(--text);
  box-shadow: none;
  transform: none;
}

.btn .material-icons { font-size: 1.1rem; }

/* FAB */
.fab-add {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(37,99,235,.35);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  text-decoration: none;
}

.fab-add:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 24px rgba(37,99,235,.4);
}

/* ── Table ───────────────────────────────────────── */

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

thead th {
  background: var(--surface-2);
  color: var(--accent-end);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .9rem 1rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: rgba(37,99,235,.05); }

td {
  padding: .75rem 1rem;
  vertical-align: middle;
  color: var(--text);
}

.td-img img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

/* Mobile: card-style rows */
@media (max-width: 640px) {
  thead { display: none; }

  tbody tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: .8rem;
    padding: .6rem .8rem;
  }

  tbody tr:hover { background: var(--surface-2); }

  .table-wrapper {
    border: none;
    background: none;
  }

  td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .45rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .82rem;
  }

  td:last-child { border-bottom: none; }

  td::before {
    content: attr(data-label);
    font-size: .72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    flex-shrink: 0;
    margin-right: .5rem;
  }

  .td-img { display: none; }
}

/* ── Vitrine de Ofertas: grade de cards (igual ao site) ──── */

.oferta-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) { .oferta-admin-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .oferta-admin-grid { grid-template-columns: repeat(4, 1fr); } }

.oferta-admin-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  /* Sem overflow:hidden aqui de propósito — um menu de 3 pontinhos no rodapé do
     card (ver .card-kebab__menu) precisa poder "vazar" pra fora do card pra abrir.
     O corte visual dos cantos arredondados fica só na imagem (ver border-radius
     abaixo), que é o único filho com fundo/conteúdo próprio tocando a borda. */
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}

.oferta-admin-card__imagem {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  border-radius: 14px 14px 0 0;
  /* Sem isto, um item flex com imagem não-quadrada (ex: foto vertical do Mercado
     Livre) ignora o aspect-ratio — o min-height automático de item flex deixa o
     conteúdo "vazar" e crescer pra caber a imagem inteira, em vez de cortar. */
  overflow: hidden;
  min-height: 0;
}

.oferta-admin-card__imagem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.oferta-admin-card__imagem .status-chip {
  position: absolute;
  top: .4rem;
  right: .4rem;
}

.oferta-admin-card__corpo {
  padding: .7rem .8rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex: 1;
}

.oferta-admin-card__loja {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}

.oferta-admin-card__titulo {
  font-size: .87rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.oferta-admin-card__valor {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-end);
}

.oferta-admin-card__meta {
  font-size: .72rem;
  color: var(--text-muted);
}

.oferta-admin-card__rodape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .6rem .8rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* CTA principal do card ocupa o espaço disponível — a ação mais usada tem o
   alvo mais fácil de acertar (Lei de Fitts), o menu ⋮ ao lado fica pequeno de propósito. */
.oferta-admin-card__rodape .btn {
  flex: 1;
  justify-content: center;
  font-size: .78rem;
  padding: .5rem .7rem;
}

/* ── Status chips ────────────────────────────────── */

.status-chip {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .2rem .7rem;
  border-radius: 99px;
  white-space: nowrap;
}

.status-chip--ativo  { background: rgba(22,163,74,.12); color: var(--green); border: 1px solid rgba(22,163,74,.3); }
.status-chip--inativo { background: rgba(100,116,139,.12); color: var(--text-muted); border: 1px solid rgba(100,116,139,.25); }
.status-chip--expirada { background: rgba(234,88,12,.1); color: var(--orange); border: 1px solid rgba(234,88,12,.3); margin-left: .3rem; }

/* ── Menu de 3 pontinhos (card-kebab) — mesmo padrão sem JS do segmento-switcher ── */

.card-kebab {
  position: relative;
}

.card-kebab__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  color: #fff;
  background: rgba(15, 23, 42, .45);
}

.card-kebab__trigger::-webkit-details-marker { display: none; }
.card-kebab__trigger:hover { background: rgba(15, 23, 42, .65); }

.card-kebab__menu {
  position: absolute;
  bottom: calc(100% + .3rem);
  right: 0;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
  padding: .3rem;
  min-width: 210px;
  display: flex;
  flex-direction: column;
}

.card-kebab__label {
  padding: .45rem .6rem .15rem;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}

.card-kebab__item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .6rem;
  border-radius: 8px;
  font-size: .82rem;
  color: var(--text);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.card-kebab__item:hover { background: var(--surface-2); }
.card-kebab__item .material-icons { font-size: 1.05rem; }
.card-kebab__item--perigo { color: #ef4444; }
.card-kebab__sep { border-top: 1px solid var(--border); margin: .25rem 0; }

/* ── Action icons ────────────────────────────────── */

.action-icons {
  display: flex;
  align-items: center;
  gap: .2rem;
  flex-wrap: wrap;
}

.action-icons a,
.action-icons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: background .12s, color .12s, border-color .12s;
}

.action-icons a:hover { background: rgba(37,99,235,.1); color: var(--accent-end); border-color: var(--accent); }
.action-icons .btn-disable:hover { background: rgba(234,88,12,.1); color: var(--orange); border-color: var(--orange); }
.action-icons .btn-delete:hover  { background: rgba(220,38,38,.1); color: var(--red); border-color: var(--red); }

.action-icons form { display: inline-flex; }
.action-icons .material-icons { font-size: 1.1rem; }

/* ── Empty state ─────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--text-muted);
}

.empty-state .material-icons { font-size: 3rem; color: rgba(37,99,235,.3); display: block; margin-bottom: .6rem; }
.empty-state p { font-size: .95rem; }

/* ── Card (form wrapper) ─────────────────────────── */

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}

/* ── Form ────────────────────────────────────────── */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.4rem;
}

.form-grid .span-2 { grid-column: span 2; }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
}

/* ── Toggle (interruptor) ─────────────────────────── */

.toggle {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__trilho {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  flex-shrink: 0;
  transition: background .15s;
}

.toggle__bolinha {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.3);
  transition: transform .15s;
}

.toggle input:checked ~ .toggle__trilho { background: var(--green); }
.toggle input:checked ~ .toggle__trilho .toggle__bolinha { transform: translateX(18px); }

.toggle__rotulo {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.form-group label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  padding: .65rem .9rem;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  width: 100%;
  -webkit-appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-soft); }

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.form-group select option { background: #fff; color: var(--text); }

.form-group input[type="file"] {
  padding: .5rem .75rem;
  font-size: .82rem;
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: 1.6rem;
  flex-wrap: wrap;
}

/* Image preview */
.img-preview {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  width: 100px;
  height: 100px;
  display: inline-block;
  margin-bottom: .5rem;
}

.img-preview img { width: 100%; height: 100%; object-fit: cover; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .83rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: .3rem;
}

.checkbox-label input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .9rem;
  margin-top: .3rem;
}

.checkbox-group .checkbox-label { margin-top: 0; }

/* ── Credenciais de provedor (chave/valor livre) ───── */

.campo-credencial {
  display: flex;
  align-items: flex-end;
  gap: .9rem;
  margin-bottom: 1rem;
}

.campo-credencial .form-group { flex: 1; }

.campo-credencial .checkbox-label { margin-top: 0; white-space: nowrap; }

@media (max-width: 640px) {
  .campo-credencial { flex-wrap: wrap; }
}

/* ── Importar oferta pelo link ───────────────────── */

.importar-card {
  margin-bottom: 1.2rem;
  border-color: rgba(37,99,235,.25);
  background: linear-gradient(180deg, rgba(37,99,235,.05), transparent 70%), var(--surface);
  padding: 1.3rem 1.5rem;
}

.importar-card__head {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  margin-bottom: .9rem;
}

.importar-card__head .material-icons {
  color: var(--accent-end);
  font-size: 1.3rem;
  margin-top: .1rem;
}

.importar-card__head strong {
  display: block;
  font-size: .95rem;
  color: var(--text);
}

.importar-card__head span {
  display: block;
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

.importar-card__row {
  display: flex;
  gap: .7rem;
  align-items: stretch;
}

.importar-card__row input {
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  padding: .65rem .9rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.importar-card__row input::placeholder { color: var(--text-soft); }

.importar-card__row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.importar-card__row .btn { white-space: nowrap; }

.btn--carregando {
  opacity: .65;
  pointer-events: none;
}

.btn--carregando .material-icons {
  animation: girar .9s linear infinite;
}

@keyframes girar {
  to { transform: rotate(360deg); }
}

.importar-status {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  margin: .8rem 0 0;
  padding: .55rem .8rem;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.importar-status--ok     { border-color: rgba(22,163,74,.3);  color: var(--green); }
.importar-status--aviso  { border-color: rgba(202,138,4,.35); color: #ca8a04; }
.importar-status--erro   { border-color: rgba(220,38,38,.3);  color: var(--red); }

/* Pisca o campo recém-preenchido para o admin ver o que mudou */
.campo-importado {
  animation: campoPreenchido 1.4s ease-out;
}

@keyframes campoPreenchido {
  0%   { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.3); }
  100% { border-color: var(--border); box-shadow: none; }
}

@media (max-width: 640px) {
  .importar-card__row { flex-direction: column; }
  .importar-card__row .btn { justify-content: center; }
}

/* ── Gerador de mensagem ─────────────────────────── */

.gerador { display: grid; gap: 1.2rem; }

/* Abas genéricas — usadas pelo gerador de mensagem (origem-tab) e por
   qualquer outra tela com seções alternáveis (ex: Configurações). */
.origem-tabs, .abas {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.origem-tab, .aba {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  padding: .55rem 1rem;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.origem-tab:hover, .aba:hover { border-color: var(--border-hover); color: var(--text); }

.origem-tab--ativa, .aba--ativa {
  background: rgba(37,99,235,.1);
  border-color: var(--accent);
  color: var(--accent-end);
}

.origem-tab .material-icons, .aba .material-icons { font-size: 1.05rem; }

.dica {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .35rem;
}

.resultado__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.resultado__acoes { display: flex; gap: .6rem; flex-wrap: wrap; }

.btn--whatsapp { background: #25d366; }
.btn--whatsapp:hover { background: #128c7e; box-shadow: 0 6px 16px rgba(37,211,102,.3); }

/* Fundo do WhatsApp para o admin conferir como a mensagem vai chegar — de
   propósito escuro mesmo no tema claro: é uma réplica da interface real do
   WhatsApp, não uma superfície do admin. */
.zap-preview {
  background: #0b141a;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
}

.zap-bolha {
  display: block;
  width: 100%;
  background: #005c4b;
  color: #e9edef;
  border: none;
  border-radius: 12px 12px 12px 4px;
  padding: .9rem 1rem;
  font-family: inherit;
  font-size: .9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  resize: vertical;
  outline: none;
  overflow: hidden;
}

.zap-bolha:focus { box-shadow: 0 0 0 2px rgba(37,211,102,.4); }

/* ── Templates de mensagem ───────────────────────── */

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.1rem;
}

.template-card { padding: 1.2rem 1.3rem; }

.template-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .8rem;
}

.template-card__loja {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  color: var(--accent-end);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .15rem;
}

.template-card__head strong { font-size: .95rem; color: var(--text); }

/* Prévia do texto tal como chega no WhatsApp — mesma lógica do .zap-preview:
   caixa de "conteúdo bruto" que fica escura de propósito, mesmo no tema claro. */
.template-card__corpo {
  background: #12121f;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: .8rem;
  margin: 0;
  font-family: inherit;
  font-size: .78rem;
  line-height: 1.5;
  color: #9ca3af;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
}

.corpo-template {
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  white-space: pre-wrap;
}

.variaveis {
  margin-top: 1.4rem;
  padding: 1rem 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.variaveis > strong { font-size: .85rem; color: var(--text); }

.variaveis > small {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

.variaveis__lista {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .8rem;
}

.variavel-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .1rem;
  background: rgba(37,99,235,.06);
  border: 1px solid rgba(37,99,235,.25);
  border-radius: 9px;
  padding: .45rem .7rem;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color .15s, background .15s;
}

.variavel-chip:hover { background: rgba(37,99,235,.12); border-color: var(--accent); }

.variavel-chip code {
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent-end);
}

.variavel-chip span {
  font-size: .68rem;
  color: var(--text-muted);
}

/* Bloco com o ícone posicionado à parte, não flex: com flex, cada <strong>/<a>/<code>
   do texto virava uma coluna própria e o aviso se quebrava em pedaços lado a lado. */
.variaveis__aviso {
  position: relative;
  padding-left: 1.4rem;
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: .9rem 0 0;
}

.variaveis__aviso .material-icons {
  position: absolute;
  left: 0;
  top: .05rem;
  font-size: 1rem;
  color: #ca8a04;
}

@media (max-width: 640px) {
  .template-grid { grid-template-columns: 1fr; }
  .resultado__head { flex-direction: column; align-items: stretch; }
  .resultado__head .btn { justify-content: center; }
}

/* ── Login ───────────────────────────────────────── */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.2rem 2rem;
  box-shadow: 0 20px 45px rgba(15,23,42,.1);
}

.login-card__brand {
  text-align: center;
  margin-bottom: 1.6rem;
}

.login-card__brand .material-icons {
  font-size: 2.8rem;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-bottom: .3rem;
}

.login-card__brand h2 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}

.login-card__brand p {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: .1rem;
}

.alert {
  padding: .7rem 1rem;
  border-radius: 10px;
  font-size: .83rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.alert--error { background: rgba(220,38,38,.08); border: 1px solid rgba(220,38,38,.3); color: var(--red); }
.alert--info  { background: rgba(37,99,235,.08); border: 1px solid rgba(37,99,235,.3); color: var(--accent-end); }

.login-form { display: flex; flex-direction: column; gap: .9rem; }

.login-form .form-group label { font-size: .8rem; }

.login-form .btn { justify-content: center; padding: .75rem; font-size: .92rem; }

/* Cadastro tem endereço completo — mais largo que o card de login. */
.login-card--largo { max-width: 620px; }

.login-card__titulo {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .3rem;
}

.login-card__sub {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.1rem;
}

/* Botão oficial do Google: fundo branco, borda cinza e o "G" colorido. */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  padding: .7rem;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 10px;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, box-shadow .15s;
}

.btn-google:hover { background: #f8fafc; box-shadow: 0 2px 8px rgba(15,23,42,.08); }

.login-divisor {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 1.1rem 0;
  font-size: .75rem;
  color: var(--text-muted);
}

.login-divisor::before,
.login-divisor::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.1rem;
  font-size: .82rem;
}

.login-links a { color: var(--accent); text-decoration: none; font-weight: 500; }
.login-links a:hover { text-decoration: underline; }

.login-links__botao {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--text-muted);
  cursor: pointer;
}

.login-links__botao:hover { text-decoration: underline; }

.login-secao {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-top: .4rem;
}

.aceite-termos {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.aceite-termos input { margin-top: .2rem; }
.aceite-termos a { color: var(--accent); }

/* Textos legais ainda não revisados — a faixa some quando o texto final entrar. */
.texto-legal { max-width: 720px; margin: 0 auto; font-size: .88rem; line-height: 1.7; color: var(--text); }
.texto-legal h2 { font-size: 1.1rem; margin: 1.4rem 0 .4rem; }
.texto-legal ul { padding-left: 1.2rem; }
.texto-legal__rascunho {
  padding: .7rem 1rem;
  border-radius: 10px;
  background: rgba(202,138,4,.1);
  border: 1px solid rgba(202,138,4,.35);
  color: #854d0e;
  font-size: .8rem;
  margin-bottom: 1rem;
}

/* ── Filtro de datas (dashboard) ────────────── */

.filtro-datas {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  margin-bottom: .75rem;
}

.filtro-datas__campo {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1;
  min-width: 180px;
}

.filtro-datas__campo label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.filtro-datas__campo input[type="datetime-local"],
.filtro-datas__campo input[type="date"],
.filtro-datas__campo input[type="text"],
.filtro-datas__campo select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: .88rem;
  padding: .6rem .9rem;
  outline: none;
  width: 100%;
  color-scheme: light;
  transition: border-color .15s, box-shadow .15s;
}

.filtro-datas__campo input[type="datetime-local"]:focus,
.filtro-datas__campo input[type="date"]:focus,
.filtro-datas__campo input[type="text"]:focus,
.filtro-datas__campo select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.filtro-datas__campo select option { background: #fff; color: var(--text); }

.filtro-aviso {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding: .5rem .8rem;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.filtro-aviso .material-icons { font-size: 1rem; color: var(--accent); }
.filtro-aviso--padrao .material-icons { color: var(--text-muted); }
.filtro-aviso strong { color: var(--text); }

/* ── Dashboard ───────────────────────────────── */

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.2rem;
}

@media (max-width: 900px) { .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .dash-kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(15,23,42,.05);
}

.kpi-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-card__icon .material-icons { font-size: 1.3rem; }

.kpi-card__value {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.kpi-card__label {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

/* ── Hub de Configurações (cards de funcionalidade) ── */

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.5rem;
}

.hub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.3rem;
  box-shadow: 0 1px 3px rgba(15,23,42,.05);
  display: flex;
  flex-direction: column;
  gap: .7rem;
  text-decoration: none;
  transition: box-shadow .15s, transform .15s;
}

.hub-card:hover {
  box-shadow: 0 8px 20px rgba(15,23,42,.1);
  transform: translateY(-1px);
}

.hub-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hub-card__icon .material-icons { font-size: 1.3rem; }

.hub-card__titulo {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.hub-card__subtitulo {
  font-size: .78rem;
  color: var(--text-muted);
  margin: .1rem 0 0;
}

.hub-card__descricao {
  font-size: .82rem;
  color: var(--text-muted);
  flex: 1;
  margin: 0;
}

.hub-card__acao {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent-end);
}

.hub-card__acao .material-icons { font-size: 1rem; }

.dash-mid-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) { .dash-mid-grid { grid-template-columns: 1fr; } }

.dash-section-title {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .9rem;
  font-weight: 700;
  color: var(--accent-end);
  margin-bottom: 1rem;
}

.dash-section-title .material-icons { font-size: 1.1rem; }

/* Device bars */
.device-split { display: flex; flex-direction: column; gap: .9rem; }

.device-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .83rem;
  color: var(--text-muted);
  margin-bottom: .3rem;
}

.device-item__header span { display: flex; align-items: center; gap: .3rem; }
.device-item__header .material-icons { font-size: 1rem; }
.device-item__header strong { color: var(--text); }
.device-item__pct { font-size: .72rem; color: var(--text-muted); margin-top: .2rem; display: block; }

/* Generic bar */
.bar-track {
  height: 7px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
}

.bar-fill--mobile  { background: var(--accent); }
.bar-fill--desktop { background: var(--pink); }
.bar-fill--accent  { background: var(--accent); }

/* Top ofertas */
.top-ofertas { display: flex; flex-direction: column; gap: .75rem; }

.top-oferta-item__header {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
}

.top-oferta-item__rank {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(37,99,235,.12);
  color: var(--accent-end);
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.top-oferta-item__nome {
  flex: 1;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-oferta-item__total { color: var(--accent-end); font-weight: 700; flex-shrink: 0; }

/* Day chart */
.dia-chart {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  height: 100px;
  padding-top: 1.5rem;
}

.dia-chart__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}

.dia-chart__bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}

.dia-chart__bar {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.dia-chart__val {
  font-size: .6rem;
  color: var(--accent-end);
  position: absolute;
  top: -1.1rem;
  white-space: nowrap;
}

.dia-chart__label {
  font-size: .62rem;
  color: var(--text-muted);
  margin-top: .3rem;
  white-space: nowrap;
}

/* Donut chart (Status das Instâncias) */
.donut-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.donut-legend__item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--text);
}

.donut-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-legend__valor {
  margin-left: auto;
  font-weight: 700;
  padding-left: 1rem;
}

/* Event type chips */
.tipo-chip {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: .18rem .6rem;
  border-radius: 99px;
  white-space: nowrap;
}

.tipo-chip--oferta  { background: rgba(37,99,235,.1);  color: var(--accent-end); border: 1px solid rgba(37,99,235,.3); }
.tipo-chip--cupom   { background: rgba(219,39,119,.08); color: var(--pink); border: 1px solid rgba(219,39,119,.3); }
.tipo-chip--comprar { background: rgba(22,163,74,.1);  color: var(--green); border: 1px solid rgba(22,163,74,.3); }
.tipo-chip--compartilhar { background: rgba(37,211,102,.12); color: #128c7e; border: 1px solid rgba(37,211,102,.3); }

/* ── Agenda de divulgação ────────────────────────── */

.horarios { display: flex; flex-wrap: wrap; gap: .6rem; }

.horario-item {
  display: flex;
  align-items: center;
  gap: .3rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .3rem .4rem .3rem .6rem;
}

.horario-item input {
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  color-scheme: light;
  outline: none;
}

.horario-remover {
  display: flex;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: .1rem;
  border-radius: 6px;
}

.horario-remover:hover { color: var(--red); background: rgba(220,38,38,.1); }
.horario-remover .material-icons { font-size: 1rem; }

.fila { display: grid; gap: .8rem; }

.fila-item {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
}

.fila-item--enviada { opacity: .55; border-color: rgba(22,163,74,.3); }
.fila-item--pulada  { opacity: .45; }
.fila-item--atrasada { border-color: rgba(234,88,12,.4); }

.fila-item__hora { display: flex; flex-direction: column; gap: .15rem; }
.fila-item__hora strong { font-size: 1.15rem; color: var(--text); }

.fila-item__marca {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}

.fila-item__marca--atrasada { color: var(--orange); }

.fila-item__produto { display: flex; align-items: center; gap: .8rem; min-width: 0; }

.fila-item__produto img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.fila-item__produto strong {
  display: block;
  font-size: .9rem;
  color: var(--text);
}

.fila-item__meta { font-size: .76rem; color: var(--text-muted); }

.fila-item__problema {
  display: block;
  font-size: .74rem;
  color: var(--orange);
  margin-top: .2rem;
}

.fila-item__acoes { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.fila-item__acoes .btn { font-size: .78rem; padding: .45rem .8rem; }

.fila-item__envios {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-top: .4rem;
  padding-top: .4rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

.envio-linha {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  font-size: .8rem;
}

.envio-linha__grupo { font-weight: 600; }
.envio-linha__erro { color: #ef4444; font-size: .76rem; }
.envio-linha form { margin-left: auto; }
.envio-linha .btn { font-size: .74rem; padding: .35rem .7rem; }

.fila-item__previa { grid-column: 1 / -1; margin-top: .3rem; }

.fila-item__previa summary {
  cursor: pointer;
  font-size: .78rem;
  color: var(--text-muted);
  padding: .2rem 0;
}

/* Prévia bruta da mensagem — mesma caixa escura de propósito do
   .template-card__corpo, tratada como "conteúdo", não como chrome do admin. */
.fila-item__previa pre {
  margin: .5rem 0 0;
  background: #12121f;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: .8rem;
  font-family: inherit;
  font-size: .8rem;
  line-height: 1.5;
  color: #9ca3af;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 720px) {
  .fila-item { grid-template-columns: 1fr; gap: .7rem; }
  .fila-item__hora { flex-direction: row; align-items: baseline; gap: .5rem; }
  .fila-item__acoes { justify-content: stretch; }
  .fila-item__acoes .btn, .fila-item__acoes form { flex: 1; }
  .fila-item__acoes .btn { width: 100%; justify-content: center; }
}

/* ── Alertas de preço ────────────────────────────── */

.alerta-item__queda { display: flex; flex-direction: column; gap: .3rem; }

.alerta-item__percentual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: rgba(22,163,74,.1);
  border: 1px solid rgba(22,163,74,.3);
  color: var(--green);
  font-weight: 800;
  font-size: .95rem;
}

.alerta-item__de {
  text-decoration: line-through;
  color: var(--text-muted);
}

.alerta-item__por { color: var(--green); }

@media (max-width: 720px) {
  .alerta-item__queda { flex-direction: row; align-items: center; gap: .6rem; }
}

/* ── Badge de notificação no menu ─────────────────── */

.admin-nav__link--com-badge { position: relative; }

.admin-nav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 .3rem;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
}

/* ── Modal (QR code do WhatsApp) ──────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 1rem;
}

.modal-conteudo {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  padding: 1.6rem;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
}

.modal-fechar {
  position: absolute;
  top: .8rem;
  right: .8rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: .3rem;
  border-radius: 8px;
}

.modal-fechar:hover { background: var(--surface-2); color: var(--text); }

.qr-passos { display: flex; flex-direction: column; gap: .9rem; }

.qr-passo {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  font-size: .85rem;
  color: var(--text);
  line-height: 1.4;
}

.qr-passo__numero {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-end);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
}

.qr-imagem-wrap { text-align: center; }

.qr-imagem-wrap img {
  width: 220px;
  height: 220px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.qr-timer {
  display: block;
  margin-top: .6rem;
  font-size: .8rem;
  color: var(--text-muted);
}

.conta-whatsapp__visao,
.conta-whatsapp__edicao {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
