/* ===== Estoque de acabados e semiacabados (13/11/2026, módulo 1): a aba Estoque e as janelas =====
   Ver public/js/estoque.js. */
.est-pagina { display: flex; flex-direction: column; gap: 14px; }
.est-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.est-filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.est-grupo { display: inline-flex; border: 1px solid var(--border-color); border-radius: var(--r-full); overflow: hidden; }
.est-chip {
  min-height: 34px; padding: 0 14px; background: transparent; color: var(--text-secondary); border: none;
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.est-chip + .est-chip { border-left: 1px solid var(--border-color); }
.est-chip.ativo { background: var(--brand-yellow); color: #111; }
#est-busca { min-width: 240px; height: 34px; padding: 0 12px; background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: var(--r-sm); }
.est-botoes { display: flex; flex-wrap: wrap; gap: 6px; }
.est-totais { display: flex; flex-wrap: wrap; gap: 8px; }
.est-total {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 8px 12px; border-radius: var(--r-md);
  background: var(--bg-card); border: 1px solid var(--border-color); font-size: 0.8rem; color: var(--text-secondary);
}
.est-total > b { color: var(--text-primary); text-transform: capitalize; }
.est-total span b { color: var(--text-primary); }
.est-total.vazio { color: var(--text-muted); }
.est-secao { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md); padding: 10px 12px; }
.est-secao.destaque { border-color: rgba(245, 158, 11, 0.45); }
.est-secao h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 0.9rem; color: var(--text-primary); }
.est-secao h3 .material-icons-round { font-size: 18px; color: var(--brand-yellow); }
.est-tabela-rolagem { overflow-x: auto; }
.est-tabela { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.est-tabela th, .est-tabela td { padding: 6px 8px; border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: top; color: var(--text-secondary); }
.est-tabela th { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.est-tabela td b { color: var(--text-primary); }
.est-tabela .num { text-align: right; white-space: nowrap; }
.est-tabela.interna { background: var(--bg-tertiary); border-radius: var(--r-sm); }
.est-lotes > td { padding: 0 8px 8px 30px; }
.est-sub { font-size: 0.72rem; color: var(--text-muted); }
.est-vazio { color: var(--text-muted); font-size: 0.8rem; }
.est-tag { display: inline-block; margin: 0 4px 2px 0; padding: 1px 7px; border-radius: var(--r-full); font-size: 0.68rem; font-weight: 700; background: var(--bg-tertiary); color: var(--text-secondary); }
.est-tag.semiacabado { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.est-tag.acabado { background: rgba(34, 197, 94, 0.14); color: #16a34a; }
.est-tag.cliente { background: rgba(8, 145, 178, 0.14); color: #0891b2; }
.est-omie { font-weight: 700; color: var(--text-primary); }
.est-pendente { color: var(--color-warning); font-weight: 600; font-size: 0.74rem; }
/* O vínculo com o Omie é só referência nesta fase: aparece em toda linha, então fica em tom neutro */
.est-pendente.est-vinculo { color: var(--text-muted); font-weight: 500; }
.est-estado { display: inline-block; padding: 1px 7px; border-radius: var(--r-full); font-size: 0.68rem; font-weight: 700; background: var(--bg-tertiary); }
.est-estado.aguardando { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.est-estado.confirmado { background: rgba(34, 197, 94, 0.14); color: #16a34a; }
.est-estado.devolvido { background: rgba(239, 68, 68, 0.12); color: var(--color-danger); }
.est-estado.cancelado { color: var(--text-muted); }
.est-acoes, .est-acoes-lote { white-space: nowrap; }
.est-acoes .btn, .est-acoes .btn-link, .est-acoes-lote .btn-link { margin-left: 6px; }
.btn-link { background: none; border: none; padding: 0; color: var(--brand-yellow); font-size: 0.76rem; font-weight: 600; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.est-abrir { vertical-align: middle; margin-right: 2px; color: var(--text-muted); }
.est-abrir .material-icons-round { font-size: 18px; }
.est-janela { display: flex; flex-direction: column; gap: 10px; }
.est-explica { font-size: 0.8rem; color: var(--text-secondary); margin: 0; }
.est-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.est-grade .form-group { margin: 0; min-width: 0; }
.est-grade input, .est-grade select { width: 100%; }
@media (max-width: 560px) { .est-grade { grid-template-columns: 1fr; } #est-busca { min-width: 0; width: 100%; } }
.est-check { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; cursor: pointer; }
.est-check input { width: 18px; height: 18px; }
.est-janela h4 { margin: 6px 0 0; font-size: 0.82rem; color: var(--text-primary); }
.detail-section.est-na-os { border-color: rgba(139, 92, 246, 0.35); }
.detail-section.est-na-os .detail-section-title { color: #8b5cf6; }
.est-movs-os { margin: 6px 0 0; padding-left: 18px; font-size: 0.76rem; color: var(--text-secondary); }
/* O destino no fim da Embalagem: uma linha com a caixa; os campos só abrem para quem manda parte ao estoque */
.est-destino { padding: 10px 12px; margin-bottom: 12px; border-radius: var(--r-sm); background: var(--bg-tertiary); }
.est-destino-chave { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.85rem; color: var(--text-secondary); }
.est-destino-chave input { width: 18px; height: 18px; accent-color: #8b5cf6; }
.est-destino-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 10px; }
.est-destino-campos[hidden] { display: none; }
.est-destino-campos .form-group { margin: 0; min-width: 0; }
.est-destino-campos input { width: 100%; }
.est-destino-campos small { grid-column: 1 / -1; font-size: 0.72rem; color: var(--text-muted); }
.action-btn.btn-estoque { background: rgba(139, 92, 246, 0.10); color: #8b5cf6; border-color: rgba(139, 92, 246, 0.35); }

/* Tema claro: o amarelo da marca fica fraco como texto no fundo branco */
[data-theme="light"] .btn-link { color: #a16207; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .btn-link { color: #a16207; } }
td > .btn-link { margin-left: 6px; }
