/* shared.css — estilos base compartilhados entre páginas */

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

body {
  font-family: Arial, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
}

/* ── NAV ─────────────────────────────────────────────── */
nav {
  background: #1e293b;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #334155;
}
.brand { font-size: 16px; font-weight: 700; color: #38bdf8; }
.nav-user { margin-left: auto; font-size: 13px; color: #64748b; }

/* ── FORM CONTROLS ───────────────────────────────────── */
input, select, textarea {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #38bdf8; }

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  padding: 8px 14px;
  font-weight: 600;
  font-family: inherit;
}

/* ── BUTTONS ─────────────────────────────────────────── */
.btn-nav     { background: #0ea5e9; color: #fff; padding: 7px 14px; }
.btn-primary { background: #0ea5e9; color: #fff; }
.btn-primary:hover { background: #0284c7; }
.btn-ok, .btn-green { background: #14532d; color: #4ade80; }
.btn-ok:hover, .btn-green:hover { background: #166534; }
.btn-danger  { background: #7f1d1d; color: #fca5a5; }
.btn-danger:hover { background: #991b1b; }
.btn-ghost   { background: #334155; color: #94a3b8; }
.btn-ghost:hover { background: #475569; }
.btn-warn    { background: #431407; color: #f97316; }
.btn-warn:hover { background: #7c2d12; }
.btn-sm      { padding: 4px 10px; font-size: 12px; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── BADGES ──────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.b-pendente  { background: #1e3a5f; color: #60a5fa; }
.b-aprovado  { background: #14532d; color: #4ade80; }
.b-expirado  { background: #450a0a; color: #f87171; }
.b-rejeitado { background: #1e293b; color: #94a3b8; }
.b-inativo   { background: #1e293b; color: #64748b; }

/* ── MENSAGENS ───────────────────────────────────────── */
.msg {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}
.msg-ok  { background: #14532d; color: #4ade80; }
.msg-err { background: #450a0a; color: #f87171; }

/* ── MODAL ───────────────────────────────────────────── */
.overlay, .modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.overlay.open, .modal-bg.open { display: flex; }
.modal {
  background: #1e293b;
  border-radius: 10px;
  padding: 24px;
  width: 460px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }

/* ── FILTROS PADRONIZADOS (Loja + Status) ─────────────── */
.filtros-padrao {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  background: #1e293b; padding: 12px 16px; border-radius: 8px;
  margin-bottom: 14px; border: 1px solid #334155;
}
.filtros-padrao label {
  font-size: 10px; color: #94a3b8;
  display: flex; flex-direction: column; gap: 4px;
  text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
}
.filtros-padrao select {
  min-width: 160px; font-size: 13px; padding: 7px 10px;
  text-transform: none; font-weight: 400; letter-spacing: 0;
  color: #e2e8f0; background: #0f172a; border: 1px solid #334155;
}
.filtros-padrao .filtro-loja-fixa {
  font-size: 13px; color: #38bdf8; font-weight: 700;
  padding: 8px 12px; background: #0c2340; border-radius: 6px;
  border: 1px solid #1d4ed8;
}
@media (max-width: 768px) {
  .filtros-padrao { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
  .filtros-padrao select { width: 100%; }
  .filtros-padrao .filtro-loja-fixa { text-align: center; }
}

/* ── TABELA PADRÃO ───────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th {
  background: #0f172a;
  padding: 8px 10px;
  text-align: left;
  color: #64748b;
  font-weight: 600;
  border-bottom: 1px solid #334155;
  white-space: nowrap;
}
tbody td { padding: 7px 10px; border-bottom: 1px solid #1a2744; vertical-align: middle; }
/* impressão: o cabeçalho do tema escuro (bg #0f172a) fica ilegível quando "gráficos de segundo plano"
   está ligado (texto preto sobre fundo escuro). Força fundo claro + texto preto em qualquer PDF. */
@media print { thead th { background: #eaeef3 !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ── Kardex: demonstrativo de entrada por dia (clique na coluna Entrada) ─ */
.kx-ent-link { cursor: pointer; color: #7dd3fc; border-bottom: 1px dashed #38bdf8; font-weight: 700; }
.kx-ent-link:hover { color: #e0f2fe; }
.kx-ent-link.kx-ent-open { color: #fde68a; border-bottom-color: #fde68a; }
.kx-ent-row > td { background: #0b1830; }
.kx-ent-box { padding: 10px 14px; }
.kx-ent-title { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; margin-bottom: 8px; font-weight: 700; }
table.kx-ent-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
table.kx-ent-tbl th { position: static; background: #102a44; color: #94a3b8; font-weight: 600; padding: 6px 9px; text-align: left; white-space: nowrap; border-bottom: 1px solid #334155; }
table.kx-ent-tbl td { padding: 6px 9px; border-bottom: 1px solid #15233a; font-variant-numeric: tabular-nums; vertical-align: middle; }
table.kx-ent-tbl tfoot td { font-weight: 700; background: #102136; border-top: 1px solid #334155; }
