/* ═══════════════════════════════════════════════════
   Variáveis e base
═══════════════════════════════════════════════════ */
:root {
  --bg:         #eef7ef;
  --panel:      #0b3b23;
  --panel-2:    #093020;
  --text:       #0f172a;
  --muted:      rgba(15,23,42,.55);
  --border:     rgba(15,23,42,.10);
  --card:       #ffffff;
  --white:      #fff;
  --accent:     #22c55e;
  --accent-dim: rgba(34,197,94,.15);
  --green-text: #166534;
  --danger:     #ef4444;
  --warning:    #f59e0b;
  --radius:     14px;
  --radius-sm:  10px;
  --font:       'DM Sans', system-ui, sans-serif;
  --mono:       'DM Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
#app { display: flex; min-height: 100vh; }

/* ═══════════════════════════════════════════════════
   Sidebar
═══════════════════════════════════════════════════ */
.sidebar {
  width: 268px;
  background: linear-gradient(175deg, var(--panel) 0%, var(--panel-2) 100%);
  color: rgba(255,255,255,.92);
  padding: 14px 10px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.10) transparent;
  flex-shrink: 0;
  /* Garante que o conteúdo interno respeita a largura */
  min-width: 0;
  box-sizing: border-box;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 6px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 14px;
}
.brand-dot {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: rgba(34,197,94,.18);
  border: 1px solid rgba(34,197,94,.32);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.brand-title { font-weight: 900; font-size: 14px; letter-spacing: -.2px; }
.brand-sub   { font-size: 11px; opacity: .60; margin-top: 2px; }

.sidebar-actions {
  padding: 0 4px 14px;
  display: grid;
  gap: 8px;
}

.btn {
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.95);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  transition: background .12s;
}
.btn:hover    { background: rgba(255,255,255,.14); }
.btn:disabled { opacity: .50; cursor: not-allowed; }
.btn-primary  { background: rgba(34,197,94,.18); border-color: rgba(34,197,94,.35); }
.btn-primary:hover { background: rgba(34,197,94,.28); }
.btn-admin-action {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.15);
  color: rgba(255,255,255,.7);
  font-size: 12px;
  margin-top: 8px;
}
.btn-admin-action:hover { background: rgba(255,255,255,.12); color: #fff; }

.sidebar-section { padding: 0 4px; }
.section-title {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .9px;
  text-transform: uppercase;
  opacity: .50;
  margin-bottom: 10px;
  padding: 0 6px;
}
.categories-list { display: grid; gap: 3px; }

/* Botões de categoria */
.category-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.86);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  transition: background .10s;
  text-align: left;
  box-sizing: border-box; /* garante que padding não expande o botão para fora */
  min-width: 0;           /* permite que filhos flex encolham corretamente */
}
.category-btn:hover  { background: rgba(255,255,255,.10); }
.category-btn.active { background: rgba(34,197,94,.18); border-color: rgba(34,197,94,.35); color: #fff; }

.cat-icon  { width: 16px; flex-shrink: 0; display: flex; justify-content: center; font-size: 12px; }
.cat-name  { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cat-count {
  font-size: 10px; font-family: var(--mono);
  opacity: .55;
  background: rgba(255,255,255,.08);
  padding: 2px 6px; border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Subcategorias */
.cat-group   { margin-bottom: 1px; }
.subcats     { padding-left: 8px; margin-top: 3px; display: grid; gap: 2px; }
.subcategory-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.03);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12px;
  font-family: var(--font);
  color: rgba(255,255,255,.78);
  cursor: pointer;
  transition: background .10s;
  text-align: left;
  box-sizing: border-box;
  min-width: 0;
}
.subcategory-btn:hover  { background: rgba(255,255,255,.10); }
.subcategory-btn.active { background: rgba(34,197,94,.16); border-color: rgba(34,197,94,.32); color: #fff; }
.subcat-name  { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.subcat-count { opacity: .50; font-family: var(--mono); font-size: 10px; flex-shrink: 0; white-space: nowrap; }

/* ═══════════════════════════════════════════════════
   Topbar / Main
═══════════════════════════════════════════════════ */
.main { flex: 1; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  position: sticky; top: 0;
  background: rgba(238,247,239,.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.70);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-weight: 800; cursor: pointer; font-size: 14px;
}
.search {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 500px;
}
.search input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.90);
  font-family: var(--font); font-size: 13px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.search input:focus {
  border-color: rgba(34,197,94,.45);
  box-shadow: 0 0 0 3px rgba(34,197,94,.10);
}
.search button {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(34,197,94,.12);
  font-family: var(--font); font-weight: 800; font-size: 13px;
  cursor: pointer; transition: background .10s;
}
.search button:hover { background: rgba(34,197,94,.22); }

.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
#sortBySelect {
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  font-family: var(--font); font-weight: 700; font-size: 13px;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════
   Grid de produtos + Cards
═══════════════════════════════════════════════════ */
.content { padding: 20px; }
.content-head {
  display: flex; align-items: flex-end;
  justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.content h1   { font-size: 20px; font-weight: 900; letter-spacing: -.4px; }
.stats-text   { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  transition: opacity .18s;
}
.grid.loading { opacity: .40; pointer-events: none; }

/* Card */
.card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .10s, box-shadow .14s, border-color .12s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0,0,0,.10);
  border-color: rgba(34,197,94,.25);
}

/* CORREÇÃO: object-fit contain para não cortar produtos */
.card-img-wrap {
  height: 160px;
  background: #f8faf8;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(15,23,42,.05);
}
.card-img {
  width: 100%; height: 100%;
  object-fit: contain;       /* ← contain, não cover */
  padding: 8px;
  transition: transform .20s;
}
.card:hover .card-img { transform: scale(1.05); }

.card-body   { padding: 12px 12px 14px; }
.card-title  { font-weight: 800; font-size: 13px; line-height: 1.3; }
.card-meta   { font-size: 11px; color: var(--muted); margin-top: 5px; font-weight: 600; }

/* Preço no card — mostra o melhor preço disponível */
.card-price-wrap { margin-top: 10px; }
.card-price-main {
  font-weight: 900; font-size: 15px;
  color: var(--green-text);
}
.card-price-label {
  font-size: 10px; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: .4px; margin-top: 2px;
}

/* Skeleton */
.card-skeleton {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 16px; overflow: hidden;
  animation: pulse 1.6s ease-in-out infinite;
}
.card-skeleton-img  { height: 160px; background: rgba(15,23,42,.06); }
.card-skeleton-body { padding: 12px 12px 14px; display: grid; gap: 9px; }
.card-skeleton-line {
  height: 11px; border-radius: 6px;
  background: rgba(15,23,42,.07);
}
.card-skeleton-line.s { width: 55%; }
.card-skeleton-line.p { width: 38%; height: 15px; margin-top: 3px; }

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.50; } }

/* Estado vazio */
.empty-state {
  grid-column: 1/-1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 72px 24px; gap: 14px; text-align: center;
}
.empty-icon  { font-size: 48px; opacity: .40; }
.empty-title { font-size: 17px; font-weight: 900; letter-spacing: -.3px; }
.empty-sub   { font-size: 13px; color: var(--muted); max-width: 280px; line-height: 1.6; }
.empty-btn {
  margin-top: 4px; padding: 10px 22px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: rgba(255,255,255,.90); font-family: var(--font);
  font-weight: 800; font-size: 13px; cursor: pointer; transition: background .10s;
}
.empty-btn:hover { background: var(--accent-dim); }

/* Estado erro */
.error-state {
  grid-column: 1/-1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 72px 24px; gap: 12px; text-align: center;
}
.error-icon  { font-size: 40px; }
.error-title { font-size: 16px; font-weight: 900; color: var(--danger); }
.error-sub   { font-size: 13px; color: var(--muted); }
.error-btn {
  margin-top: 4px; padding: 10px 22px;
  border-radius: var(--radius); border: 1px solid rgba(239,68,68,.22);
  background: rgba(239,68,68,.06); font-family: var(--font);
  font-weight: 800; font-size: 13px; cursor: pointer;
  color: var(--danger); transition: background .10s;
}
.error-btn:hover { background: rgba(239,68,68,.12); }

/* Pager */
.pager {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; padding: 20px 0 32px;
}
.pager button {
  padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  font-family: var(--font); font-weight: 800; font-size: 13px; cursor: pointer;
  transition: background .10s;
}
.pager button:hover    { background: var(--accent-dim); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pages { font-weight: 800; color: var(--muted); font-size: 13px; font-family: var(--mono); }

/* ═══════════════════════════════════════════════════
   MODAL PRODUTO
═══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.56);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 20px; z-index: 9990;
  animation: fadeIn .14s ease;
  overflow-y: auto;   /* ← O OVERLAY FAZ O SCROLL, não o modal */
  overflow-x: hidden;
  box-sizing: border-box;
}
.modal-overlay.hidden { display: none; }
.modal-overlay.is-closing { animation: overlayOut .14s ease both; }
.modal-overlay.is-closing .modal-box { animation: popupBoxOut .14s ease both; }

