/* Estoque: tabela que cabe na tela (sem rolagem para o lado) e exclusão de material */
.stk-tabela { width: 100%; table-layout: auto; }
.stk-tabela td { padding-left: 12px; padding-right: 12px; }
.stk-tabela th { padding-left: 12px; padding-right: 12px; }
.stk-tabela td.stk-col-mat { width: 100%; min-width: 220px; }
.stk-tabela .stk-col-sel { width: 1%; padding-right: 0; }
.stk-col-sel input { width: 16px; height: 16px; cursor: pointer; vertical-align: middle; }
.stk-tabela tbody tr.sel td { background: var(--accent-soft); }

/* barra das ações em lote: fica presa embaixo enquanto rola a lista */
.stk-selbar {
  position: sticky; bottom: 14px; z-index: 5; margin-top: 12px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: var(--radius-lg, 12px);
  background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow-lg);
}
.stk-selbar[hidden] { display: none; }
.stk-selbar .grow { flex: 1; }
.stk-selbar .btn { white-space: nowrap; }
.stk-selbar-n { font-size: 13px; font-weight: 600; }
.stk-ex-total { margin-top: 12px; font-size: 13px; color: var(--text-secondary); }
.stk-ex-nome input { margin: 0 6px 0 0; vertical-align: -2px; }
label.stk-ex-item { cursor: pointer; }
.stk-tabela .stk-mat > div { min-width: 0; }
.stk-tabela .stk-nome { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.stk-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 3px; }
.stk-sub .stk-cat { height: 19px; font-size: 11px; padding: 0 7px; }
.stk-tabela td.num, .stk-tabela th.num, .stk-col-status { white-space: nowrap; }
.stk-min { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.stk-col-acoes { width: 1%; white-space: nowrap; }
.stk-tabela .row-acoes { justify-content: flex-end; }

/* telas médias: o custo unitário sai (o valor em estoque continua) */
@media (max-width: 1280px) { .stk-col-custo { display: none; } }
/* telas pequenas: o status já aparece pela cor do saldo */
@media (max-width: 1024px) { .stk-col-status { display: none; } }
/* celular: cada material vira um cartão (nome em cima; saldo, valor e ações embaixo) */
@media (max-width: 640px) {
  .stk-tabela, .stk-tabela tbody { display: block; width: 100%; }
  .stk-tabela thead { display: none; }
  .stk-tabela tbody tr:not(.tr-vazio) {
    position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px;
    padding: 12px 14px; border-bottom: 1px solid var(--border-soft, var(--border));
  }
  .stk-tabela tbody tr.sel { background: var(--accent-soft); }
  .stk-tabela tbody tr.sel td { background: transparent; }
  .stk-tabela tbody tr:last-child { border-bottom: 0; }
  .stk-tabela tbody tr:not(.tr-vazio) td { display: block; height: auto; padding: 0; border: 0; min-width: 0; width: auto; }
  .stk-tabela tbody tr:not(.tr-vazio) td.stk-col-sel { position: absolute; top: 12px; right: 14px; }
  .stk-tabela td.stk-col-mat { grid-column: 1 / -1; padding-right: 30px; }
  .stk-selbar { bottom: 8px; }
  .stk-selbar .grow { display: none; }
  .stk-tabela .stk-ava { display: none; }
  .stk-tabela td.stk-col-saldo { text-align: left; }
  .stk-tabela td.stk-col-saldo .stk-bar { margin-left: 0; }
  .stk-tabela td.stk-col-valor { text-align: right; }
  .stk-tabela tbody tr td.stk-col-custo { display: none; }
  .stk-tabela tbody tr td.stk-col-status { display: block; }
  .stk-tabela td.stk-col-acoes { justify-self: end; }
  .stk-tabela .row-acoes { opacity: 1; justify-content: flex-end; }
  .stk-tabela tr.tr-vazio, .stk-tabela tr.tr-vazio td { display: block; }
}

/* modal de exclusão */
.stk-ex-mat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; }
.stk-ex-mat > div { display: flex; flex-direction: column; min-width: 0; }
.stk-ex-mat b { font-size: 14px; overflow-wrap: anywhere; }
.stk-ex-mat span { font-size: 12.5px; color: var(--text-muted); }
.stk-ex-opcoes { display: grid; gap: 8px; margin-bottom: 16px; }
.stk-ex-op { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: border-color var(--dur, .15s), background var(--dur, .15s); }
.stk-ex-op[hidden] { display: none; }
.stk-ex-op:hover { border-color: var(--border-strong); }
.stk-ex-op:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.stk-ex-op input { margin-top: 3px; }
.stk-ex-op div { display: flex; flex-direction: column; gap: 2px; }
.stk-ex-op b { font-size: 13.5px; }
.stk-ex-op span { font-size: 12.5px; color: var(--text-muted); }
.stk-ex-rot { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.stk-ex-lista { margin-top: 8px; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.stk-ex-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 12px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); color: inherit; font: inherit; cursor: pointer; }
.stk-ex-item:last-child { border-bottom: 0; }
.stk-ex-item:hover { background: var(--surface-2); }
.stk-ex-item.sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.stk-ex-nome { display: flex; flex-direction: column; min-width: 0; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.stk-ex-nome small { font-size: 11.5px; color: var(--text-muted); font-weight: 400; }
.stk-ex-saldo { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stk-ex-vazio { padding: 14px; font-size: 12.5px; color: var(--text-muted); text-align: center; }
