/* AdOrder Builder — estilo pensado pra funcionar em navegadores mais antigos
   (Windows 7): sem CSS custom properties, sem CSS Grid, sem backdrop-filter.
   Layout com flexbox + position absolute (suportado desde ~2012-2015). */

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f5f7;
  color: #1f2430;
}

h1, h2, h3 { margin: 0 0 0.5rem 0; font-weight: 600; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; color: #444; margin-top: 1.25rem; }

/* Cabeçalho */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a2340;
  color: #fff;
  padding: 0.9rem 1.5rem;
}
.topbar h1 { font-size: 1.15rem; color: #fff; font-weight: 700; }

/* Botões */
.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}
.btn-primario { background: #2563eb; color: #fff; }
.btn-primario:hover { background: #1d4ed8; }
.btn-secundario { background: #f1f2f5; color: #333; border-color: #d7dae1; }
.btn-secundario:hover { background: #e6e8ec; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.4); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); }
.btn-largo { width: 100%; }

/* Layout principal — mockup ocupa a largura toda (precisa de espaço pros
   banners reais, que passam de 1000px de largura), pedidos fica embaixo. */
.layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem 3rem;
}

.card {
  background: #fff;
  border: 1px solid #e2e4ea;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* Abas Home / Matéria */
.tabs { display: flex; gap: 0.4rem; margin-bottom: 0.75rem; }
.tab {
  border: 1px solid #d7dae1;
  background: #f7f8fa;
  color: #444;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
}
.tab-ativa { background: #2563eb; border-color: #2563eb; color: #fff; }

/* Mockup — canvas onde os espaços de anúncio ficam posicionados. Os banners
   reais passam de 1000px de largura, então o wrapper rola na horizontal em
   telas menores em vez de cortar o conteúdo. */
.mockup-scroll { overflow-x: auto; padding-bottom: 0.25rem; }
.mockup {
  position: relative;
  width: 1100px;
  min-height: 200px;
  background: #eef0f4;
  border: 1px solid #d7dae1;
  border-radius: 6px;
}
.mockup-bloco {
  position: absolute;
  background: #e2e5eb;
  border: 1px solid #ccd0d9;
  border-radius: 4px;
}
.mockup-texto-linha {
  position: absolute;
  height: 10px;
  background: #dadde3;
  border-radius: 3px;
}
.ad-space {
  position: absolute;
  background: rgba(37, 99, 235, 0.16);
  border: 2px dashed #2563eb;
  color: #1d4ed8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.72rem;
  padding: 0.2rem;
  line-height: 1.2;
}
.ad-space:hover { background: rgba(37, 99, 235, 0.32); }
.ad-space-pendente {
  position: absolute;
  background: rgba(148, 163, 184, 0.18);
  border: 2px dashed #94a3b8;
  color: #475569;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.72rem;
  padding: 0.2rem;
  line-height: 1.2;
}

.mockup-grid { margin-top: 1rem; max-width: 480px; }

/* Carrinho de itens */
.lista-carrinho { list-style: none; margin: 0.4rem 0 1rem; padding: 0; }
.lista-carrinho li {
  background: #f7f8fa;
  border: 1px solid #e7e9ee;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
}

/* Formulário */
.form-pedido label,
.form-login label,
.modal-caixa label {
  display: block;
  margin: 0.6rem 0 0.2rem;
  font-size: 0.85rem;
  color: #444;
  font-weight: 500;
}
.form-pedido input[type="text"],
.form-login input,
.modal-caixa input,
.modal-caixa select,
.modal-caixa textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d7dae1;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
}
.checkbox-linha { display: flex; align-items: center; gap: 0.4rem; font-size: 0.88rem; }
.form-pedido .btn { margin-top: 1rem; }
.resultado { margin-top: 0.75rem; font-size: 0.88rem; }

.sugestoes ul { list-style: none; margin: 0.25rem 0 0; padding: 0; border: 1px solid #e2e4ea; border-radius: 6px; overflow: hidden; }
.sugestoes li { padding: 0.5rem 0.7rem; cursor: pointer; font-size: 0.88rem; }
.sugestoes li:hover { background: #f0f4ff; }

/* Modal (substitui os antigos prompt() do navegador) */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal-caixa {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}
.modal-botoes { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.25rem; }

/* Filtro de período do relatório de pedidos */
.filtro-periodo {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.filtro-periodo label {
  display: block;
  font-size: 0.8rem;
  color: #444;
  font-weight: 500;
}
.filtro-periodo select {
  display: block;
  margin-top: 0.2rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid #d7dae1;
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
}
.aviso-relatorio {
  font-size: 0.82rem;
  color: #92620a;
  min-height: 1.1em;
  margin-bottom: 0.5rem;
}

/* Dashboard de pedidos */
#secao-erros h3 { margin-top: 1rem; }
.nota-secao { color: #888; font-size: 0.8rem; margin: -0.4rem 0 0.6rem; }
.pedido-card {
  border: 1px solid #e2e4ea;
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.4rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.pedido-card:hover { border-color: #2563eb; }
.pedido-card-linha { color: #555; margin-top: 0.15rem; }
.status-erro { border-color: #dc2626; background: #fef2f2; }
.dashboard-vazio { color: #888; font-size: 0.85rem; padding: 0.4rem 0; }

#detalhe-pedido-gam ul, #detalhe-erro ul { list-style: none; margin: 0.5rem 0; padding: 0; }
#detalhe-pedido-gam li, #detalhe-erro li {
  background: #f7f8fa;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}
#detalhe-pedido-gam li > div, #detalhe-erro li > div { margin-top: 0.2rem; }
#detalhe-pedido-gam button, #detalhe-erro button { margin-left: 0.5rem; margin-top: 0.6rem; }
#secao-erros { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #e2e4ea; }

.aviso {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

/* Página de login */
.pagina-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a2340;
  padding: 1rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.login-caixa { width: 100%; max-width: 340px; }
.login-titulo { text-align: center; }
.login-subtitulo { text-align: center; color: #666; font-size: 0.85rem; margin: 0 0 1.25rem; }
.form-login .btn { margin-top: 1.25rem; }
.erro-login { color: #dc2626; margin-top: 0.6rem; font-size: 0.85rem; min-height: 1em; }

@media (max-width: 700px) {
  .layout { padding: 1rem; }
  .topbar { padding: 0.8rem 1rem; }
}
