/* public/css/estilo.css — estilos base reaproveitáveis (topbar, botões,
   badges, tabelas), extraídos do mockup (mockup/index.html) e adaptados
   para uso real nas views EJS do projeto.
   Repaginação: mantém a identidade de marca (navy/teal/coral/orange) já em
   uso — a mudança é de tipografia, profundidade e consistência, não de
   paleta (ver plano de repaginação). */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #1e3a6e;
  --navy-2: #274d8f;
  --teal: #2dbfc4;
  --coral: #e8536b;
  --orange: #f5a742;
  --bg: #eef1f6;
  --border: #dde3ec;
  --text: #1f2937;
  --muted: #6b7280;
  --warn-bg: #fff7e6;

  /* Profundidade (cards/botões saem de borda "chapada" pra sombra suave). */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-md: 0 4px 10px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, .12), 0 4px 10px rgba(15, 23, 42, .06);

  /* Escala de raio — cantos maiores em cards, menores em controles. */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Escala de espaçamento (4/8px), usada nos novos utilitários de formulário. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-2); }

/* ---------- topbar ---------- */
header.topbar {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 20;
}
header.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
header.topbar .brand-dots {
  display: inline-flex;
  gap: 3px;
  font-size: 11px;
  line-height: 1;
}
header.topbar .brand .dot1 { color: var(--coral); }
header.topbar .brand .dot2 { color: var(--teal); }
header.topbar .brand-text {
  display: flex;
  align-items: baseline;
  gap: 9px;
}
header.topbar .brand-name {
  font-weight: 800;
  font-size: 23px;
  letter-spacing: -.02em;
  color: #fff;
}
header.topbar .brand-tagline {
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .01em;
  color: rgba(255, 255, 255, .68);
  padding-left: 9px;
  border-left: 1px solid rgba(255, 255, 255, .28);
}
@media (max-width: 640px) {
  header.topbar .brand-tagline { display: none; }
}

header.topbar .topbar-info {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #cfd9ea;
}

header.topbar .estoque-status {
  white-space: nowrap;
}
header.topbar .estoque-status.sem-dados {
  color: var(--orange);
}

header.topbar .usuario-info {
  white-space: nowrap;
}

/* ---------- botões ---------- */
button.primary, a.btn-primary, .btn-upload,
button.secondary, a.btn-secondary {
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
button.primary, a.btn-primary, .btn-upload {
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: var(--shadow-sm);
}
button.primary, a.btn-primary.navy {
  background: var(--navy);
}
button.primary:hover, a.btn-primary:hover, .btn-upload:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
button.primary:active, a.btn-primary:active, .btn-upload:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}
button.primary:disabled {
  opacity: .65;
  cursor: default;
  transform: none;
  box-shadow: none;
}
button.secondary, a.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--navy);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.secondary:hover, a.btn-secondary:hover {
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}
button.logout-btn {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
button.logout-btn:hover {
  border-color: #fff;
  background: rgba(255,255,255,.08);
}

/* ---------- badges / status ---------- */
.status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-block;
}
.status.ok { background: #e3f7ee; color: #0f7a4d; }
.status.proc { background: #fff2d6; color: #92600a; }
.status.pend { background: #eceff3; color: #6b7280; }

.badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.badge.campanha { background: var(--orange); color: #fff; }
.badge.toque { background: var(--teal); color: #fff; }
.badge.brilha { background: #7c3aed; color: #fff; }
.badge.revisar { background: #fde68a; color: #92400e; }

/* ---------- tabela ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  background: #eef1f7;
  color: var(--navy);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 10px 10px;
  text-align: left;
  border-bottom: 2px solid var(--border);
}
tbody td {
  padding: 9px 10px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f6f8fc; }
/* colunas numéricas (preço, quantidade) não devem "pular" de largura ao trocar de valor */
td.num, th.num, .num { font-variant-numeric: tabular-nums; }

/* ---------- containers gerais ---------- */
main.conteudo {
  flex: 1 1 auto;
  padding: var(--space-6);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.grupo, .card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
  padding: var(--space-4) var(--space-6);
}

h1 { font-size: 20px; letter-spacing: -.01em; color: var(--navy); }

.banner {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-left: 4px solid #4f46e5;
  color: #3730a3;
  font-size: 13px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.erro-msg {
  background: #fdecec;
  border: 1px solid #f6c2c2;
  border-left: 4px solid var(--coral);
  color: #9b1c1c;
  font-size: 13px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

/* Tabelas largas (muitas colunas) não devem estourar a largura da página em
   telas estreitas — o scroll horizontal fica contido dentro da tabela.
   Compartilhada por reposicao.ejs e boards.ejs (grid.css estende esta mesma
   classe lá com cabeçalho fixo, específico daquela tela). */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- tabela de itens de reposição (reposicao.ejs) — sem estilo
   próprio até esta repaginação; item pendente só tinha um badge pequeno,
   sem destaque na linha inteira. ---------- */
.tabela-itens th:nth-child(4),
.tabela-itens th:nth-child(5),
.tabela-itens th:nth-child(6),
.tabela-itens td:nth-child(4),
.tabela-itens td:nth-child(5),
.tabela-itens td:nth-child(6) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tabela-itens tr.linha-pendente td {
  background: var(--warn-bg);
}
.tabela-itens tr.linha-pendente:hover td {
  background: #ffefc7;
}

/* ---------- utilitários de formulário (substituem estilos inline
   repetidos em board_novo.ejs / erp_upload.ejs) ---------- */
.form-field { margin-bottom: var(--space-4); }
.form-row { display: flex; gap: var(--space-4); margin-bottom: var(--space-4); }
.form-row .form-field { flex: 1; margin-bottom: 0; }
.form-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  margin-bottom: 5px;
}
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(45, 191, 196, .18);
}

/* ---------- footer ---------- */
footer.rodape {
  flex: 0 0 auto;
  padding: 14px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: #fff;
}

/* ---------- login ---------- */
.login-shell {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 15%, rgba(45, 191, 196, .10), transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(30, 58, 110, .08), transparent 40%);
}
.login-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
}
.login-box h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--navy);
  margin: 0 0 22px;
  text-align: center;
}
.login-box label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  margin-bottom: 5px;
}
.login-box input[type=text],
.login-box input[type=password] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.login-box input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(45, 191, 196, .18);
}
.login-box button.primary {
  width: 100%;
  padding: 11px;
  font-size: 14px;
}

/* ---- Navegação por abas (nav.abas, abaixo do topbar) ---- */
nav.abas {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  /* Nunca encolher: na tela do board (layout flex de altura cheia) um contêiner
     de rolagem sem isto colapsava a barra de abas até sumir. */
  flex: 0 0 auto;
}
nav.abas .aba {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
nav.abas .aba:hover {
  color: var(--navy);
  background: #f5f7fb;
}
nav.abas .aba.ativa {
  color: var(--navy);
  border-bottom-color: var(--teal);
}
