/* Estoque: Ajustes, Transferências e Relatórios de estoque. Medidas e cores lidas das capturas
   estoque-ajustes, estoque-transferencias e estoque-relatorios (2880x1800, escala 2 de 1440x900).
   Tudo preso a .stock-page para não vazar para outras telas. */

#page-title .stock-icon { width: 24px; height: 24px; fill: currentColor; vertical-align: -4px; }
.stock-icon { width: 16px; height: 16px; fill: currentColor; flex: none; }

.stock-page { font-family: 'Source Sans Pro', system-ui, sans-serif; color: #222529; gap: 16px; }

/* Barra de ferramentas: Adicionar e Mais ações à esquerda; lista, período e busca à direita. */
.stock-list .stock-toolbar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; }
.stock-toolbar-left, .stock-toolbar-right { display: flex; align-items: center; gap: 4px; }
.stock-list .stock-toolbar .button { min-height: 37px; gap: 4px; }
.stock-list .stock-toolbar .button:disabled { cursor: not-allowed; }
.stock-list .stock-toolbar .button.secondary:disabled { color: #9aa1a7; }
.stock-caret::after { content: ''; display: inline-block; margin-left: 6px; border-top: 4px solid currentColor; border-right: 4px solid transparent; border-left: 4px solid transparent; vertical-align: middle; }
.stock-tool { display: inline-grid; place-items: center; width: 42px; min-width: 42px; height: 37px; padding: 0; border: 1px solid #d9dee2; border-radius: 4px; background: #fff; color: #0f1921; cursor: pointer; }
.stock-tool.is-dark { border-color: #0f1921; background: #0f1921; color: #fff; }
.stock-tool .stock-icon { width: 16px; height: 16px; }
.stock-month { width: auto; height: 37px; min-height: 37px; margin: 0; padding: 0 30px 0 13px; border: 1px solid #0f1921; border-radius: 4px; background-color: #0f1921; color: #fff; font: inherit; font-size: 15px; cursor: pointer; }
.stock-search { display: flex; flex-wrap: wrap; flex-basis: 100%; justify-content: flex-end; align-items: center; gap: 4px; }
.stock-search[hidden] { display: none; }
.stock-search input { width: min(300px, 100%); height: 37px; padding: 0 12px; border: 1px solid #cfd4d9; border-radius: 4px; font: inherit; }

/* Aviso amarelo da tela de transferências. */
.stock-alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 8px 16px; border: 1px solid #f3e4a8; border-radius: 4px; background: #fdf6d8; color: #6f5a12; font-size: 13px; }
.stock-alert strong { font-weight: 700; }
.stock-alert-link { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; cursor: not-allowed; }
.stock-alert-close { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; background: none; color: #8a7a3a; cursor: pointer; }
.stock-alert-close .stock-icon { width: 14px; height: 14px; }

/* Lista vazia: ícone redondo, título, texto, botões e cartões. */
.stock-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 26px 26px; border: 1px solid #dfe2e6; border-radius: 6px; background: #fff; text-align: center; }
.stock-empty-icon { display: grid; place-items: center; width: 76px; height: 76px; border: 1px solid #e6e9ec; border-radius: 50%; background: #f4f5f7; color: #0f1b24; }
.stock-empty-icon .stock-icon { width: 30px; height: 30px; }
.stock-empty h2 { margin: 8px 0 0; color: #0f1b24; font-size: 20px; font-weight: 600; }
.stock-empty p { max-width: 520px; margin: 0; color: #6e757c; font-size: 14px; line-height: 1.5; }
.stock-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0 16px; }
.stock-empty-actions .stock-icon { width: 14px; height: 14px; }
.stock-empty-lead { margin-top: -4px; font-size: 11px; color: #6e757c; }
.stock-empty-cards { display: grid; gap: 10px; width: 100%; }
.stock-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stock-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stock-empty-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid #dfe2e6; border-radius: 6px; text-align: left; }
.stock-empty-card strong { display: block; color: #0f1b24; font-size: 14px; font-weight: 600; line-height: 1.4; }
.stock-empty-card small { display: block; margin-top: 4px; color: #6e757c; font-size: 11px; line-height: 1.6; }
.stock-empty-card-icon { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 6px; }
.stock-empty-card-icon .stock-icon { width: 16px; height: 16px; }
.stock-empty-card-icon.violet { background: #efeafd; color: #6c3fd1; }
.stock-empty-card-icon.blue { background: #e6f0fb; color: #1f6fc5; }
.stock-empty-card-icon.green { background: #e3f6ec; color: #1e8a50; }
.stock-empty-period { padding-top: 32px; }

.stock-qty { text-align: right; font-variant-numeric: tabular-nums; }

/* Relatórios de estoque: grade de três cartões. */
.stock-report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stock-report-card { display: flex; align-items: flex-start; gap: 12px; min-height: 80px; padding: 13px 15px; border: 1px solid #dfe2e6; border-radius: 6px; background: #fff; color: #0f1b24; text-decoration: none; }
a.stock-report-card:hover { border-color: #b9c0c7; box-shadow: 0 1px 4px rgba(15, 27, 36, .08); }
.stock-report-card.is-pending { cursor: not-allowed; }
.stock-report-icon { display: grid; flex: none; place-items: center; width: 36px; height: 36px; margin-top: 3px; border-radius: 50%; background: #f1f3f5; color: #0f1b24; }
.stock-report-icon .stock-icon { width: 16px; height: 16px; }
.stock-report-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stock-report-body strong { font-size: 14px; font-weight: 600; line-height: 1.3; }
.stock-report-text { color: #6e757c; font-size: 12px; line-height: 1.5; }
.stock-report-open { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; color: #0f1b24; font-size: 12px; font-weight: 600; }
.stock-report-open .stock-icon { width: 10px; height: 10px; }

@media (max-width: 900px) {
  .stock-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .stock-report-grid, .stock-cols-3, .stock-cols-4 { grid-template-columns: 1fr; }
  .stock-empty { padding: 28px 14px 18px; }
}

/* ---- Rodada 2: formulários de ajuste e transferência (capturas ..._estoques-adicionar). ---- */
.stock-form-page { gap: 12px; }
.stock-form { display: flex; flex-direction: column; gap: 12px; }
.stock-form-card { border: 1px solid #dfe2e6; border-radius: 6px; background: #fff; overflow: hidden; }
.stock-form-card-head { padding: 14px 16px 12px; border-bottom: 1px solid #dfe2e6; background: #f6f7f8; }
.stock-form-card-head h2 { display: flex; align-items: center; gap: 6px; margin: 0; color: #222529; font-size: 17px; font-weight: 400; }
.stock-form-card-head h2 strong { font-weight: 700; }
.stock-form-card-head h2 .stock-icon { width: 15px; height: 15px; color: #4a5056; }
.stock-form-card-head p { margin: 4px 0 0; color: #6e757c; font-size: 11px; }
.stock-form-card-body { padding: 16px; }
.stock-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.stock-form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stock-form-wide { grid-column: 1 / -1; }
.stock-form-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: #6e757c; font-size: 12px; }
.stock-form-field small { color: #8a9096; font-size: 10px; }
.stock-required { color: #d9363e; }
.stock-form select, .stock-form textarea, .stock-form input[type='text'], .stock-form input[type='number'], .stock-advanced select {
  width: 100%; min-height: 37px; padding: 6px 12px; border: 1px solid #cfd4d9; border-radius: 4px; background: #fff; color: #222529; font: inherit; font-size: 14px;
}
.stock-form textarea { min-height: 86px; resize: vertical; }
.stock-form select:disabled, .stock-advanced select:disabled { background: #eceef0; color: #7b8288; cursor: not-allowed; }
.stock-money { display: flex; align-items: stretch; }
.stock-money-prefix { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid #cfd4d9; border-right: 0; border-radius: 4px 0 0 4px; background: #f4f5f7; color: #4a5056; font-size: 13px; }
.stock-money input { border-radius: 0 4px 4px 0 !important; text-align: right; }
.stock-money input:disabled { background: #e8eaed; color: #4a5056; }
.stock-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stock-form-blocked { display: block; color: #8a6d1d; font-size: 12px; }
.stock-form-note { margin: 0; padding: 12px 16px; color: #6e757c; font-size: 13px; }
.stock-lines { display: flex; flex-direction: column; gap: 8px; }
.stock-line { display: grid; grid-template-columns: minmax(0, 1fr) 140px 42px; gap: 8px; align-items: center; }

/* ---- Rodada 2: relatórios de estoque (capturas ..._relatorio_estoque_produtos e inventário). ---- */
.stock-report-page .stock-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.stock-report-page .stock-toolbar .button { min-height: 37px; gap: 6px; }
.stock-report-page .stock-toolbar .button.secondary { background: #fff; border: 1px solid #d9dee2; color: #3b4147; }
.stock-report-page .stock-toolbar .button.accent { background: #0f1921; border-color: #0f1921; color: #fff; }
.stock-popover-anchor { position: relative; display: inline-block; }
.stock-popover { position: absolute; z-index: 20; top: 42px; left: 0; display: flex; flex-direction: column; gap: 6px; min-width: 200px; padding: 10px 12px; border: 1px solid #dfe2e6; border-radius: 6px; background: #fff; box-shadow: 0 4px 14px rgba(15, 27, 36, .12); font-size: 13px; }
.stock-popover[hidden], .stock-advanced[hidden] { display: none; }
.stock-advanced { padding: 12px 16px; border: 1px solid #dfe2e6; border-radius: 6px; background: #fff; }
.stock-advanced .stock-form-actions { justify-content: flex-end; margin-top: 12px; }
.stock-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stock-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1px solid #dfe2e6; border-radius: 6px; background: #fff; }
.stock-stat-head { display: flex; align-items: center; gap: 10px; color: #3b4147; font-size: 12px; font-weight: 600; }
.stock-stat-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 4px; background: #eceef0; color: #0f1921; }
.stock-stat-icon .stock-icon { width: 14px; height: 14px; }
.stock-stat strong { margin-top: 10px; color: #0f1b24; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stock-stat small { color: #6e757c; font-size: 11px; }
.stock-report-panel { border: 1px solid #dfe2e6; border-radius: 6px; background: #fff; overflow: hidden; }
.stock-report-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #dfe2e6; background: #f6f7f8; }
.stock-report-panel h2 { margin: 0; color: #222529; font-size: 16px; font-weight: 600; }
.stock-report-panel p { margin: 2px 0 0; color: #6e757c; font-size: 11px; }
.stock-report-count { color: #6e757c; font-size: 12px; }
.stock-report-table th { font-size: 12px; font-weight: 600; }
.stock-report-table tbody tr:nth-child(even) { background: #f6f7f8; }
.stock-report-table td { font-size: 12px; }
.stock-report-table th.stock-qty, .stock-report-table td.stock-qty { text-align: right; white-space: nowrap; }

@media (max-width: 900px) {
  .stock-form-grid, .stock-form-grid-4, .stock-stats { grid-template-columns: 1fr; gap: 12px; }
  .stock-line { grid-template-columns: minmax(0, 1fr) 100px 42px; }
}

/* Seletor de mês em forma de botão com lista (como o original) */
.stock-month-dropdown { position: relative; display: inline-block; }
.stock-month-dropdown .stock-month { display: inline-flex; align-items: center; padding-right: 13px; }
.stock-month-menu {
  position: absolute; z-index: 20; top: calc(100% + 2px); right: 0; min-width: 100%; max-height: 320px; overflow-y: auto;
  margin: 0; padding: 4px 0; list-style: none; border: 1px solid #d9dee2; border-radius: 4px; background: #fff;
  box-shadow: 0 6px 16px rgba(15, 25, 33, .14);
}
.stock-month-menu[hidden] { display: none; }
.stock-month-menu button {
  display: block; width: 100%; padding: 6px 14px; border: 0; background: transparent; color: #222529;
  font: inherit; font-size: 14px; text-align: left; white-space: nowrap; cursor: pointer;
}
.stock-month-menu button:hover, .stock-month-menu button.is-active { background: #eef0f2; }

/* Mais ações como o do original: lista com ícone e linha entre os itens; "Zerar estoque" em vermelho */
.stock-more { position: relative; display: inline-block; }
.stock-more-menu {
  position: absolute; z-index: 20; top: calc(100% + 3px); left: 0; min-width: 100%; margin: 0; padding: 0; list-style: none;
  border: 1px solid #d9dee2; border-radius: 4px; background: #fff; box-shadow: 0 4px 12px rgba(15, 25, 33, .14);
}
.stock-more-menu[hidden] { display: none; }
.stock-more-menu li + li { border-top: 1px solid #e6e9ec; }
.stock-more-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 14px 6px 12px; border: 0; background: transparent;
  color: #222529; font: inherit; font-size: 14px; text-align: left; white-space: nowrap; cursor: pointer;
}
.stock-more-item .stock-icon { width: 16px; height: 16px; flex: none; fill: currentColor; }
.stock-more-item:hover:not(:disabled) { background: #eef0f2; }
.stock-more-item:disabled { cursor: not-allowed; opacity: .65; }
.stock-more-item.is-danger, .stock-more-item.is-danger .stock-icon { color: #dc3545; }