@keyframes fadeIn     { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp    { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes overlayOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes popupBoxIn  { from { opacity:0; transform:scale(.95) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }
@keyframes popupBoxOut { from { opacity:1; transform:scale(1) translateY(0); } to { opacity:0; transform:scale(.95) translateY(6px); } }

.modal-box {
  width: min(1100px, 96vw);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0,0,0,.22);
  position: relative;
  animation: slideUp .15s ease;
  display: flex;
  flex-direction: column;
  /* SEM max-height — cresce com o conteúdo, o overlay faz scroll */
  margin: 0 auto;      /* centraliza horizontalmente */
  flex-shrink: 0;      /* não comprime dentro do overlay flex */
}

.modal-close {
  position: absolute; top: 12px; right: 12px;
  border: 1px solid var(--border); background: rgba(255,255,255,.96);
  border-radius: 9px; padding: 7px 9px; cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
  transition: background .10s;
}
.modal-close:hover { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.20); }

/* Layout 2 colunas — altura automática, sem restrições */
.modal-inner {
  display: grid;
  grid-template-columns: 300px 1fr;
}

/* ── Coluna esquerda ── */
.modal-left {
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}

/* ── Coluna direita: concorrentes ── */
.modal-right {
  display: flex; flex-direction: column;
  padding: 16px;
  background: #fafbfa;
}

/* Imagem do produto — contain para não cortar */
.modal-img-wrap {
  position: relative;
  background: #f5f9f5;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  height: 240px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.modal-img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;   /* ← nunca corta */
  padding: 12px;
  display: block;
}
.modal-img-skeleton {
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(15,23,42,.04) 0%, rgba(15,23,42,.09) 50%, rgba(15,23,42,.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Info produto */
.modal-info {
  padding: 16px;
  display: flex; flex-direction: column; gap: 0;
  flex: 1;
}
.modal-category {
  font-size: 10px; font-weight: 900; color: var(--muted);
  letter-spacing: .5px; text-transform: uppercase; margin-bottom: 6px;
}
.modal-name {
  font-size: 15px; font-weight: 900; line-height: 1.35;
  letter-spacing: -.2px; margin-bottom: 12px;
}

/* ── Preços ──
   Lógica:
   - price       = preço regular (maior)
   - promo_price = preço à vista / PIX (menor, melhor negócio)
   Se tiver promo: mostra promo grande em verde + regular menor riscado
   Se não tiver: mostra price normal
*/
.modal-prices { margin-bottom: 14px; }

.price-vista {
  display: flex; align-items: baseline; gap: 6px;
  flex-wrap: wrap;
}
.price-vista-value {
  font-size: 20px; font-weight: 900;
  color: var(--green-text);
}
.price-vista-badge {
  font-size: 10px; font-weight: 800;
  background: rgba(34,197,94,.15);
  color: #166534;
  border: 1px solid rgba(34,197,94,.25);
  padding: 2px 7px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .4px;
}
.price-regular-row {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
}
.price-regular-label {
  font-size: 11px; color: var(--muted); font-weight: 600;
}
.price-regular-value {
  font-size: 13px; color: var(--muted);
  text-decoration: line-through;
}
/* Quando só tem preço regular */
.price-only {
  font-size: 20px; font-weight: 900; color: var(--green-text);
}

/* ── Ações — grade 2×2: [Destacar] [Ver na NatuFórmulas] / [Descrição] [Composição] ── */
.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.btn-star {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.92);
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-family: var(--font); font-weight: 800; font-size: 13px;
  display: flex; gap: 7px; align-items: center; justify-content: center; cursor: pointer;
  transition: background .10s, border-color .10s;
}
.btn-star:hover { background: rgba(250,204,21,.10); border-color: rgba(250,204,21,.35); }
.btn-star.is-starred {
  background: rgba(250,204,21,.14);
  border-color: rgba(250,204,21,.40);
  color: #92400e;
}

.btn-link {
  border: 1px solid var(--border);
  background: var(--accent-dim);
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-weight: 800; font-size: 13px;
  display: inline-flex; gap: 7px; align-items: center;
  text-decoration: none; color: var(--green-text);
  transition: background .10s; justify-content: center;
}
.btn-link:hover { background: rgba(34,197,94,.25); }

.btn-detail {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.90);
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-family: var(--font); font-weight: 800; font-size: 12px;
  display: flex; gap: 7px; align-items: center; justify-content: center;
  cursor: pointer; transition: background .10s, border-color .10s;
  color: var(--text);
}
.btn-detail:hover { background: var(--accent-dim); border-color: rgba(34,197,94,.28); }
.btn-detail.has-content { border-color: rgba(34,197,94,.30); color: var(--green-text); }


.offers-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  flex-shrink: 0;
  /* FIX: reserva espaço para o botão X absoluto (36px + 12px right + 8px gap = 56px) */
  padding-right: 56px;
}
.offers-header-actions {
  display: flex; align-items: center; gap: 8px;
}
.offers-title { font-size: 14px; font-weight: 900; }
.btn-refresh {
  display: flex; gap: 6px; align-items: center;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.90);
  padding: 7px 12px; border-radius: var(--radius-sm);
  font-family: var(--font); font-weight: 800; font-size: 12px;
  cursor: pointer; transition: background .10s;
  color: var(--text);
}
.btn-refresh:hover { background: var(--accent-dim); }
.btn-add-comp {
  background: var(--accent-dim);
  border-color: rgba(34,197,94,.35);
  color: var(--green-text);
  font-weight: 800;
}
.btn-add-comp:hover {
  background: rgba(34,197,94,.25);
}

/* Container que agrupa grid automático + coluna manual */
.offers-body {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
}

/* Grade automática: sempre 2 colunas, não cresce quando manual aparece */
.offers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
  flex: 1 1 0;
  min-width: 0;
}

/* Wrapper das colunas manuais — flex-row para suportar múltiplas colunas */
.manual-comps-col {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
  padding-left: 16px;
  margin-left: 16px;
  border-left: 1px solid var(--border);
  align-self: stretch;
}
.manual-comps-col.hidden { display: none; }

/* Cada subcolunas comporta até 3 cards */
.manual-comp-subcol {
  flex: 0 0 268px;
  width: 268px;
  max-width: 268px;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.manual-comp-subcol + .manual-comp-subcol {
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

/* Modal cresce via JS (style.width) — sem regra CSS estática */

/* Card de concorrente — altura automática, sem min-height fixo */
.offer-card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius);
  padding: 10px;
  display: flex; flex-direction: column; gap: 7px;
  transition: border-color .12s;
  overflow: hidden;
}
.offer-card:hover { border-color: rgba(34,197,94,.25); }

/* Linha de topo: nome da loja + botão de candidatos */
.offer-store-row {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
}
.offer-store-name {
  font-size: 11px; font-weight: 900; color: var(--text);
  letter-spacing: .2px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Badge "✎ Manual" inline na store-row */
.offer-manual-badge {
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 6px; flex-shrink: 0;
}

/* Ícone ✕ de remover override — ao lado do ↻ na store-row */
.offer-card-remove-btn {
  flex-shrink: 0;
  background: none; border: none;
  color: #94a3b8; font-size: 12px; font-weight: 700;
  cursor: pointer; padding: 2px 4px; border-radius: 4px;
  line-height: 1; transition: color .15s, background .15s;
}
.offer-card-remove-btn:hover { color: var(--danger); background: rgba(239,68,68,.08); }

/* Ícone ↻ de refresh individual no card do concorrente */
.offer-card-refresh-btn {
  flex-shrink: 0;
  background: none; border: none;
  color: #94a3b8; font-size: 13px;
  cursor: pointer; padding: 2px 4px; border-radius: 4px;
  line-height: 1; transition: color .15s, background .15s;
}
.offer-card-refresh-btn:hover { color: var(--accent); background: var(--accent-dim); }
.offer-card-refresh-btn:disabled { opacity: .4; cursor: default; }

/* Botão "🔄 N opções" (candidatos por loja) */
.offer-candidates-btn {
  font-family: var(--font); font-size: 10px; font-weight: 700;
  background: #f0fdf4; color: #166534;
  border: 1px solid rgba(34,197,94,.30);
  border-radius: 8px; padding: 3px 7px;
  cursor: pointer; white-space: nowrap;
  transition: background .10s;
  flex-shrink: 0;
}
.offer-candidates-btn:hover { background: #dcfce7; }

/* Layout horizontal do card: imagem esquerda + info direita */
.offer-body-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.offer-img-side {
  flex-shrink: 0;
  width: 78px;
}
.offer-info-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* No contexto lateral, a price-row não precisa de margin-top: auto */
.offer-info-side .offer-price-row { margin-top: 0; }

/* Imagem clicável */
.offer-img-wrap {
  position: relative; width: 100%; height: 70px;
  border-radius: 9px; overflow: hidden;
  background: #f5f9f5; border: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: border-color .12s;
}
/* Na coluna lateral, imagem mais alta para fotos verticais */
.offer-img-side .offer-img-wrap { height: 105px; }
.offer-img-wrap:hover { border-color: rgba(34,197,94,.4); }
.offer-img-wrap:hover .offer-img-overlay { opacity: 1; }

.offer-product-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  padding: 4px;
}
.offer-img-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.38);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; opacity: 0;
  transition: opacity .14s;
}
.offer-img-empty {
  font-size: 24px; opacity: .35;
}

