.card { border-radius: 0.5rem; }
.navbar-brand { font-weight: 600; }
.badge { font-size: 0.85em; }
.table th, .table td { vertical-align: middle; }
.btn-sm { padding: 0.25rem 0.5rem; }
.display-6 { font-size: 1.75rem; font-weight: 600; }
footer { margin-top: auto; }
body { min-height: 100vh; display: flex; flex-direction: column; }
.container { flex: 1; }

/* Dark mode adjustments */
[data-bs-theme="dark"] body {
    background-color: #212529;
    color: #dee2e6;
}

[data-bs-theme="dark"] .card {
    background-color: #2b3035;
    border-color: #373b3e;
}

[data-bs-theme="dark"] .card-header {
    background-color: rgba(255,255,255,0.03);
    border-bottom-color: #373b3e;
}

[data-bs-theme="dark"] .list-group-item {
    background-color: #2b3035;
    border-color: #373b3e;
    color: #dee2e6;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #2b3035;
    border-color: #373b3e;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #dee2e6;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: #373b3e;
    color: #fff;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #212529;
    border-color: #495057;
    color: #dee2e6;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #212529;
    border-color: #86b7fe;
    color: #dee2e6;
}

[data-bs-theme="dark"] .table {
    --bs-table-color: #dee2e6;
    --bs-table-bg: transparent;
    --bs-table-border-color: #373b3e;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: rgba(255,255,255,0.03);
}

[data-bs-theme="dark"] .text-muted {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] footer {
    border-top-color: #373b3e !important;
}

#themeToggle {
    color: rgba(255,255,255,0.75);
}

#themeToggle:hover {
    color: #fff;
}

/* Controles de quantidade personalizados */
.input-group-quantidade .btn-qtd,
.input-group-quantidade-tabela .btn-qtd-tabela {
    font-weight: 700;
    line-height: 1;
    padding: 0.25rem 0.65rem;
}

.input-group-quantidade .btn-qtd {
    font-size: 1.4rem;
    padding: 0.35rem 0.85rem;
}

.input-group-quantidade .form-control#qtde-input {
    font-size: 1.25rem;
    font-weight: 600;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    min-width: 3.5rem;
}

.input-group-quantidade-tabela {
    width: 120px;
}

.input-group-quantidade-tabela .btn-qtd-tabela {
    font-size: 1rem;
    padding: 0.15rem 0.45rem;
}

.input-group-quantidade-tabela .qtde-atualizar {
    font-weight: 600;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

/* Remove as setinhas do input number em navegadores Webkit e Firefox */
.input-group-quantidade input[type="number"]::-webkit-inner-spin-button,
.input-group-quantidade input[type="number"]::-webkit-outer-spin-button,
.input-group-quantidade-tabela input[type="number"]::-webkit-inner-spin-button,
.input-group-quantidade-tabela input[type="number"]::-webkit-outer-spin-button,
.input-group-lote-qtd input[type="number"]::-webkit-inner-spin-button,
.input-group-lote-qtd input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-group-quantidade input[type="number"],
.input-group-quantidade-tabela input[type="number"],
.input-group-lote-qtd input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Lançamento por módulo: select com espaço máximo, qtde compacta */
.lote-row .lote-estrutura {
    flex: 0 0 62px;
}

.lote-row .lote-select-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.lote-row .input-group-lote-qtd {
    flex: 0 0 96px;
    width: 96px;
}

.lote-row .input-group-lote-qtd .btn-lote-qtd {
    font-weight: 700;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

.lote-row .input-group-lote-qtd .lote-qtde {
    font-weight: 600;
    padding-left: 0.1rem;
    padding-right: 0.1rem;
}

.lote-row .lote-obs-wrap {
    flex: 0 0 92px;
}

.lote-row .btn-lote-add,
.lote-row .btn-lote-remove {
    flex: 0 0 auto;
    line-height: 1;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}
