.nexum-pager .nexum-pager-size {
    width: auto;
    min-width: 4.5rem;
}

/* Histórico de estoque (modal) — compacto, sem scroll horizontal */
.estoque-historico-produto {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--kaju-text-strong, #171d2f);
    line-height: 1.35;
    word-break: break-word;
}

.estoque-historico-list {
    max-height: min(58vh, 26rem);
    overflow-y: auto;
    overflow-x: hidden;
}

.estoque-historico-item {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--kaju-border, #e8ecf4);
}

.estoque-historico-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.estoque-historico-item:first-child {
    padding-top: 0;
}

.estoque-historico-item__linha {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
    font-size: 0.8125rem;
}

.estoque-historico-item__data {
    font-weight: 600;
    color: var(--kaju-text-strong, #171d2f);
    white-space: nowrap;
}

.estoque-historico-item__tipo {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2em 0.45em;
}

.estoque-historico-item__qtd {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.estoque-historico-item__saldo {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--kaju-text-muted, #636e8b);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.estoque-historico-item__saldo strong {
    color: var(--kaju-text-strong, #171d2f);
    font-weight: 700;
}

.estoque-historico-item__detalhe {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--kaju-text-muted, #636e8b);
    word-break: break-word;
}

.estoque-historico-item__op {
    font-weight: 600;
    color: var(--kaju-text-strong, #171d2f);
}

.estoque-historico-item__sep {
    opacity: 0.55;
    padding: 0 0.1rem;
}

@media (max-width: 480px) {
    .estoque-historico-item__saldo {
        margin-left: 0;
        flex-basis: 100%;
    }
}

.nexum-selecao-tabela {
    max-height: min(50vh, 22rem);
    overflow-y: auto;
}

.nexum-selecao-campo.input-group {
    flex-wrap: nowrap;
    gap: 0.25rem;
}

.nexum-selecao-campo .nexum-selecao-btn-buscar,
.nexum-selecao-campo .btn-outline-secondary {
    font-size: 0.8125rem;
    padding: 0.4rem 0.7rem;
    font-weight: 500;
    border-radius: 0.45rem;
    white-space: nowrap;
}

.nexum-selecao-campo .form-control[readonly] {
    background-color: var(--kaju-field-bg, #f8fafc);
    cursor: default;
    min-width: 0;
}

/* Busca ao digitar (autocomplete) — nome + detalhe (CPF, código, etc.) */
.nexum-selecao-autocomplete {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.nexum-selecao-autocomplete .form-control {
    min-width: 0;
}

.nexum-selecao-autocomplete-painel {
    position: absolute;
    z-index: 1060;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: min(50vh, 16rem);
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--kaju-border, #dde2ef);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

/* Autocomplete dentro de modal scrollável (ex.: adicionar produto na venda) */
.modal.show .nexum-selecao-campo,
.modal.show .nexum-selecao-autocomplete {
    overflow: visible;
}

.modal-dialog-scrollable:has(.nexum-selecao-autocomplete) .modal-content,
.modal-dialog-scrollable:has(.nexum-selecao-autocomplete) .modal-body {
    overflow: visible;
}

.modal-dialog-scrollable:has(.nexum-selecao-autocomplete) {
    overflow: visible;
}

.nexum-selecao-autocomplete-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: transparent;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
}

.nexum-selecao-autocomplete-item:last-child {
    border-bottom: 0;
}

.nexum-selecao-autocomplete-item:hover,
.nexum-selecao-autocomplete-item:focus {
    background: #f0f4ff;
    outline: none;
}

.nexum-selecao-autocomplete-item.ativo {
    background: #e8eeff;
}

.nexum-selecao-autocomplete-nome {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #0f172a;
    line-height: 1.25;
}

.nexum-selecao-autocomplete-detalhe {
    display: block;
    font-size: 0.78rem;
    color: #15803d;
    margin-top: 0.15rem;
    line-height: 1.3;
}

.nexum-selecao-autocomplete-msg {
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
    color: #64748b;
}

.nexum-selecao-autocomplete-rodape {
    border-top: 1px solid #e2e8f0;
    padding: 0.35rem 0.5rem;
    background: #f8fafc;
}

.card .nexum-listagem-busca {
    border-bottom: 1px solid var(--kaju-border, #dde2ef);
}

/* CadastroModal — centralizar na viewport (Blazor usa show d-block sem JS do Bootstrap) */
.cadastro-modal-overlay {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    min-height: 100%;
}

.cadastro-modal-overlay .cadastro-modal-dialog {
    margin: 0;
    max-height: calc(100vh - 2.5rem);
}