.offer-product-name {
  font-size: 11px; font-weight: 600; line-height: 1.3;
  color: var(--text); overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.offer-price-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  margin-top: auto;
}
/* Agrupa spans de preço quando há promo — evita overflow do badge de comparação */
.offer-price-inner {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0;
}
.offer-price-value {
  font-size: 14px; font-weight: 900; color: var(--text);
}
/* Badge de comparação */
.offer-badge {
  font-size: 10px; font-weight: 800;
  padding: 3px 7px; border-radius: 999px;
  white-space: nowrap; flex-shrink: 0;
}
.offer-badge.cheaper    { background: rgba(34,197,94,.15);  color: #166534; border: 1px solid rgba(34,197,94,.25); }
.offer-badge.pricier    { background: rgba(239,68,68,.12);  color: #b91c1c; border: 1px solid rgba(239,68,68,.20); }
.offer-badge.equal      { background: rgba(245,158,11,.12); color: #92400e; border: 1px solid rgba(245,158,11,.20); }
.offer-badge.promo-flag { background: #fff7ed; color: #ea580c; border: 1px solid rgba(234,88,12,.25); }

/* Preço promocional (laranja) e preço original riscado */
.offer-price-promo { color: #ea580c; }
.offer-price-old   {
  font-size: 11px; font-weight: 600;
  color: #94a3b8; text-decoration: line-through;
  margin-right: 2px;
}

.offer-link-btn {
  display: block; width: 100%;
  text-align: center;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.90);
  padding: 5px; border-radius: 8px;
  font-size: 11px; font-weight: 800;
  text-decoration: none; color: var(--text);
  transition: background .10s; margin-top: 2px;
  box-sizing: border-box;
}
.offer-link-btn:hover { background: var(--accent-dim); }

/* Timestamp de última atualização */
.offer-last-update {
  font-size: 10px;
  color: #9ca3af;
  text-align: right;
  margin-top: 2px;
  margin-bottom: -2px;
  letter-spacing: .01em;
}

/* Estado: carregando */
.offer-card.is-loading { animation: pulse 1.6s ease-in-out infinite; }
.offer-loading-content {
  display: flex; flex-direction: column; gap: 8px; flex: 1;
}
.offer-skeleton-img {
  height: 60px; border-radius: 9px;
  background: rgba(15,23,42,.07);
}
.offer-skeleton-line {
  height: 10px; border-radius: 5px;
  background: rgba(15,23,42,.07);
}
.offer-skeleton-line.s { width: 65%; }

/* Estado: não encontrado */
.offer-card.is-notfound { background: rgba(148,163,184,.06); }
.offer-empty-content {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 1; gap: 8px;
}
.offer-empty-icon  { font-size: 22px; opacity: .45; }
.offer-empty-label { font-size: 11px; font-weight: 700; text-align: center; color: var(--muted); }
.offer-candidates-btn.nf-explore {
  margin-top: 4px;
  font-size: 10px; padding: 5px 10px;
  background: rgba(34,197,94,.09);
  border: 1px solid rgba(34,197,94,.25);
  color: var(--green-text);
  border-radius: 999px; cursor: pointer; font-weight: 700;
  transition: background .12s;
}
.offer-candidates-btn.nf-explore:hover { background: rgba(34,197,94,.18); }

/* Estado: erro */
.offer-card.is-error { background: rgba(239,68,68,.04); border-color: rgba(239,68,68,.12); }
.offer-error-content {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 1; gap: 4px;
}
.offer-error-icon  { font-size: 20px; }
.offer-error-label { font-size: 10px; font-weight: 700; color: var(--danger); text-align: center; }
.offer-error-detail {
  font-size: 9px; color: var(--muted); text-align: center;
  max-width: 140px; word-break: break-all; line-height: 1.3;
  cursor: help;
}

/* Botão "Adicionar produto" no card not_found */
.btn-add-product {
  margin-top: 6px;
  padding: 5px 12px;
  font-size: 11px; font-weight: 700;
  color: var(--green-text, #2e7d32);
  background: rgba(34,197,94,.08);
  border: 1px dashed rgba(34,197,94,.40);
  border-radius: 8px; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.btn-add-product:hover {
  background: rgba(34,197,94,.16);
  border-color: rgba(34,197,94,.70);
}

/* Formulário inline de URL no card not_found */
.offer-add-form {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 8px 6px;
  width: 100%;
}
.offer-add-label {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-align: center;
}
.offer-add-input {
  width: 100%; box-sizing: border-box;
  padding: 6px 8px; font-size: 11px;
  border: 1px solid var(--border); border-radius: 8px;
  outline: none; transition: border-color .12s;
}
.offer-add-input:focus { border-color: rgba(34,197,94,.60); }
.offer-add-error {
  font-size: 10px; color: var(--danger);
  text-align: center; line-height: 1.3;
}
.offer-add-error.hidden { display: none; }
.offer-add-actions {
  display: flex; gap: 6px; justify-content: center;
}
.btn-add-submit {
  padding: 5px 14px; font-size: 11px; font-weight: 700;
  color: #fff; background: var(--green, #22c55e);
  border: none; border-radius: 8px; cursor: pointer;
  transition: opacity .12s;
}
.btn-add-submit:disabled { opacity: .55; cursor: default; }
.btn-add-submit:not(:disabled):hover { opacity: .88; }
.btn-add-cancel {
  padding: 5px 10px; font-size: 11px; font-weight: 600;
  color: var(--muted); background: transparent;
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  transition: background .12s;
}
.btn-add-cancel:hover { background: rgba(0,0,0,.05); }

/* Botão × para remover override manual no card is-override */
.btn-remove-override {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  background: rgba(0,0,0,.05);
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; transition: background .12s, color .12s;
}
.btn-remove-override:hover {
  background: rgba(239,68,68,.10);
  color: var(--danger);
  border-color: rgba(239,68,68,.30);
}

/* ═══════════════════════════════════════════════════
   CAMADA DE OVERLAY GENÉRICA (sub-modais, popups)
═══════════════════════════════════════════════════ */
.overlay-layer {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.50);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 9995;
  /* FIX: backdrop-filter removido — mesma razão do modal-overlay */
  animation: fadeIn .12s ease;
}
.overlay-layer.hidden { display: none; }
.overlay-layer > * { animation: popupBoxIn .17s cubic-bezier(.2,.8,.4,1) both; }
.overlay-layer.is-closing { animation: overlayOut .14s ease both; }
.overlay-layer.is-closing > * { animation: popupBoxOut .14s ease both; }

/* Sub-modal Descrição / Composição */
.detail-modal-box {
  width: min(620px, 96vw);
  max-height: 85vh;
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,.20);
  display: flex; flex-direction: column;
  animation: slideUp .14s ease;
  overflow: hidden;
}
.detail-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.detail-modal-title { font-size: 15px; font-weight: 900; letter-spacing: -.2px; }
.detail-modal-close {
  border: 1px solid var(--border); background: rgba(255,255,255,.90);
  border-radius: 8px; padding: 6px 8px; cursor: pointer;
  transition: background .10s; flex-shrink: 0;
}
.detail-modal-close:hover { background: rgba(239,68,68,.08); }

.detail-modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}
.detail-modal-body p {
  font-size: 13px; line-height: 1.65; color: var(--text);
}
.detail-loading { font-size: 13px; color: var(--muted); font-weight: 600; }
.detail-empty { font-size: 13px; color: var(--muted); font-weight: 700; font-style: italic; }

/* ═══════════════════════════════════════════════════
   PRICE HISTORY MODAL (.ph-*)
═══════════════════════════════════════════════════ */
.ph-box {
  width: min(1240px, calc(100vw - 16px));
  max-height: calc(100vh - 40px);
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 28px 70px rgba(0,0,0,.22);
  display: flex; flex-direction: column;
  animation: slideUp .14s ease;
  overflow: hidden;
}
.ph-hdr {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 20px 14px;
  background: linear-gradient(135deg, #0a3d20 0%, #166534 60%, #15803d 100%);
  flex-shrink: 0;
}
.ph-hdr-title  { font-size: 15px; font-weight: 900; color: #fff; letter-spacing: -.2px; }
.ph-hdr-sub    { font-size: 12px; color: rgba(255,255,255,.5); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.ph-hdr-right  { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ph-view-tabs  { display: flex; background: rgba(0,0,0,.28); border-radius: 8px; padding: 2px; gap: 2px; }
.ph-export-actions { display: flex; align-items: center; gap: 6px; }
.ph-tab {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 13px; border: none; border-radius: 6px;
  background: transparent; color: rgba(255,255,255,.55);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all .14s; font-family: inherit;
}
.ph-tab.active { background: #fff; color: #166534; }
.ph-tab svg    { flex-shrink: 0; }
.ph-export-btn {
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  color: rgba(255,255,255,.82);
  transition: background .14s, color .14s;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-family: inherit;
}
.ph-export-btn:hover { background: rgba(255,255,255,.22); color: #fff; }
.ph-export-btn.pdf { background: rgba(15,23,42,.18); }
.ph-close {
  border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1);
  border-radius: 8px; padding: 7px 9px; cursor: pointer; color: rgba(255,255,255,.75);
  transition: background .14s; line-height: 0;
}
.ph-close:hover { background: rgba(255,255,255,.22); }

/* Summary bar */
.ph-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.ph-metric {
  min-height: 104px;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ph-metric-kicker {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.ph-metric-value {
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.ph-metric-detail {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  line-height: 1.35;
}
.ph-metric-meta {
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
  margin-top: auto;
}
.ph-metric-tone-alert {
  background: #fff7ed;
  border-color: #fdba74;
}
.ph-metric-tone-watch {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.ph-metric-tone-good {
  background: #ecfdf3;
  border-color: #86efac;
}
.ph-metric-tone-neutral {
  background: #fff;
}
.ph-sc {
  flex: 0 0 148px; padding: 10px 14px; background: #fff;
  cursor: pointer; transition: background .12s; display: flex; flex-direction: column; gap: 3px;
}
.ph-sc:hover    { background: #f8fafc; }
.ph-sc.active   { background: #f0fdf4; }
.ph-sc-hdr      { display: flex; align-items: center; gap: 5px; }
.ph-sc-dot      { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ph-sc-lbl      { font-size: 10px; font-weight: 700; color: #495057; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-sc.active .ph-sc-lbl { color: #166534; }
.ph-sc-val      { font-size: 14px; font-weight: 900; color: #212529; }
.ph-sc-sub      { font-size: 10px; color: #868e96; }
.ph-sc-meta     { font-size: 10px; color: #64748b; line-height: 1.35; }
.ph-manual-tag  { font-size: 9px; font-weight: 700; padding: 1px 5px; background: #fee2e2; color: #dc2626; border-radius: 4px; flex-shrink: 0; }
.ph-note {
  padding: 10px 16px;
  font-size: 11px;
  line-height: 1.45;
  color: #35556b;
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
}
.ph-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 12px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.ph-toolbar-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ph-dropdown {
  position: relative;
  min-width: 176px;
}
.ph-dropdown-sources {
  min-width: 320px;
}
.ph-dropdown-trigger {
  width: 100%;
  padding: 11px 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(22,101,52,.16);
  background: linear-gradient(180deg, #ffffff 0%, #f6fcf7 100%);
  box-shadow: 0 12px 26px rgba(22,101,52,.06);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  cursor: pointer;
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease, background .14s ease;
  font-family: inherit;
  text-align: left;
}
.ph-dropdown-trigger:hover,
.ph-dropdown.open .ph-dropdown-trigger {
  border-color: rgba(34,197,94,.34);
  box-shadow: 0 16px 30px rgba(22,101,52,.09);
}
.ph-select-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6a8372;
}
.ph-dropdown-value {
  padding-right: 24px;
  color: #16351f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.ph-dropdown-caret {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid #166534;
  border-bottom: 2px solid #166534;
  transform: translateY(-60%) rotate(45deg);
  transition: transform .16s ease;
  pointer-events: none;
}
.ph-dropdown.open .ph-dropdown-caret {
  transform: translateY(-18%) rotate(-135deg);
}
.ph-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 100%;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(22,101,52,.12);
  background: rgba(255,255,255,.98);
  box-shadow: 0 24px 48px rgba(15,23,42,.16), 0 10px 22px rgba(22,101,52,.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 20;
}
.ph-dropdown-sources .ph-dropdown-menu {
  min-width: 320px;
  max-width: min(380px, calc(100vw - 32px));
}
.ph-dropdown-option {
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, transform .12s ease;
  font-family: inherit;
  text-align: left;
}
.ph-dropdown-option:hover {
  background: #f4faf6;
  color: #16351f;
}
.ph-dropdown-option.active {
  background: linear-gradient(180deg, #ecfdf3 0%, #dcfce7 100%);
  color: #166534;
}
.ph-dropdown-option.active::after {
  content: "\2713";
  font-size: 12px;
  font-weight: 900;
}
.ph-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ph-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  flex-shrink: 0;
}
.ph-chip,
.ph-tool-btn {
  border: 1px solid #dbe4ea;
  background: #fff;
  color: #475569;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all .14s;
  font-family: inherit;
}
.ph-chip:hover,
.ph-tool-btn:hover { background: #f8fafc; color: #1f2937; }
.ph-chip.active {
    background: #ecfdf3;
    border-color: #86efac;
    color: #166534;
  }
.ph-source-menu {
  padding: 10px;
}
.ph-source-menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 10px;
  border-bottom: 1px solid #e8eef3;
  margin-bottom: 8px;
}
.ph-source-menu-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.ph-source-menu-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #64748b;
}
.ph-source-menu-meta {
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}
.ph-source-menu-action {
  border: none;
  background: rgba(22,101,52,.08);
  color: #166534;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
  font-family: inherit;
  white-space: nowrap;
}
.ph-source-menu-action:hover:not(:disabled) {
  background: rgba(22,101,52,.14);
}
.ph-source-menu-action:disabled {
  opacity: .45;
  cursor: default;
}
.ph-source-menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(360px, 55vh);
  overflow-y: auto;
  padding-right: 2px;
}
.ph-source-option {
  width: 100%;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 15px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.ph-source-option:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.ph-source-option.active {
  background: linear-gradient(180deg, #f7fff8 0%, #ecfdf3 100%);
  border-color: rgba(34,197,94,.28);
  box-shadow: 0 10px 22px rgba(34,197,94,.08);
}
.ph-source-option-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ph-source-filter-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ph-source-option-label {
  font-size: 12px;
  font-weight: 800;
  color: #16351f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-source-option-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ph-source-option-state {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
}
.ph-source-option.active .ph-source-option-state {
  color: #166534;
}
.ph-source-option-toggle {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #dbe4ea;
  box-shadow: inset 0 1px 2px rgba(15,23,42,.14);
  transition: background .14s ease;
}
.ph-source-option-toggle.is-on {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}
.ph-source-option-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15,23,42,.18);
  transition: transform .14s ease;
}
.ph-source-option-toggle.is-on .ph-source-option-knob {
  transform: translateX(16px);
}
.ph-tool-btn {
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
  }
.ph-chart-assist {
  padding: 8px 16px;
  font-size: 10px;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

/* Content area */
.ph-content { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; }
.ph-content.ph-content-chart { overflow: hidden; }

/* Table view */
.ph-tbl-section { border-bottom: 1px solid var(--border); }
.ph-tbl-section:last-child { border-bottom: none; }
.ph-tbl-hdr {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 20px 7px; background: #f8fafc;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
.ph-tbl-dot  { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.ph-tbl-name { font-size: 11px; font-weight: 800; color: #343a40; text-transform: uppercase; letter-spacing: .04em; }
.ph-cnt-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-left: auto; flex-shrink: 0; }
table.ph-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.ph-tbl th {
  padding: 7px 16px; text-align: left;
  font-size: 10px; font-weight: 700; color: #868e96; text-transform: uppercase; letter-spacing: .05em;
  background: #fbfcfd; border-bottom: 1px solid var(--border);
}
table.ph-tbl th.r, table.ph-tbl td.r { text-align: right; }
table.ph-tbl td { padding: 8px 16px; border-bottom: 1px solid #f1f5f9; }
table.ph-tbl tr.ph-latest td { background: #f0fdf4; }
table.ph-tbl tr:last-child td { border-bottom: none; }
.ph-date    { color: var(--muted); font-size: 12px; }
.ph-price   { font-weight: 700; }
.ph-price-stack { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.ph-price-line  { font-size: 12px; color: #64748b; }
.ph-price-line strong { color: #111827; font-weight: 800; }
.ph-price-line.is-discount strong { color: #15803d; }
.ph-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}
.ph-type-badge.regular { background: #f1f5f9; color: #475569; }
.ph-type-badge.discounted { background: #dcfce7; color: #166534; }
.ph-now     { font-size: 10px; font-weight: 700; padding: 2px 6px; background: #dcfce7; color: #166534; border-radius: 5px; margin-left: 6px; }
.ph-up      { color: #dc2626; font-size: 11px; font-weight: 700; }
.ph-dn      { color: #16a34a; font-size: 11px; font-weight: 700; }
.ph-neutral { color: var(--muted); font-size: 11px; }
.ph-var-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .02em;
}
.ph-var-high {
    background: #fff7ed;
    border-color: #fdba74;
}
.ph-var-critical {
    background: #fef2f2;
    border-color: #fca5a5;
}
.ph-sortable {
    cursor: pointer;
    user-select: none;
}
.ph-sort-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    color: #94a3b8;
}
.ph-sort-icon.asc,
.ph-sort-icon.desc {
    color: #166534;
}

/* Chart view */
.ph-chart-outer { padding: 12px 14px 14px; }
.ph-chart-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.ph-chart-head-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 240px;
  flex: 1 1 280px;
}
.ph-chart-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
}
.ph-chart-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.03em;
  color: #0f172a;
  line-height: 1.05;
}
.ph-chart-note  {
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
  max-width: 700px;
}
.ph-chart-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  flex: 1 1 420px;
}
.ph-chart-pill {
  min-height: 86px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ph-chart-pill-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
}
.ph-chart-pill-value {
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.ph-chart-pill-meta {
  margin-top: auto;
  font-size: 11px;
  line-height: 1.45;
  color: #475569;
}
.ph-chart-pill-alert {
  background: #fff7ed;
  border-color: #fdba74;
}
.ph-chart-pill-watch {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.ph-chart-pill-good {
  background: #ecfdf3;
  border-color: #86efac;
}
.ph-chart-pill-neutral {
  background: #fff;
}
.ph-legend      {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.ph-leg-item    {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
.ph-leg-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.ph-leg-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.ph-leg-name {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-leg-meta {
  font-size: 11px;
  line-height: 1.35;
  color: #475569;
}
.ph-leg-value {
  font-size: 19px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.ph-leg-note {
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
}
.ph-leg-flag {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(148,163,184,.35);
  color: #334155;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.ph-leg-tone-alert {
  background: #fff7ed;
  border-color: #fdba74;
}
.ph-leg-tone-watch {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.ph-leg-tone-good {
  background: #ecfdf3;
  border-color: #86efac;
}
.ph-leg-tone-neutral {
  background: #f8fafc;
}
.ph-leg-dot     { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ph-chart-wrap  {
  position: relative;
  user-select: none;
  touch-action: none;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 6px;
}
.ph-chart-svg   { width: 100%; height: auto; display: block; }
.ph-chart-wrap.is-grabbing { cursor: grabbing; }
.ph-series-hit  { pointer-events: stroke; cursor: pointer; }
.ph-event-hit   { cursor: pointer; }
#phHoverLayer   { pointer-events: none; }
.ph-chart-overlay {
    position: absolute;
    inset: 0;
    cursor: crosshair;
  }
.ph-pt          { cursor: pointer; transition: r .1s; }
.ph-pt:hover    { r: 6; }
.ph-tip {
  position: fixed;
  color: #16351f;
  font-size: 12px;
  line-height: 1.45;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(34,197,94,.22);
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(240,253,244,.97) 100%);
  pointer-events: none;
  z-index: 99999;
  white-space: normal;
  box-shadow: 0 18px 40px rgba(15,23,42,.14), 0 6px 18px rgba(22,101,52,.10);
  transform: translate(-50%, calc(-100% - 8px));
  min-width: 260px;
  max-width: min(320px, calc(100vw - 24px));
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.ph-tip::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 72px;
  background: radial-gradient(circle at top left, rgba(34,197,94,.18), transparent 70%);
  pointer-events: none;
}
.ph-tip > * {
  position: relative;
  z-index: 1;
}
.ph-tip-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.ph-tip-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(22,101,52,.72);
}
.ph-tip-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ph-tip-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 900;
  color: #16351f;
  letter-spacing: -.02em;
}
.ph-tip-source-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(255,255,255,.86);
}
.ph-tip-chip {
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(22,101,52,.08);
  border: 1px solid rgba(22,101,52,.12);
  color: var(--green-text);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ph-tip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(22,101,52,.08);
}
.ph-tip-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(22,101,52,.72);
}
.ph-tip-value {
  font-size: 12px;
  font-weight: 800;
  color: #16351f;
  text-align: right;
}
.ph-tip-row strong { color: #16351f; }
.ph-tip-meta {
  display: block;
  font-size: 10px;
  color: rgba(15,23,42,.55);
  margin-top: 2px;
}
.ph-tip-discount {
  background: linear-gradient(180deg, rgba(236,253,243,.96) 0%, rgba(220,252,231,.86) 100%);
  border-color: rgba(34,197,94,.22);
}
.ph-tip-discount,
.ph-tip-discount .ph-tip-label,
.ph-tip-discount .ph-tip-value { color: var(--green-text); }
.ph-tip-discount strong,
.ph-tip-discount div:last-child { color: var(--green-text); }
.ph-tip.hidden { display: none; }

@media (max-width: 920px) {
  .ph-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ph-toolbar {
    grid-template-columns: 1fr;
  }

  .ph-toolbar-actions {
    justify-self: start;
  }

  .ph-chart-pills,
  .ph-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .ph-chart-outer {
    padding: 12px;
  }

  .ph-toolbar-filters {
    width: 100%;
    flex-wrap: wrap;
  }

  .ph-dropdown {
    min-width: 0;
    flex: 1 1 180px;
  }

  .ph-dropdown-sources {
    width: 100%;
  }

  .ph-chart-title {
    font-size: 18px;
  }

  .ph-chart-pills,
  .ph-legend {
    grid-template-columns: 1fr;
  }

  .ph-metric {
    min-height: auto;
  }

  .ph-tip {
    min-width: 220px;
    padding: 12px;
  }

  .ph-tip-title-row {
    align-items: flex-start;
  }
}

/* Empty / loading */
.ph-empty   { padding: 40px 24px; text-align: center; color: #868e96; font-size: 13px; line-height: 1.6; }
.ph-loading { padding: 36px 24px; text-align: center; color: #868e96; font-size: 13px; }

/* ═══════════════════════════════════════════════════
   POPUP PRODUTO CONCORRENTE
═══════════════════════════════════════════════════ */
.comp-popup-box {
  width: min(800px, 96vw);
  max-height: 88vh;
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 72px rgba(0,0,0,.22);
  display: flex; flex-direction: column;
  animation: slideUp .15s ease;
  overflow: hidden;
}

.comp-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.comp-popup-store-label {
  font-size: 13px; font-weight: 900;
  color: var(--green-text); letter-spacing: -.1px;
}

.comp-popup-inner {
  display: grid;
  grid-template-columns: 200px 1fr;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.comp-popup-left {
  border-right: 1px solid var(--border);
  background: #f5f9f5;
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  padding: 20px 14px;
  overflow-y: auto;
  flex-shrink: 0;
}

.comp-popup-img-wrap {
  position: relative; width: 140px; height: 140px;
  border-radius: 12px; overflow: hidden;
  background: #fff; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.comp-popup-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; padding: 8px;
}
.comp-popup-img-empty {
  font-size: 36px; opacity: .4; position: absolute;
}

.comp-popup-price {
  text-align: center;
}
.comp-popup-price .price-main {
  font-size: 22px; font-weight: 900; color: var(--green-text);
}
.comp-popup-price .price-old {
  font-size: 12px; color: var(--muted); text-decoration: line-through;
}

.comp-popup-link {
  width: 100%; box-sizing: border-box;
  text-align: center; justify-content: center;
  font-size: 12px; padding: 9px 12px;
}

.comp-popup-score-wrap {
  width: 100%; display: flex; justify-content: center;
}

.comp-popup-right {
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.comp-popup-name {
  font-size: 16px; font-weight: 900; line-height: 1.35;
  color: var(--text); padding: 18px 18px 10px;
  flex-shrink: 0;
}

.comp-popup-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
  flex-shrink: 0;
}
.comp-tab {
  padding: 8px 14px;
  font-family: var(--font); font-size: 12px; font-weight: 700;
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; color: var(--muted);
  transition: color .12s, border-color .12s;
  margin-bottom: -1px;
}
.comp-tab.active { color: var(--green-text); border-bottom-color: var(--green-text); }
.comp-tab:hover:not(.active) { color: var(--text); }

.comp-popup-content {
  flex: 1; overflow-y: auto;
  padding: 16px 18px;
  font-size: 13px; line-height: 1.65; color: var(--text);
  white-space: pre-wrap;
}

.comp-popup-loading {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 16px 0;
}

.comp-loading-spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--green-text);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Tabela de análise IA dentro do popup */
.score-breakdown-table {
  display: flex; flex-direction: column; gap: 6px;
  background: #f8fafc; border-radius: 10px; padding: 12px;
  border: 1px solid var(--border);
}
.score-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
  gap: 8px;
}
.score-row:last-child { border-bottom: none; }
.score-row-label {
  font-size: 12px; color: #475569; flex: 1;
}
.score-row-weight {
  font-size: 10px; color: #94a3b8; margin-left: 4px;
}
.score-row-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 22px;
  border-radius: 11px; font-size: 11px; font-weight: 800;
  flex-shrink: 0;
}
.sbadge-verde    { background:#dcfce7; color:#166534; }
.sbadge-amarelo  { background:#fef9c3; color:#713f12; }
.sbadge-laranja  { background:#ffedd5; color:#9a3412; }
.sbadge-vermelho { background:#fee2e2; color:#991b1b; }
.sbadge-preto    { background:#f3f4f6; color:#374151; }

.no-content-msg {
  color: var(--muted); font-size: 13px;
  text-align: center; padding: 24px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  line-height: 1.6;
}

.comp-desc-para {
  margin: 0 0 10px;
  font-size: 13px; line-height: 1.65; color: var(--text);
}
.comp-desc-para:last-child { margin-bottom: 0; }

/* ═══════════════════════════════════════════════════
   MODAL REJEIÇÃO
═══════════════════════════════════════════════════ */
.reject-box {
  width: min(480px, 96vw);
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,.20);
  animation: slideUp .14s ease;
  overflow: hidden;
}
.reject-body {
  padding: 18px 20px 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.reject-hint {
  font-size: 12px; color: #64748b; line-height: 1.55;
  background: #f8fafc; border-radius: 8px; padding: 10px 12px;
  border: 1px solid var(--border); margin-bottom: 8px;
}
.reject-label {
  font-size: 12px; font-weight: 700; color: #374151;
  display: block; margin-bottom: 4px;
}
.reject-optional {
  font-weight: 500; color: #94a3b8; font-size: 11px;
}
.reject-input, .reject-textarea {
  width: 100%; box-sizing: border-box;
  font-family: var(--font); font-size: 13px;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; outline: none;
  transition: border-color .12s;
  background: #fff; color: var(--text);
}
.reject-input:focus, .reject-textarea:focus { border-color: rgba(239,68,68,.4); }
.reject-textarea { resize: vertical; min-height: 72px; }
.reject-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 12px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.reject-btn-cancel {
  padding: 9px 18px; border-radius: 8px;
  border: 1px solid var(--border); background: rgba(255,255,255,.92);
  font-family: var(--font); font-weight: 700; font-size: 13px;
  cursor: pointer; color: var(--muted); transition: background .10s;
}
.reject-btn-cancel:hover { background: #f1f5f9; }
.reject-btn-confirm {
  padding: 9px 18px; border-radius: 8px;
  border: 1px solid rgba(239,68,68,.3); background: #fee2e2;
  font-family: var(--font); font-weight: 800; font-size: 13px;
  cursor: pointer; color: #991b1b; transition: background .10s;
}
.reject-btn-confirm:hover { background: #fecaca; }

/* Botão de confirmação/adição de concorrente manual — verde */
#manualCompSave {
  background: #22c55e;
  border-color: #16a34a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .12s, border-color .12s, color .12s;
}
#manualCompSave:hover:not(.is-disabled) { background: #16a34a; border-color: #15803d; }
#manualCompSave.is-disabled {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
}
/* Estado "Pesquisar" — azul */
#manualCompSave.mc-btn-search {
  background: #3b82f6;
  border-color: #2563eb;
  color: #fff;
}
#manualCompSave.mc-btn-search:hover:not(.is-disabled) {
  background: #2563eb;
  border-color: #1d4ed8;
}
/* Spinner inline no botão */
.mc-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: rgba(255,255,255,.9);
  border-radius: 50%;
  animation: mc-spin .65s linear infinite;
  flex-shrink: 0;
}
@keyframes mc-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════
   DROPDOWN DE CANDIDATOS (por loja)
═══════════════════════════════════════════════════ */
.candidates-dropdown {
  position: fixed;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,.22);
  z-index: 9998;
  width: 340px;
  /* max-height calculada via JS (--dd-max-h) com o espaço disponível */
  max-height: var(--dd-max-h, 320px);
  /* nunca sai da tela em mobile */
  max-width: calc(100vw - 16px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
/* Abre para baixo: desliza de cima */
.candidates-dropdown:not(.drop-up) { animation: ddDown .14s ease; }
/* Abre para cima: desliza de baixo */
.candidates-dropdown.drop-up       { animation: ddUp .14s ease; }

@keyframes ddDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
@keyframes ddUp   { from { opacity:0; transform:translateY(6px);  } to { opacity:1; transform:translateY(0); } }

.candidates-dropdown.hidden { display: none; }

.candidates-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.candidates-title {
  font-size: 11px; font-weight: 900; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted);
}
.candidates-close {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--muted); padding: 0 4px;
  line-height: 1;
}
.candidates-list {
  overflow-y: auto; padding: 6px;
  display: flex; flex-direction: column; gap: 3px;
}

.candidate-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 9px;
  cursor: pointer; transition: background .10s;
  border: 1px solid transparent;
}
.candidate-item:hover { background: #f1f5f9; border-color: var(--border); }
.candidate-item.active { background: #f0fdf4; border-color: rgba(34,197,94,.3); }

.cand-rank {
  font-size: 10px; font-weight: 900; color: var(--muted);
  width: 16px; text-align: center; flex-shrink: 0;
}
.cand-score-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 20px; border-radius: 10px;
  font-size: 11px; font-weight: 800; flex-shrink: 0;
}
.cand-verde    { background:#dcfce7; color:#166534; }
.cand-amarelo  { background:#fef9c3; color:#713f12; }
.cand-laranja  { background:#ffedd5; color:#9a3412; }
.cand-vermelho { background:#fee2e2; color:#991b1b; }
.cand-preto    { background:#f3f4f6; color:#374151; }
.cand-info { flex: 1; min-width: 0; }
.cand-name {
  font-size: 11px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cand-price {
  font-size: 11px; font-weight: 800; color: var(--green-text); flex-shrink: 0;
}

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: #0f172a; color: rgba(255,255,255,.95);
  padding: 11px 20px; border-radius: 12px;
  font-size: 13px; font-weight: 700; z-index: 99999;
  box-shadow: 0 8px 30px rgba(0,0,0,.28);
  opacity: 0; transition: opacity .18s, transform .18s;
  pointer-events: none; white-space: nowrap;
}
.toast.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════════════
   Sync overlay
═══════════════════════════════════════════════════ */
body.is-syncing #app {
  filter: blur(5px); user-select: none;
  transition: filter .20s;
}
.sync-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(8,15,10,.55);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 22px; backdrop-filter: blur(2px);
  pointer-events: none;
}
.sync-overlay.hidden { display: none; }

.sync-overlay-box {
  width: min(540px, 96vw);
  background: #0b1220; color: #e5e7eb;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px; padding: 18px 18px 16px;
  box-shadow: 0 20px 70px rgba(0,0,0,.50);
  animation: slideUp .16s ease;
  pointer-events: auto;
}
.sync-overlay-title { font-size: 15px; font-weight: 900; letter-spacing: -.2px; }
.sync-overlay-sub   { font-size: 13px; color: rgba(229,231,235,.60); margin-top: 5px; min-height: 18px; }
.sync-progress      { margin-top: 14px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.sync-progress-bar  {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, rgba(34,197,94,.95), rgba(74,222,128,.70));
  transition: width 300ms ease;
  box-shadow: 0 0 12px rgba(34,197,94,.35);
}
.sync-progress-meta {
  display: flex; justify-content: space-between;
  margin-top: 8px; font-size: 12px;
  font-family: var(--mono); color: rgba(229,231,235,.55);
}
.sync-overlay-foot  { margin-top: 12px; border-top: 1px solid rgba(255,255,255,.07); padding-top: 10px; }
.sync-overlay-note  { font-size: 11px; color: rgba(229,231,235,.40); }

/* ═══════════════════════════════════════════════════
   Utilitários
═══════════════════════════════════════════════════ */
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════
   Responsive
═══════════════════════════════════════════════════ */
@media (max-width: 1280px) { .grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }

@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 0;
    transform: translateX(-108%);
    transition: transform .18s ease;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0,0,0,.22);
  }
  .sidebar.open { transform: translateX(0); }
  .modal-inner { grid-template-columns: 260px 1fr; }
}

@media (max-width: 760px) {
  .modal-overlay { padding: 0; align-items: flex-start; }
  .modal-box     { width: 100%; border-radius: 16px 16px 0 0; margin: auto 0 0; }
  .modal-inner   { grid-template-columns: 1fr; }
  .modal-left    { border-right: none; border-bottom: 1px solid var(--border); }
  .offers-grid   { grid-template-columns: 1fr 1fr; }
  .modal-img-wrap { height: 180px; }
  .comp-popup-inner { grid-template-columns: 1fr; overflow-y: auto; }
  .comp-popup-left  { border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; padding: 14px; gap: 12px; }
  .comp-popup-img-wrap { width: 90px; height: 90px; }
}

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .search { max-width: none; width: 100%; order: 2; }
  .offers-header { flex-wrap: wrap; gap: 6px; }
}

@media (max-width: 400px) {
  .grid { grid-template-columns: 1fr; }
  .offers-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════
   v7.0 — Estrela nos cards + preços corrigidos
═══════════════════════════════════════════════════ */

/* ─── Estrela nos cards ─── */
.card { position: relative; }

.card-star {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 2;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.80);
  backdrop-filter: blur(4px);
  cursor: pointer;
  padding: 0;
  transition: background .12s, transform .10s;
  color: #d97706;
}
.card-star svg { width: 14px; height: 14px; }
.card-star:hover { background: rgba(255,255,255,.98); transform: scale(1.12); }
.card-star.is-starred { background: rgba(253,230,138,.90); color: #d97706; }
.card-star.is-starred svg { fill: currentColor; }

/* ─── Preços nos cards: price = principal verde ─── */
.card-price-main {
  font-size: 15px;
  font-weight: 900;
  color: var(--green-text);
}
.card-price-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 1px;
}

/* ─── Preços no modal: price = principal grande verde ─── */
.price-main {
  font-size: 24px;
  font-weight: 900;
  color: var(--green-text);
  line-height: 1.15;
  letter-spacing: -.3px;
}
.price-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 4px;
}

/* Remove estilos antigos conflitantes */
.price-vista, .price-vista-value, .price-vista-badge,
.price-regular-row, .price-regular-label, .price-regular-value,
.price-only { all: unset; }


/* ─── Phase 1 IA — Score de Similaridade ─────────────────────────────────── */

.score-section {
  margin: 8px 0 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: default;
  white-space: nowrap;
}
.score-badge .score-pct { font-size: 13px; }
.score-badge .score-label { font-weight: 500; font-size: 11px; }

.score-verde    { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.score-amarelo  { background: #fef9c3; color: #713f12; border: 1px solid #fde047; }
.score-laranja  { background: #fff7ed; color: #9a3412; border: 1px solid #fdba74; }
.score-vermelho { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.score-preto    { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }

/* Revisão badge */
.revisao-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.revisao-badge.confirmado  { background: #d1fae5; color: #065f46; }
.revisao-badge.rejeitado   { background: #fee2e2; color: #991b1b; }
.revisao-badge.automatico  { background: #e0e7ff; color: #3730a3; }
.revisao-badge.override    { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24; }

/* Card com decisão ativa — borda colorida */
.offer-card.is-confirmed { border: 2px solid #6ee7b7 !important; }
.offer-card.is-override  { border: 2px solid #fbbf24 !important; }

/* Botões de revisão */
.review-buttons {
  display: flex;
  gap: 6px;
  margin: 8px 0 4px;
}

.btn-review {
  flex: 1;
  padding: 5px 0;
  border: none;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .10s;
}
.btn-review:hover  { opacity: .85; transform: scale(1.03); }
.btn-review:active { transform: scale(.97); }

.btn-confirm {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.btn-deny {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.btn-reset {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.btn-reset:hover { background: #e2e8f0; }

/* Modal deny/correção manual */
.deny-box { min-width: 380px; max-width: 500px; }

.deny-error {
  margin-top: 8px;
  padding: 8px 12px;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
}

.deny-scraped {
  margin-top: 8px;
  padding: 8px 12px;
  background: #d1fae5;
  color: #065f46;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
}

/* Pré-visualização do produto no modal deny */
.deny-preview-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 4px;
}
.deny-preview-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}
.deny-preview-no-img {
  width: 72px;
  height: 72px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #f1f5f9;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.deny-preview-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.deny-preview-name-input {
  font-weight: 600;
  margin-bottom: 0;
}
.deny-preview-prices {
  font-size: 12px;
  color: #475569;
  font-weight: 500;
}


/* Toast de feedback */
.natu-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #f8fafc;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
}
.natu-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-success { background: #065f46; }
.toast-warn    { background: #92400e; }
.toast-error   { background: #991b1b; }

/* ═══════════════════════════════════════════════════
   Dashboard de Gestão de Funcionários (admin-only)
═══════════════════════════════════════════════════ */

/* Botão de acesso na sidebar */
.btn-manage-users {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 9px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background .15s, color .15s;
  letter-spacing: .01em;
}
.btn-manage-users:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Overlay de fundo */
.users-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  z-index: 300;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}
.users-panel-overlay.hidden { display: none !important; }

/* Painel lateral direito */
.users-panel {
  width: min(860px, 100vw);
  height: 100vh;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,.18);
  overflow: hidden;
}

/* Header do painel */
.up-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 28px;
  background: linear-gradient(135deg, #0f4c2e 0%, #166534 100%);
  color: #fff;
  flex-shrink: 0;
}
.up-header-title { font-size: 18px; font-weight: 900; flex: 1; letter-spacing: -.2px; }
.up-header-sub   { font-size: 12px; opacity: .7; margin-top: 2px; }
.up-close {
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 8px;
  color: #fff;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: background .15s;
  flex-shrink: 0;
}
.up-close:hover { background: rgba(255,255,255,.25); }

/* Stats bar */
.up-stats {
  display: flex;
  gap: 1px;
  background: #e5e7eb;
  flex-shrink: 0;
}
.up-stat {
  flex: 1;
  padding: 12px 20px;
  background: #f9fafb;
  text-align: center;
}
.up-stat-value { font-size: 22px; font-weight: 900; color: #111827; line-height: 1; }
.up-stat-label { font-size: 11px; color: #6b7280; margin-top: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.up-stat.stat-active   .up-stat-value { color: #065f46; }
.up-stat.stat-inactive .up-stat-value { color: #b91c1c; }

/* Action bar */
.up-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.up-search {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  color: #111827;
  outline: none;
  transition: border-color .15s;
}
.up-search:focus { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.up-btn-new {
  padding: 8px 18px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.up-btn-new:hover { background: #15803d; }

/* Tabela de usuários */
.up-table-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 0 28px 28px;
}
.up-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}
.up-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 8px 12px;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
}
.up-table td {
  padding: 12px 12px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
  font-size: 13px;
  color: #374151;
}
.up-table tr:hover td { background: #f9fafb; }
.up-table tr.row-inactive td { opacity: .55; }

/* Avatar */
.up-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}

/* Role badge */
.up-role {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.up-role-admin    { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24; }
.up-role-operador { background: #e0e7ff; color: #3730a3; border: 1px solid #a5b4fc; }
.up-role-viewer   { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }

/* Status badge */
.up-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}
.up-status-badge.ativo   { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.up-status-badge.inativo { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.up-status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Action buttons */
.up-actions-cell { display: flex; gap: 6px; align-items: center; }
.up-btn-icon {
  width: 30px; height: 30px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: background .12s, border-color .12s;
  flex-shrink: 0;
}
.up-btn-icon:hover          { background: #f3f4f6; border-color: #d1d5db; }
.up-btn-icon.btn-delete:hover  { background: #fee2e2; border-color: #fca5a5; }
.up-btn-icon.btn-activate:hover { background: #dcfce7; border-color: #86efac; }
.up-btn-icon.btn-pwd:hover  { background: #eff6ff; border-color: #93c5fd; }

/* Empty state */
.up-empty {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
}
.up-empty-icon { font-size: 48px; margin-bottom: 12px; }
.up-empty-text { font-size: 14px; }

/* Modal reset senha */
.reset-pwd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reset-pwd-overlay.hidden { display: none !important; }
.reset-pwd-overlay:not(.hidden):not(.is-closing) { animation: fadeIn .16s ease both; }
.reset-pwd-overlay:not(.hidden):not(.is-closing) .reset-pwd-box { animation: popupBoxIn .20s cubic-bezier(.2,.8,.4,1) both; }
.reset-pwd-overlay.is-closing { animation: overlayOut .14s ease both; }
.reset-pwd-overlay.is-closing .reset-pwd-box { animation: popupBoxOut .14s ease both; }
.reset-pwd-box {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  width: min(420px, 90vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
}
.reset-pwd-title {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 4px;
}
.reset-pwd-sub {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 20px;
}
.reset-pwd-field { position: relative; margin-bottom: 12px; }
.reset-pwd-input {
  width: 100%;
  padding: 10px 44px 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #111827;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s;
}
.reset-pwd-input:focus { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.reset-pwd-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 18px;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .12s;
}
.reset-pwd-eye:hover { color: #374151; }
.reset-pwd-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}
.reset-pwd-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}
.reset-btn-cancel {
  padding: 9px 18px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
}
.reset-btn-cancel:hover { background: #f3f4f6; }
.reset-btn-save {
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  background: #16a34a;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s;
}
.reset-btn-save:hover { background: #15803d; }
.reset-btn-save:disabled { opacity: .6; cursor: default; }

/* ── Lista de ingredientes (composição) ─────────────────────────────── */
.ing-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.ing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.ing-row:last-child { border-bottom: none; }
.ing-row:nth-child(even) { background: #f8faf8; }
.ing-row:hover { background: #f0faf2; }

.ing-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  padding-right: 16px;
  line-height: 1.4;
}

.ing-dose {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-text);
  white-space: nowrap;
  background: var(--accent-dim);
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid rgba(34,197,94,.2);
}

.ing-unit {
  font-size: 11px;
  font-weight: 600;
  color: #166534;
  opacity: .8;
}

/* Cabeçalho da tabela de composição (NatuFórmulas) */
.natu-comp-header {
  display: flex;
  justify-content: space-between;
  padding: 6px 14px 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}

/* Observações / excipientes */
.natu-comp-obs {
  margin-top: 10px;
  padding: 8px 12px;
  background: #f8faff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.55;
}

/* Texto de descrição — parágrafo limpo */
.detail-text {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text);
}
.detail-para {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text);
}
.detail-para:last-child { margin-bottom: 0; }

/* Texto de descrição/composição do concorrente */
.comp-text-body {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}

/* ═══════════════════════════════════════════════════
   PRODUCT FORMATTERS (pf-*) — seções estruturadas
   ═══════════════════════════════════════════════════ */
.pf-section {
  margin-bottom: 16px;
}
.pf-section:last-child { margin-bottom: 0; }

.pf-section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--green-text, #166534);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1.5px solid var(--accent-dim, rgba(34,197,94,.12));
}

.pf-benefits {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pf-benefits li {
  position: relative;
  padding: 5px 0 5px 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
.pf-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green-text, #166534);
  font-weight: 700;
  font-size: 12px;
}
.pf-benefits li + li {
  border-top: 1px solid var(--border, #e5e7eb);
}

.pf-obs {
  padding: 8px 12px;
  background: #f8faff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.55;
}

.pf-dose-note {
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 600;
  font-style: italic;
  color: var(--muted, #6b7280);
  border-bottom: 1px solid var(--border, #e5e7eb);
}

/* ── Responsive comp-popup ≤ 600px ──────────────────────────────────── */
@media (max-width: 600px) {
  .comp-popup-box {
    flex-direction: column;
    max-height: 95vh;
  }
  .comp-popup-left {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    padding: 12px;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    border-right: none;
  }
  .comp-popup-img-wrap { width: 80px; height: 80px; flex-shrink: 0; }
  .comp-popup-right { padding: 12px; }
}



/* ═══════════════════════════════════════════════════════════════════════════
/* ═══════════════════════════════════════════════════════════════════════════
   MODAL — layout definitivo sem scroll externo
   ═══════════════════════════════════════════════════════════════════════════ */

/* Texto longo de nomes de produtos não quebra os cards de oferta */
.offer-product-name {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Dropdown de candidatos: scroll interno */
.candidates-dropdown {
  overflow-y: auto;
  max-height: var(--dd-max-h, 320px);
}
.candidates-list {
  overflow-y: auto;
  max-height: calc(var(--dd-max-h, 320px) - 44px);
}

/* Mobile: modal ocupa tela inteira */
@media (max-width: 600px) {
  .modal-box {
    width: 100% !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }
  .modal-inner {
    flex-direction: column !important;
  }
  .modal-left, .modal-right {
    width: 100% !important;
    max-height: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTÕES PDF / AGENDAR — segue tema claro da plataforma
   ═══════════════════════════════════════════════════════════════════════════ */

.content-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.report-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 4px;
}
.report-actions.hidden { display: none !important; }

.btn-report {
  background: #1a5c2a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 6px rgba(26,92,42,.25);
}
.btn-report:hover { background: #154a22; }

.btn-schedule {
  background: #fff;
  color: #444;
  border: 1.5px solid #d0d0d0;
  border-radius: 8px;
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
}
.btn-schedule:hover {
  border-color: #1a5c2a;
  background: #f0faf2;
  color: #1a5c2a;
}

/* ── Dropdown de relatórios gerados ── */
.reports-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #555;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 0 10px;
  transition: color 0.15s;
}
.reports-toggle-btn:hover { color: #1a5c2a; }
.reports-toggle-arrow { font-size: 10px; transition: transform .2s; }
.reports-toggle-arrow.open { transform: rotate(180deg); }

.reports-area {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.reports-area.hidden { display: none !important; }

.reports-area-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}
.reports-area-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #555;
}
.reports-refresh-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  transition: transform .3s, color .15s;
}
.reports-refresh-btn:hover { transform: rotate(180deg); color: #1a5c2a; }

.reports-list {
  padding: 6px 0;
  display: none; /* hidden by default, shown via JS */
}
.reports-list.open { display: block; }

.report-item {
  display: flex;
  align-items: center;
  padding: 9px 16px;
  gap: 10px;
  font-size: 13px;
  border-bottom: 1px solid #f5f5f5;
  transition: background .12s;
}
.report-item:last-child { border-bottom: none; }
.report-item:hover { background: #f9fafb; }
.report-item-icon { font-size: 18px; flex-shrink: 0; }
.report-item-info { flex: 1; min-width: 0; }
.report-item-name {
  font-weight: 600;
  font-size: 12px;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.report-item-meta { font-size: 11px; color: #888; margin-top: 2px; }
.report-type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.report-type-badge.manual { background: #dcfce7; color: #166534; }
.report-type-badge.auto   { background: #dbeafe; color: #1e40af; }
.report-download-btn {
  background: #f0faf2;
  border: 1.5px solid #b6dfbe;
  color: #1a5c2a;
  border-radius: 6px;
  padding: 4px 11px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  transition: background .12s;
}
.report-download-btn:hover { background: #d1f0db; }
.reports-empty {
  padding: 14px 16px;
  font-size: 13px;
  color: #888;
  text-align: center;
}

/* ── PDF Overlay (usando mesma base do sync-overlay, mas verde claro) ── */
#pdfOverlay .sync-overlay-box {
  border-top: 4px solid #1a5c2a;
}
#pdfOverlay .sync-overlay-title {
  color: #1a5c2a;
}

/* ── Modal de agendamento — tema claro ── */
.schedule-box {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  width: min(500px, 95vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.12);
  overflow: hidden;
}
.schedule-body {
  padding: 18px 22px 22px;
}
.schedule-hint {
  font-size: 13px;
  color: #666;
  margin: 0 0 16px;
  line-height: 1.5;
}
.schedule-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.sched-input {
  width: 58px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 700;
  background: #f9f9f9;
  border: 1.5px solid #d0d0d0;
  color: #1a1a1a;
  text-align: center;
}
.sched-input:focus {
  outline: none;
  border-color: #1a5c2a;
  background: #f0faf2;
}
.sched-sep {
  color: #333;
  font-weight: 700;
  font-size: 20px;
}
.sched-label-input {
  flex: 1;
  min-width: 120px;
  padding: 8px 11px;
  border-radius: 7px;
  font-size: 13px;
  background: #f9f9f9;
  border: 1.5px solid #d0d0d0;
  color: #1a1a1a;
}
.sched-label-input:focus {
  outline: none;
  border-color: #1a5c2a;
}
.sched-add-btn {
  background: #1a5c2a;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.sched-add-btn:hover { background: #154a22; }

.schedule-list { display: flex; flex-direction: column; gap: 8px; }

.schedule-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f9f9f9;
  border: 1.5px solid #e5e7eb;
  border-radius: 9px;
  transition: border-color .15s;
}
.schedule-item:hover { border-color: #b6dfbe; }
.sched-time {
  font-size: 20px;
  font-weight: 800;
  color: #1a1a1a;
  font-variant-numeric: tabular-nums;
  min-width: 56px;
}
.sched-item-label { flex: 1; font-size: 12px; color: #666; }
.sched-toggle {
  background: #f0f0f0;
  border: 1.5px solid #d0d0d0;
  border-radius: 6px;
  padding: 4px 11px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: #666;
  transition: all .15s;
}
.sched-toggle.active {
  background: #1a5c2a;
  color: #fff;
  border-color: #1a5c2a;
}
.sched-delete {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 17px;
  padding: 2px 4px;
  line-height: 1;
  transition: color .15s;
}
.sched-delete:hover { color: #dc2626; }

/* ── Toast de aviso de agendamento — tema claro ── */
.report-warning-toast {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 9999;
  background: #fff;
  border: 2px solid #1a5c2a;
  border-radius: 12px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  box-shadow: 0 8px 32px rgba(26,92,42,.18);
  max-width: 290px;
  animation: slideInRight .3s cubic-bezier(.2,.8,.4,1);
}
.report-warning-toast.hidden { display: none !important; }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* Countdown: destaque especial */
.report-warning-toast.warning-counting {
  border-color: #f59e0b;
  box-shadow: 0 8px 32px rgba(245,158,11,.2);
}
.report-warning-toast.warning-counting .report-warning-text strong {
  color: #92400e;
}
.report-warning-toast.warning-1min {
  border-color: #dc2626;
  box-shadow: 0 8px 32px rgba(220,38,38,.2);
}

.report-warning-icon { font-size: 24px; flex-shrink: 0; }
.report-warning-text { flex: 1; min-width: 0; }
.report-warning-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
}
.report-warning-text small {
  font-size: 11px;
  color: #666;
}
.report-warning-countdown {
  font-size: 28px;
  font-weight: 800;
  color: #dc2626;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-width: 48px;
  text-align: center;
}
#reportWarningClose {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  padding: 0 2px;
  transition: color .15s;
}
#reportWarningClose:hover { color: #555; }

/* Estado "relatório sendo gerado" */
.report-warning-toast.warning-generating {
  border-color: #f59e0b;
  box-shadow: 0 8px 32px rgba(245,158,11,.2);
}
.report-warning-toast.warning-generating .report-warning-text strong {
  color: #78350f;
}
.rw-spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(245,158,11,.25);
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: rw-spin .75s linear infinite;
}
@keyframes rw-spin {
  to { transform: rotate(360deg); }
}

/* Estado "relatório gerado" */
.report-warning-toast.warning-done {
  border-color: #16a34a;
  box-shadow: 0 8px 32px rgba(22,163,74,.22);
}
.report-warning-toast.warning-done .report-warning-text strong {
  color: #14532d;
}

/* Notificações de relatórios automáticos na sidebar */
#sidebarReportNotifications { padding:0 4px 4px; display:flex; flex-direction:column; gap:5px; }
.rn-card { display:flex; align-items:center; gap:8px; padding:9px 10px; background:rgba(34,197,94,.10); border:1px solid rgba(34,197,94,.22); border-radius:8px; transition:transform .45s cubic-bezier(.4,0,.2,1), opacity .45s ease; overflow:hidden; }
.rn-card.rn-dismissing { transform:translateX(-110%) scale(0.95); opacity:0; }
.rn-card-icon { font-size:15px; flex-shrink:0; }
.rn-card-body { flex:1; min-width:0; }
.rn-card-title { font-size:11px; font-weight:700; color:rgba(255,255,255,.85); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rn-card-meta { font-size:10px; color:rgba(255,255,255,.42); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rn-card-btn { flex-shrink:0; display:flex; align-items:center; gap:4px; padding:4px 8px; background:rgba(34,197,94,.22); border:none; border-radius:5px; color:#4ade80; font-size:11px; font-weight:600; cursor:pointer; transition:background .15s,color .15s; white-space:nowrap; }
.rn-card-btn:hover { background:rgba(34,197,94,.42); color:#fff; }
.rn-card-close { flex-shrink:0; background:none; border:none; color:rgba(255,255,255,.30); cursor:pointer; font-size:15px; padding:0 0 0 4px; line-height:1; transition:color .15s; }
.rn-card-close:hover { color:rgba(255,255,255,.75); }
@keyframes rn-card-pulse {
  0%, 100% { border-color:rgba(34,197,94,.22); box-shadow:none; }
  50%       { border-color:rgba(34,197,94,.85); box-shadow:0 0 0 2px rgba(34,197,94,.22); }
}
.rn-card.rn-pulsing,
.rn-card.rn-highlight { animation:rn-card-pulse 0.65s ease-in-out 5; }

/* ═══════════════════════════════════════════════════
   Concorrentes Manuais
═══════════════════════════════════════════════════ */

/* Seção appended ao offersGrid — não afeta os 4 cards automáticos */
.manual-comp-section {
  display: contents; /* renderiza os filhos direto no grid, sem container extra */
}

/* Badge "Manual" no topo do card */
.manual-badge {
  display: inline-block;
  background: #6366f1;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  vertical-align: middle;
  margin-right: 4px;
}

.manual-comp-domain {
  font-size: 11px;
  color: var(--muted);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 110px;
  display: inline-block;
}

/* Botões ↺ e ✕ nos cards manuais */
.manual-comp-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
}

.btn-review-sm {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 6px;
}

/* Card "+" para adicionar novo concorrente */
.add-manual-card {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  background: transparent;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  min-height: 120px;
}
.add-manual-card:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.add-manual-content {
  text-align: center;
  color: var(--muted);
  pointer-events: none;
}
.add-manual-icon {
  font-size: 28px;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 6px;
}
.add-manual-label {
  font-size: 12px;
  line-height: 1.4;
}

/* ─── Modal de adição de concorrente manual — duas fases ─── */
.mc-modal-box {
  width: min(640px, 96vw);
  transition: width 0.2s ease;
}
.mc-modal-box.mc-phase1-active {
  width: min(480px, 96vw);
}

.manual-comp-url-row {
  display: block;
  margin-bottom: 0;
}
.manual-comp-url-row .reject-input { margin-bottom: 0; width: 100%; }

/* Fase 2 */
.mc-phase2 { animation: fadeInUp .18s ease; }
.mc-phase2.hidden { display: none; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Layout da edição: imagem + campos */
.mc-edit-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

/* Coluna da imagem */
.mc-img-col {
  width: 120px;
  flex-shrink: 0;
}
.mc-img-wrap {
  width: 100px;
  height: 100px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 6px;
  position: relative;
}
.mc-prev-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}
.mc-prev-img.loaded { display: block; }
.mc-img-placeholder {
  font-size: 28px;
  color: var(--muted);
  position: absolute;
}
.mc-sm-input {
  font-size: 11px !important;
  padding: 4px 8px !important;
  height: 30px !important;
}

/* Coluna principal */
.mc-main-col { flex: 1; min-width: 0; }

/* Labels dos campos */
.mc-field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 3px;
  margin-top: 10px;
}
.mc-field-label:first-child { margin-top: 0; }

/* Linha de preços lado a lado */
.mc-price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mc-price-field .reject-input { margin-bottom: 0; }

/* Blocos expansíveis */
.mc-expandable {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.mc-expand-summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  background: #f8fafb;
  list-style: none;
}
.mc-expand-summary::-webkit-details-marker { display: none; }
.mc-expand-summary::before {
  content: "▸ ";
  font-size: 10px;
}
details[open] .mc-expand-summary::before { content: "▾ "; }
.mc-expandable .reject-input,
.mc-expandable .mc-textarea {
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  margin-bottom: 0;
  resize: vertical;
}
.mc-textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 12px;
}

/* Botão voltar */
.mc-back-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
}
.mc-back-btn:hover { color: var(--text); }

/* ─── Modal: Cadastrar Usuário ───────────────────────────────────── */
.user-create-box {
  width: min(420px, 96vw);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
  padding: 28px 28px 24px;
  position: relative;
  animation: slideUp .15s ease;
  flex-shrink: 0;
  margin: auto;
}
.user-create-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.user-create-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin: 0;
}
.user-create-form { display: flex; flex-direction: column; gap: 14px; }
.uc-row { display: flex; flex-direction: column; gap: 5px; }
.uc-label {
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.uc-hint { font-weight: 400; text-transform: none; color: #9ca3af; font-size: 10px; }
.uc-input {
  padding: 9px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  color: #111;
  background: #fafafa;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.uc-input:focus { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.12); background: #fff; }
.uc-select { cursor: pointer; }
.uc-error {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 12px;
  color: #dc2626;
  font-weight: 600;
}
.uc-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}
.uc-btn-cancel {
  padding: 9px 18px;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #475569;
  font-family: inherit;
}
.uc-btn-cancel:hover { background: #e2e8f0; }
.uc-btn-save {
  padding: 9px 20px;
  background: #0b3b23;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
}
.uc-btn-save:hover:not(:disabled) { background: #0e4a2c; }
.uc-btn-save:disabled { opacity: .6; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════
   Botão Gestão Interna (sidebar admin)
═══════════════════════════════════════════════════ */
.btn-gestao-interna {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 9px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.80);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background .15s, color .15s;
  margin-top: 6px;
}
.btn-gestao-interna:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ═══════════════════════════════════════════════════
   Modal: Gestão Interna — overlay + painel
═══════════════════════════════════════════════════ */
.gestao-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: gestaoOverlayIn .22s ease both;
}
.gestao-overlay.hidden { display: none !important; }
.gestao-overlay.is-closing { animation: gestaoOverlayOut .18s ease both; }

@keyframes gestaoOverlayIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes gestaoOverlayOut { from { opacity: 1; } to { opacity: 0; } }

.gestao-panel {
  background: #fff;
  border-radius: 20px;
  width: min(980px, 96vw);
  max-height: min(88vh, 780px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,.30), 0 0 0 1px rgba(0,0,0,.06);
  animation: gestaoPanelIn .26s cubic-bezier(.34,1.4,.64,1) both;
}
.gestao-overlay.is-closing .gestao-panel {
  animation: gestaoPanelOut .18s ease both;
}

@keyframes gestaoPanelIn  { from { opacity: 0; transform: scale(.93) translateY(18px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes gestaoPanelOut { from { opacity: 1; transform: scale(1) translateY(0); } to { opacity: 0; transform: scale(.96) translateY(8px); } }

/* Header */
.gestao-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 28px;
  background: linear-gradient(135deg, #0a3d20 0%, #166534 60%, #15803d 100%);
  flex-shrink: 0;
}
.gestao-header-icon {
  width: 46px; height: 46px;
  background: rgba(255,255,255,.12);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.gestao-header-text { flex: 1; }
.gestao-title {
  font-size: 19px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.3px;
  margin: 0;
}
.gestao-sub {
  font-size: 12px;
  color: rgba(255,255,255,.60);
  margin-top: 2px;
}
.gestao-close {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 9px;
  color: rgba(255,255,255,.80);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .14s, color .14s;
}
.gestao-close:hover { background: rgba(255,255,255,.22); color: #fff; }

/* Stats */
.gestao-stats {
  display: flex;
  gap: 1px;
  background: #e9ecef;
  flex-shrink: 0;
}
.gestao-stat {
  flex: 1;
  padding: 14px 20px;
  background: #f8f9fa;
  text-align: center;
}
.gestao-stat-val { font-size: 26px; font-weight: 900; color: #212529; line-height: 1; }
.gestao-stat-lbl { font-size: 11px; font-weight: 600; color: #868e96; margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }
.gestao-stat-green .gestao-stat-val { color: #1a7a45; }
.gestao-stat-red   .gestao-stat-val { color: #c0392b; }

/* Toolbar */
.gestao-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
  background: #fff;
}
.gestao-search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.gestao-search-icon {
  position: absolute;
  left: 12px;
  color: #adb5bd;
  pointer-events: none;
  flex-shrink: 0;
}
.gestao-search {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1px solid #dee2e6;
  border-radius: 9px;
  font-size: 13px;
  color: #212529;
  outline: none;
  background: #f8f9fa;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.gestao-search:focus { border-color: #166534; background: #fff; box-shadow: 0 0 0 3px rgba(22,101,52,.12); }
.gestao-btn-new {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: #166534;
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s, transform .1s;
  flex-shrink: 0;
}
.gestao-btn-new:hover  { background: #14532d; }
.gestao-btn-new:active { transform: scale(.97); }

/* Tabela */
.gestao-table-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
}
.gestao-table {
  width: 100%;
  border-collapse: collapse;
}
.gestao-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #868e96;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 10px 16px;
  border-bottom: 2px solid #e9ecef;
  white-space: nowrap;
}
.gestao-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f1f3f5;
  vertical-align: middle;
  font-size: 13px;
  color: #343a40;
}
.gestao-table tbody tr { transition: background .1s; }
.gestao-table tbody tr:hover td { background: #f8f9fa; }
.gestao-table tr.g-row-inactive td { opacity: .5; }
.gestao-table tr.g-row-inactive:hover td { opacity: .7; }

/* Avatar na tabela */
.g-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.g-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Célula nome */
.g-name { font-weight: 700; color: #212529; }
.g-username { font-size: 11px; color: #adb5bd; margin-top: 2px; }

/* Role badge */
.g-role {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.g-role-admin    { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.g-role-operador { background: #e8f0fe; color: #1a56db; border: 1px solid #93c5fd; }


/* Status badge */
.g-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.g-status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.g-status.ativo   { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.g-status.inativo { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Action buttons na tabela */
.g-actions { display: flex; gap: 5px; align-items: center; justify-content: center; }
.g-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  background: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: background .12s, border-color .12s, transform .1s;
}
.g-btn:hover          { background: #f1f3f5; }
.g-btn:active         { transform: scale(.93); }
.g-btn.g-btn-red:hover  { background: #fee2e2; border-color: #fca5a5; }
.g-btn.g-btn-green:hover { background: #d1fae5; border-color: #6ee7b7; }
.g-btn.g-btn-blue:hover  { background: #eff6ff; border-color: #93c5fd; }

/* Empty state */
.gestao-empty {
  padding: 64px 20px;
  text-align: center;
  color: #adb5bd;
}
.gestao-empty-icon { font-size: 52px; margin-bottom: 12px; }
.gestao-empty-text { font-size: 14px; }

/* ═══════════════════════════════════════════════════
   Modal: Redefinir Senha — z-index acima do gestao
═══════════════════════════════════════════════════ */
.reset-pwd-overlay { z-index: 400; }

/* ═══════════════════════════════════════════════════
   Modal: Editor de Foto de Perfil
═══════════════════════════════════════════════════ */
/* ── Avatar Editor Overlay ── */
.avatar-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: gestaoOverlayIn .2s ease both;
}
.avatar-editor-overlay.hidden { display: none !important; }
.avatar-editor-overlay.is-closing { animation: overlayOut .14s ease both; }
.avatar-editor-overlay:not(.hidden):not(.is-closing) .avatar-editor-box { animation: popupBoxIn .22s cubic-bezier(.2,.8,.4,1) both; }
.avatar-editor-overlay.is-closing .avatar-editor-box { animation: popupBoxOut .14s ease both; }
.avatar-editor-box {
  background: #fff;
  border-radius: 20px;
  padding: 26px 28px 24px;
  width: min(680px, 95vw);
  max-height: 96vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,.30);
  animation: gestaoPanelIn .22s cubic-bezier(.34,1.4,.64,1) both;
}

/* Header */
.avatar-editor-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.avatar-editor-title { font-size: 17px; font-weight: 800; color: #212529; }
.avatar-editor-close {
  background: none; border: none; cursor: pointer;
  color: #868e96; padding: 5px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  transition: color .12s, background .12s;
}
.avatar-editor-close:hover { color: #212529; background: #f1f3f5; }

/* Upload zone */
.avatar-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 32px;
  border: 2px dashed #dee2e6;
  border-radius: 16px;
  background: #f8f9fa;
  transition: border-color .18s, background .18s;
  cursor: pointer;
  margin-bottom: 4px;
}
.avatar-upload-zone.drag-over {
  border-color: #166534;
  background: #f0fdf4;
}
.avatar-upload-icon { color: #adb5bd; line-height: 1; }
.avatar-upload-text {
  font-size: 15px;
  font-weight: 600;
  color: #495057;
  margin: 0;
}
.avatar-upload-choose-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border: 1.5px solid #166534;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: #166534;
  cursor: pointer;
  background: #fff;
  transition: background .14s, color .14s;
}
.avatar-upload-choose-btn:hover { background: #166534; color: #fff; }
.avatar-editor-hint {
  font-size: 11px;
  color: #adb5bd;
  text-align: center;
  margin: 0;
}

/* Crop area */
.avatar-crop-wrap { margin-bottom: 4px; }
.avatar-crop-wrap.hidden { display: none; }
.avatar-canvas-container {
  width: min(420px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
}
.avatar-crop-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.avatar-crop-canvas:active { cursor: grabbing; }

/* Zoom slider */
.avatar-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px auto 0;
  width: min(420px, 100%);
}
.avatar-zoom-icon { color: #868e96; flex-shrink: 0; }
.avatar-zoom-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #dee2e6;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}
.avatar-zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #166534;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  cursor: grab;
}
.avatar-zoom-slider::-webkit-slider-thumb:active { cursor: grabbing; }
.avatar-zoom-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #166534;
  border: 2px solid #fff;
  cursor: grab;
}

/* Crop footer */
.avatar-crop-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 14px auto 0;
  width: min(420px, 100%);
}
.avatar-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.avatar-preview-canvas {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2.5px solid #e9ecef;
  display: block;
}
.avatar-preview-label {
  font-size: 10px;
  color: #adb5bd;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.avatar-crop-hint {
  flex: 1;
  font-size: 11px;
  color: #adb5bd;
  margin: 0;
  line-height: 1.5;
}
.avatar-change-photo-btn {
  font-size: 12px;
  font-weight: 600;
  color: #166534;
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid #166534;
  border-radius: 7px;
  white-space: nowrap;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.avatar-change-photo-btn:hover { background: #166534; color: #fff; }

/* Error + actions */
.avatar-editor-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  margin: 14px 0 0;
  text-align: center;
}
.avatar-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}
.avatar-editor-btn-cancel {
  padding: 10px 16px;
  border: 1px solid #dee2e6;
  border-radius: 9px;
  background: #fff;
  color: #495057;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
}
.avatar-editor-btn-cancel:hover { background: #f1f3f5; }
.avatar-editor-btn-remove {
  padding: 10px 16px;
  border: 1px solid #fca5a5;
  border-radius: 9px;
  background: #fff;
  color: #991b1b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
  flex: 1;
}
.avatar-editor-btn-remove:hover { background: #fee2e2; }
.avatar-editor-btn-save {
  padding: 10px 22px;
  border: none;
  border-radius: 9px;
  background: #166534;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s;
}
.avatar-editor-btn-save:hover    { background: #14532d; }
.avatar-editor-btn-save:disabled { opacity: .45; cursor: default; }

/* ═══════════════════════════════════════════════════
   Exibição de preço melhorada
═══════════════════════════════════════════════════ */
.price-original {
  font-size: .82em;
  color: #9ca3af;
  text-decoration: line-through;
  font-weight: 400;
}
.price-main {
  font-weight: 800;
  color: #212529;
}
.price-main.price-promo {
  color: #166534;
}
.price-pix-label {
  font-size: .72em;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #93c5fd;
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
}
.price-badge-discount {
  font-size: .72em;
  font-weight: 700;
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
}
