/* Controles de estoque seguem as cores e proporções do tema atual em app.css. */
.estoque-ui .btn {
    min-height: 38px !important;
    padding: .45rem .85rem;
    font-size: .9rem !important;
    line-height: 1.35;
    font-weight: 500;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    white-space: nowrap;
}
.estoque-ui .btn i { flex-shrink: 0; line-height: 1; }
.estoque-ui .btn.estoque-icon-button,
.estoque-ui .stock-actions .btn,
.estoque-ui .saida-actions .btn,
.estoque-ui .maleta-action,
.estoque-ui .req-stock-action {
    width: 38px !important; min-width: 38px !important; height: 38px !important; padding: 0 !important; flex: 0 0 38px;
}
.estoque-ui .modal-footer { display: flex; flex-wrap: wrap; gap: .5rem; }
.estoque-ui .modal-footer > .btn { width: 160px; flex: 0 0 160px; }
.estoque-ui .gestao-page-actions > .btn { width: 160px; }
.estoque-ui[hidden] { display: none !important; }
.estoque-ui .card-footer { background: var(--bg-white, #fff); }
.estoque-ui .card-header, .estoque-ui .modal-header {
    background: var(--bg-white, #fff) !important;
    color: var(--text, #1f2937) !important;
    border-color: var(--border, #e5e7eb);
}
.estoque-ui table tbody, .estoque-ui .stock-mobile-card { font-size: .9rem !important; }
.estoque-ui .estoque-table thead th, .estoque-ui .stock-responsive-table thead th {
    font-size: .8rem; color: var(--text-light, #6b7280);
    background: var(--bg, #f9fafb);
}
.estoque-ui .stock-mobile-values { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.estoque-ui .stock-mobile-values small { font-size: .78rem; }
.estoque-ui .stock-mobile-values strong { font-size: .95rem; }
.estoque-editor { max-width: 1280px; margin-inline: auto; padding-bottom: 1rem; }
.estoque-editor > .modal-dialog { max-width: none; width: 100%; margin: 0; height: auto; pointer-events: auto; }
.estoque-editor .modal-content { max-height: none; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; box-shadow: none; }
.estoque-editor .modal-body { overflow: visible; flex: initial; }
.estoque-editor .modal-footer { position: sticky; bottom: 0; background: var(--bg-white, #fff); z-index: 20; }
@media (max-width: 767.98px) {
    .estoque-ui .modal-dialog { margin: .5rem; }
    .estoque-ui .modal-footer > .btn { flex: 1 1 120px; }
    .estoque-ui .gestao-page-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .estoque-ui .gestao-page-actions .btn { width: 100%; min-width: 0; padding-inline: .5rem; }
    .estoque-ui .stock-responsive-table { min-width: 0 !important; width: 100%; border: 0; }
    .estoque-ui .stock-responsive-table thead { display: none; }
    .estoque-ui .stock-responsive-table tbody { display: grid; gap: .75rem; padding: .65rem; }
    .estoque-ui .stock-responsive-table tbody tr { display: block; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; padding: .5rem; }
    .estoque-ui .stock-responsive-table tbody td { display: block; min-width: 0 !important; max-width: none !important; width: auto !important; white-space: normal; border: 0; text-align: left !important; overflow-wrap: anywhere; }
    .estoque-ui .stock-responsive-table tbody td[data-label] { display: grid; grid-template-columns: minmax(6rem, 35%) minmax(0, 1fr); gap: .4rem; }
    .estoque-ui .stock-responsive-table td[data-label]::before { content: attr(data-label); color: var(--text-light, #6b7280); font-size: .85rem; font-weight: 500; }
    .estoque-ui .stock-responsive-table td > * { min-width: 0; }
    .estoque-ui .stock-responsive-table .form-control { min-width: 0 !important; width: 100%; }
    .estoque-ui .stock-responsive-table td small { grid-column: 2; }
    .estoque-ui .stock-responsive-table td strong + small { margin-top: -.25rem; }
    .estoque-editor .modal-footer { position: static; }
    .estoque-editor > .modal-dialog { margin: 0; }
}
.estoque-inventario .card-footer > .btn { width: 160px; flex: 0 0 160px; }
@media (max-width: 767.98px) {
    .estoque-inventario .card-footer > .btn { width: auto; flex: 1 1 140px; }
}
/* Rótulo acima do número: os quatro indicadores não disputam a mesma linha. */
.estoque-ui .stock-metrics {
    grid-template-columns: repeat(2, minmax(max-content, 1fr));
    gap: .6rem 1rem;
    min-width: 244px;
}
.estoque-ui .stock-metrics > span {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: .15rem;
    min-width: 0;
}
.estoque-ui .stock-metrics > span > small,
.estoque-ui .stock-metrics > span > strong { display: block; white-space: nowrap; }
.estoque-ui .modal-footer > .btn,
.estoque-ui .card-footer > .btn,
.estoque-ui .page-header .btn { width: 160px; flex: 0 0 160px; }
@media (max-width: 767.98px) {
    .estoque-ui .modal-footer > .btn,
    .estoque-ui .card-footer > .btn,
    .estoque-ui .page-header .btn { width: auto; min-width: 0; flex: 1 1 140px; }
}

.estoque-ui .btn > i { margin-inline: 0 !important; }
