.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; white-space: nowrap; background: none; transition: background .12s, border-color .12s, color .12s; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn i { font-size: 16px; }
/* Principal: no tema claro, preto com texto branco (o dourado sobre fundo
   branco fica apagado); no escuro, dourado com texto escuro. */
.btn-primary { background: var(--text); color: var(--surface); border-color: var(--text); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: #000; border-color: #000; }
:root[data-theme="dark"] .btn-primary { background: var(--blue); color: #1A1408; border-color: var(--blue); }
:root[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: var(--blue-mid); border-color: var(--blue-mid); }

/* OK da conferência de estoque (linha pendente, fundo vermelho claro) */
.btn-conferir { background: var(--surface); color: var(--green-text); border-color: var(--green); font-weight: 600; padding: 3px 10px; }
.btn-conferir:hover:not(:disabled) { background: var(--green); color: #fff; }
.conf-ok { display: inline-flex; align-items: center; gap: 2px; }
.conf-desfazer { width: 24px; height: 24px; font-size: 14px; opacity: 0; }
tr:hover .conf-desfazer, .conf-desfazer:focus { opacity: 1; }
@media (hover: none) { .conf-desfazer { opacity: 1; } }
.btn-ghost { background: none; color: var(--text2); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface2); color: var(--text); }
.btn-danger { background: var(--red-mid); color: #fff; border-color: var(--red-mid); }
.btn-danger:hover:not(:disabled) { background: var(--red); border-color: var(--red); }
.btn-success { background: var(--green); color: #fff; border-color: var(--green); }
.btn-success:hover:not(:disabled) { background: var(--green-text); border-color: var(--green-text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 20px; font-size: 15px; font-weight: 600; }
.btn-block { width: 100%; }

/* Botão só-ícone (ações de linha de tabela) */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: none; background: none; border-radius: var(--radius-sm); color: var(--text3); cursor: pointer; font-size: 16px; }
.btn-icon:hover { background: var(--surface3); color: var(--text); }
.btn-icon.danger:hover { background: var(--red-bg); color: var(--red-text); }

/* Grupo de botões segmentado (filtros, unidade, tipo) */
/* Botões colados. As divisórias são o vão de 1px mostrando o fundo (cor da
   borda): se não couber numa linha e quebrar, cada linha se estica até a
   largura toda e as divisórias continuam certas. */
.seg { display: inline-flex; flex-wrap: wrap; gap: 1px; max-width: 100%; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { flex: 1 1 auto; border: none; background: var(--surface); padding: 7px 12px; font-size: 13px; cursor: pointer; color: var(--text2); white-space: nowrap; }
.seg button.active { background: var(--blue-bg); color: var(--blue-text); font-weight: 600; }
.btn-ghost.danger { color: var(--red); }
.btn-ghost.danger:hover { background: var(--red-bg); color: var(--red-text); }
