h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* ---- Base ---- */
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #1f2933;
    background: #f5f6f8;
}

main {
    padding: 1.5rem;
}

button.link {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.erro {
    color: #b42318;
    background: #fef3f2;
    border: 1px solid #fecdca;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
}

/* ---- Barra do topo (MainLayout) ---- */
.topo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1.5rem;
    background: #1f2933;
    color: #fff;
}

    .topo a {
        color: #fff;
    }

    .topo .marca {
        font-weight: 700;
        text-decoration: none;
        margin-right: auto;
    }

/* ---- Telas de acesso (LayoutAcesso) ---- */
.acesso {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    box-sizing: border-box;
}

.acesso-cartao {
    width: 100%;
    max-width: 22rem;
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

    .acesso-cartao .marca {
        font-weight: 700;
        font-size: 1.4rem;
        margin: 0 0 1rem;
    }

    .acesso-cartao h1 {
        font-size: 1.1rem;
    }

    .acesso-cartao form {
        display: grid;
        gap: 0.4rem;
    }

    .acesso-cartao input {
        padding: 0.55rem;
        border: 1px solid #c4c9d0;
        border-radius: 6px;
        font: inherit;
        margin-bottom: 0.5rem;
    }

    .acesso-cartao button[type=submit]:not(.link) {
        padding: 0.6rem;
        border: none;
        border-radius: 6px;
        background: #1f2933;
        color: #fff;
        font: inherit;
        cursor: pointer;
    }

    .acesso-cartao .dica {
        font-size: 0.85rem;
        color: #616e7c;
    }

/* ---- Mensagens ---- */
.aviso-ok {
    color: #05603a;
    background: #ecfdf3;
    border: 1px solid #abefc6;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
}

.discreto {
    color: #616e7c;
    font-size: 0.9rem;
}

.descricao {
    color: #616e7c;
    margin-top: -0.5rem;
}

/* ---- Tabelas ---- */
.tabela {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

    .tabela th,
    .tabela td {
        text-align: left;
        padding: 0.55rem 0.75rem;
        border-bottom: 1px solid #e4e7eb;
        vertical-align: middle;
    }

    .tabela th {
        background: #f0f2f5;
        font-size: 0.85rem;
        font-weight: 600;
    }

    .tabela .acoes form {
        display: flex;
        gap: 0.4rem;
        flex-wrap: wrap;
    }

/* ---- Selos (status) ---- */
.selo {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    background: #e4e7eb;
    color: #323f4b;
}

.selo-ok { background: #d1fadf; color: #05603a; }
.selo-perigo { background: #fee4e2; color: #b42318; }
.selo-aviso { background: #fef0c7; color: #93370d; }

/* Linha de tabela que pede atenção (ex.: etapa divergente na Auditoria do Master). */
.tabela tr.linha-alerta td { background: #fef3f2; }
/* Linha escolhida (ex.: solicitação em montagem na Logística). */
.tabela tr.linha-selecionada td { background: #eef4ff; }

/* Cartões de resumo (ex.: estoque de packs por modelo e formulação). */
.cartoes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.cartao {
    display: grid;
    gap: 0.1rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e4e7eb;
    border-radius: 6px;
    background: #fff;
}

/* ---- Formulário em linha (ex.: novo usuário) ---- */
.form-linha {
    margin-bottom: 1.25rem;
}

    .form-linha fieldset {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        gap: 0.75rem;
        border: 1px solid #e4e7eb;
        border-radius: 8px;
        background: #fff;
        padding: 0.75rem 1rem 1rem;
    }

    .form-linha label {
        display: grid;
        gap: 0.25rem;
        font-size: 0.85rem;
    }

input, select, button {
    font: inherit;
}

    .form-linha input,
    .form-linha select,
    .tabela select {
        padding: 0.4rem;
        border: 1px solid #c4c9d0;
        border-radius: 6px;
    }

button:not(.link) {
    padding: 0.4rem 0.8rem;
    border: 1px solid #c4c9d0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

    .form-linha button[type=submit] {
        background: #1f2933;
        color: #fff;
        border-color: #1f2933;
    }

.htmx-request button {
    opacity: 0.6;
}

/* ---- Utilitários de texto ---- */
.forte { font-weight: 600; }
.direita { text-align: right; }
.pequeno { font-size: 0.8rem; }
.maiusculas { text-transform: uppercase; }

/* ---- Abas de módulo (ex.: Engenharia) ---- */
.abas {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    border-bottom: 1px solid #d5d9de;
    margin-bottom: 1rem;
}

    .abas a {
        padding: 0.5rem 0.9rem;
        text-decoration: none;
        color: #323f4b;
        border: 1px solid transparent;
        border-bottom: none;
        border-radius: 6px 6px 0 0;
    }

        .abas a.ativa {
            background: #fff;
            border-color: #d5d9de;
            margin-bottom: -1px;
            font-weight: 600;
        }

    .abas .abas-pendentes {
        margin-left: auto;
        font-size: 0.8rem;
        color: #9aa5b1;
    }

/* Segundo nível de abas, dentro de um grupo. */
.subabas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

    .subabas a {
        padding: 0.3rem 0.75rem;
        font-size: 0.9rem;
        text-decoration: none;
        color: #323f4b;
        border: 1px solid #d5d9de;
        border-radius: 6px;
    }

        .subabas a.ativa {
            border-color: #323f4b;
            font-weight: 600;
        }

/* ---- NF × Super Pack ---- */
.lista-empenho { list-style: none; margin: 0; padding: 0; }
.em-linha { display: inline; }

/* ---- Rastreabilidade e saldos ---- */
.opcoes-rastreio { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0 0 1rem; padding: 0; max-height: 14rem; overflow-y: auto; }
.opcoes-rastreio a { display: block; padding: 0.3rem 0.6rem; border: 1px solid #d5d9de; border-radius: 6px; text-decoration: none; color: #323f4b; }
.opcoes-rastreio a.ativa { border-color: #323f4b; background: #f0f2f5; }
tr.inicio-grupo td { border-top: 2px solid #9aa5b1; }
.rolagem-limitada { max-height: 26rem; overflow-y: auto; }
.dados-tres { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.dados-quatro { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }

/* ---- Data retroativa ---- */
.retro { border: 1px solid #d5d9de; border-radius: 6px; padding: 0.4rem 0.6rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }

/* ---- Bandeira da fórmula ---- */
.bandeira { font-size: 1.1rem; line-height: 1; }
.bandeira-verde { color: #05603a; }
.bandeira-roxo { color: #6b21a8; }
.bandeira-azul { color: #1d4ed8; }

/* ---- Cartões em grade (ex.: Numeração de Documentos) ---- */
.grade-cartoes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 1rem;
}

.dados-cartao {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

    .dados-cartao dt { font-size: 0.8rem; color: #616e7c; }
    .dados-cartao dd { margin: 0; font-weight: 600; }

/* ---- Tabelas com campos editáveis ---- */
.rolagem {
    overflow-x: auto;
}

.tabela-edicao input,
.tabela-edicao select {
    width: 100%;
    min-width: 6rem;
    box-sizing: border-box;
    padding: 0.3rem 0.4rem;
    border: 1px solid #c4c9d0;
    border-radius: 5px;
}

    .tabela-edicao input.curto {
        min-width: 3.5rem;
        width: 4.5rem;
    }

input.numero {
    text-align: right;
}

.tabela-edicao input:focus,
.tabela-edicao select:focus {
    outline: 2px solid #3e7bfa;
    outline-offset: -1px;
}

/* Linha sendo salva pelo htmx */
tr.htmx-request {
    opacity: 0.6;
}

.tabela tr.selecionada td {
    background: #eef4ff;
}

.tabela tr.total td {
    font-weight: 600;
    background: #f7f8fa;
}

/* ---- Painéis (ex.: composição + histórico) ---- */
.paineis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(26rem, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.painel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 1rem 1.25rem;
    margin-top: 1.25rem;
}

.paineis .painel {
    margin-top: 0;
}

.painel-estreito {
    max-width: 34rem;
}

.painel h2 {
    font-size: 1.05rem;
    margin: 0 0 0.75rem;
}

.cartao-versao {
    border: 1px solid #e4e7eb;
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.6rem;
}

    .cartao-versao p {
        margin: 0.2rem 0;
    }

.linha-acoes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

    .linha-acoes.direita {
        justify-content: flex-end;
    }

/* ---- Botões de destaque ---- */
button.principal {
    background: #1f2933;
    color: #fff;
    border-color: #1f2933;
}

button.perigo {
    color: #b42318;
    border-color: #fecdca;
}

/* ---- Blocos recolhíveis (criar fórmula, nova versão) ---- */
details > summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.4rem 0;
}

details.acao-secundaria {
    margin-top: 1rem;
}

    details.acao-secundaria label {
        display: grid;
        gap: 0.25rem;
        margin: 0.5rem 0;
    }

    details.acao-secundaria textarea {
        font: inherit;
        padding: 0.4rem;
        border: 1px solid #c4c9d0;
        border-radius: 6px;
    }

/* ---- Breaking Point ---- */
.aviso-bp {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.8rem 1rem;
    border: 1px solid #fda29b;
    border-radius: 8px;
    background: #fef3f2;
    color: #912018;
}

.subtitulo {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #616e7c;
    margin: 1.25rem 0 0.25rem;
}

.lista-prontidao {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 0.5rem;
}

    .lista-prontidao li {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
        background: #f5f6f8;
    }

button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- Formulário de teste periódico (Engenharia → Qualidade) ---- */
.form-teste {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 0.6rem 1rem;
    align-items: end;
    padding: 0.75rem 0;
}

    .form-teste label {
        display: grid;
        gap: 0.25rem;
        font-size: 0.85rem;
    }

    .form-teste input,
    .form-teste select {
        padding: 0.4rem;
        border: 1px solid #c4c9d0;
        border-radius: 6px;
    }

    /* Campo que ocupa a linha inteira; os campos do teste escolhido entram na mesma grade. */
    .form-teste .largo {
        grid-column: 1 / -1;
    }
    .form-teste .campos-teste {
        display: contents;
    }

.tabela tr.linha-edicao td {
    background: #fafbfc;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}

/* Caixas de marcar dentro de tabelas editáveis: tamanho natural, não a célula inteira. */
.tabela-edicao input[type=checkbox] {
    width: auto;
    min-width: 0;
}

/* Botões de opção (radio) com texto ao lado */
input[type=radio] {
    margin-top: 0.2rem;
}

label.linha-acoes {
    align-items: flex-start;
    margin: 0.35rem 0;
}

/* ---- Calendário do PCP (quadro do mês) ---- */
.espaco-acima {
    margin-top: 1.5rem;
}

.navegacao-mes {
    justify-content: space-between;
    text-transform: capitalize;
}

.mes {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    text-align: center;
    font-size: 0.85rem;
}

.mes-cabecalho {
    font-weight: 600;
    color: #616e7c;
}

.mes-dia {
    padding: 0.45rem 0;
    border-radius: 6px;
    border: 1px solid #d5d9de;
}

    .mes-dia.dia-fora { background: #f0f2f5; color: #9aa5b1; border-color: transparent; }
    .mes-dia.dia-feriado { background: #fee4e2; color: #b42318; border-color: #fda29b; }
    .mes-dia.dia-extra { background: #d1fadf; color: #05603a; border-color: #6ce9a6; }

    .mes-dia.legenda {
        display: inline-block;
        padding: 0.1rem 0.5rem;
    }

/* ---- Pedidos (PCP): ações empilhadas na 1ª linha de cada pedido ---- */
.acoes-pedido {
    display: grid;
    gap: 0.3rem;
    justify-items: start;
    min-width: 12rem;
}

/* ---- Painel de OPs: as quatro etapas lado a lado ---- */
.etapas {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.2rem;
    width: max-content;
}

/* ---- Formulação: lista de datas da demanda ocupa a linha inteira do formulário ---- */
.form-teste .datas-demanda {
    grid-column: 1 / -1;
    border: 1px solid #e4e7eb;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
}

/* ---- Qualidade: certificado e etiqueta do pack (páginas para imprimir) ---- */
.documento-impresso {
    max-width: 48rem;
    padding: 1.5rem 2rem;
    border: 1px solid #e4e7eb;
    border-radius: 6px;
    background: #fff;
}
.campos-documento {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem 1.25rem;
    margin: 1rem 0;
}
.campos-documento dt {
    color: #6b7280;
    font-size: 0.85rem;
}
.campos-documento dd {
    margin: 0;
}
.documento-impresso .declaracao {
    margin-top: 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e4e7eb;
    font-size: 0.9rem;
}
.etiqueta-pack {
    max-width: 30rem;
}
.etiqueta-codigo {
    margin: 0.25rem 0;
    font-size: 2rem;
    font-weight: 700;
}

/* Impressão (relatórios e relatório do turno): só o conteúdo, sem menu, abas e formulários. */
@media print {
    .topo, .abas, .nao-imprimir, form, details, button, #mensagem, #aviso-bp, #selo-barcode {
        display: none !important;
    }
    .painel {
        break-inside: avoid;
        box-shadow: none;
    }
    .documento-impresso {
        border: none;
        padding: 0;
    }
}

/* Selo do leitor de código de barras (canto de todas as telas, Produção e admin). */
.selo-barcode {
    position: fixed;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    max-width: 28rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid #e4e7eb;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(16, 24, 40, 0.12);
}
.selo-barcode:empty {
    display: none;
}
.selo-barcode code:empty {
    display: none;
}

/* ---- Produção: recipientes do turno, gráfico de velocidade ---- */
.rolagem-x { overflow-x: auto; }
.fila-recipientes { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; padding: 0.25rem 0.4rem; border: 1px solid #d5d9de; border-radius: 6px; margin-bottom: 0.4rem; }
.recipiente { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; padding: 0.2rem 0.3rem; font-size: 0.7rem; font-weight: 700; color: #05603a; background: none; border: 1px solid transparent; border-radius: 6px; }
.recipiente:hover { background: #f1f3f5; }
.recipiente-recupera { color: #1d4ed8; }
.recipiente-feito { color: #7b8794; }
.recipiente-ativo { border: 2px solid #1d4ed8; }
.recipiente-rotulo { font-size: 0.6rem; text-transform: uppercase; }
button.aviso { border-color: #dc6803; color: #93370d; }
.grafico { width: 100%; max-width: 900px; height: auto; display: block; }
.grafico-grade { stroke: #e4e7eb; stroke-dasharray: 3 3; }
.grafico-texto { font-size: 11px; fill: #52606d; }
.grafico-l1 { fill: none; stroke: #1d4ed8; stroke-width: 2.5; }
.grafico-l2 { fill: none; stroke: #dc6803; stroke-width: 2.5; stroke-dasharray: 5 3; }
.grafico-ponto-l1 { fill: #1d4ed8; }
.grafico-ponto-l2 { fill: #dc6803; }
.grafico-legenda-l1 { color: #1d4ed8; font-weight: 600; }
.grafico-legenda-l2 { color: #b54708; font-weight: 600; }

/* ---- Logo da empresa (Configurações → Identidade Visual) ---- */
.marca-logo { height: 1.6rem; width: auto; max-width: 6rem; object-fit: contain; vertical-align: middle; margin-right: 0.4rem; }
.acesso-logo { display: block; height: 3rem; width: auto; max-width: 10rem; object-fit: contain; margin: 0 auto 0.5rem; }
.logo-previa { height: 2.5rem; width: auto; max-width: 10rem; object-fit: contain; border: 1px solid #e4e7eb; border-radius: 4px; padding: 2px; background: #fff; }

/* ---- Engenharia → Modelos de Impressão ---- */
.previa-impressao { display: block; width: 100%; max-height: 24rem; background: #f3f4f6; border: 1px solid #e4e7eb; border-radius: 4px; }

/* ---- Páginas de impressão na medida (tamanho da página e campos: /impressao/estilo/{doc}.css) ---- */
.impressao { padding: 0; max-width: none; }
.barra-impressao { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 0.6rem 1rem; border-bottom: 1px solid #e4e7eb; background: #fff; }
.folhas { padding: 1rem 0; }
.folha { position: relative; overflow: hidden; box-sizing: border-box; background: #fff; color: #111; margin: 0 auto 6mm; outline: 1px dashed #c4c9d1; break-after: page; page-break-after: always; font-family: Arial, Helvetica, sans-serif; }
.folha:last-child { break-after: auto; page-break-after: auto; }
.folha .etiqueta { position: relative; display: block; overflow: hidden; }
.folha .desenho { position: absolute; left: 0; top: 0; }
.folha .gabarito { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.folha .campo { position: absolute; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; line-height: 1.15; color: #0d0d1a; }
.folha .campo span { max-width: 100%; }
.folha .campo-marcador { border: 1px dashed #2563eb; color: #1e3a8a; font-size: 6pt; }
.folha .area-util { position: absolute; display: flex; flex-direction: column; }
.folha .sobre-arte { padding-top: 25%; }
.cabecalho-folha { display: flex; align-items: center; gap: 3mm; padding-bottom: 2mm; margin-bottom: 3mm; border-bottom: 0.3mm solid #c8c8c8; }
.logo-folha { height: 16mm; width: auto; max-width: 40mm; object-fit: contain; }
.titulo-folha { margin: 0; font-size: 15pt; font-weight: 700; color: #17214a; }
.subtitulo-folha { margin: 1mm 0 0; font-size: 9pt; }
.linhas-folha { margin: 0; display: grid; gap: 2.5mm; }
.linhas-folha dt { font-size: 8pt; color: #737380; }
.linhas-folha dd { margin: 0; font-size: 10pt; overflow-wrap: anywhere; }
.linhas-folha .grande dd { font-size: 15pt; font-weight: 700; }
.rodape-folha { margin-top: auto; font-size: 7pt; color: #6e6e6e; }
.rodape-folha p { margin: 0.5mm 0 0; }
.rodape-folha .emitido { text-align: right; }
.folha-pequena .logo-folha { height: 10mm; max-width: 25mm; }
.folha-pequena .titulo-folha { font-size: 11pt; }
.folha-pequena .subtitulo-folha { font-size: 7pt; }
.folha-pequena .cabecalho-folha { margin-bottom: 1.5mm; padding-bottom: 1mm; gap: 2mm; }
.folha-pequena .linhas-folha { gap: 1mm; }
.folha-pequena .linhas-folha dt { font-size: 6pt; }
.folha-pequena .linhas-folha dd { font-size: 7pt; }
.folha-pequena .linhas-folha .grande dd { font-size: 10pt; }
.folha-pequena .rodape-folha { font-size: 5.5pt; }
@media print {
    html, body { margin: 0; padding: 0; background: #fff; }
    .impressao { padding: 0; margin: 0; }
    .folhas { padding: 0; }
    .folha { margin: 0; outline: none; }
}
.configurador-impressao .tabela input { width: 4.5rem; }
.configurador-impressao .tabela td, .configurador-impressao .tabela th { padding-left: 0.3rem; padding-right: 0.3rem; }
.folha .fundo-area { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; }
.folha .conteudo-folha > *:not(.fundo-area) { position: relative; z-index: 1; }
.folha .codigo-barras { display: block; width: 100%; height: 100%; }
.folha .barras-folha { height: 10mm; max-width: 70mm; margin: 1mm 0 2mm; }
.folha-pequena .barras-folha { height: 8mm; }
.folha .volume-folha { float: right; font-size: 8pt; }
.folha .codigo-folha { margin: 0; font-size: 16pt; font-weight: 700; }
.folha-pequena .codigo-folha { font-size: 13pt; }
.folha .linhas-duas { grid-template-columns: 1fr 1fr; column-gap: 2mm; }
.folha .anexo-dna { font-size: 9pt; }
.folha .anexo-dna h3 { margin: 2mm 0 1mm; padding: 1mm 2mm; background: #edeff7; font-size: 10pt; }
.folha .anexo-dna dl { display: grid; grid-template-columns: 45mm 1fr; gap: 1mm 3mm; margin: 0 0 3mm; }
.folha .anexo-dna dt { color: #737380; font-size: 8pt; }
.folha .anexo-dna dd { margin: 0; overflow-wrap: anywhere; }
.folha .tabela-folha { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
.folha .tabela-folha th, .folha .tabela-folha td { text-align: left; padding: 0.8mm 1mm; border-bottom: 0.2mm solid #ddd; }
.folha .declaracao-folha { margin-top: 3mm; font-size: 9pt; }
.folha.folha-auto { height: auto; min-height: 0; }
.folha .area-util .miolo-folha { display: flex; flex-direction: column; height: 100%; position: relative; z-index: 1; }
.folha.fluxo .miolo-folha { display: block; }
.folha.fluxo .rodape-folha { margin-top: 6mm; }
.botao-etiqueta { display: inline-flex; gap: 0.3rem; align-items: center; }
.botao-etiqueta input { width: 3.5rem; }
.manual-iso h3 { margin: 5mm 0 2mm; font-size: 12pt; color: #17214a; }
.manual-iso h4 { margin: 3mm 0 1mm; font-size: 10.5pt; }
.manual-iso p, .manual-iso li { font-size: 9.5pt; line-height: 1.35; }
.manual-iso .tabela-folha { margin: 2mm 0; break-inside: auto; }
.manual-iso .tabela-folha tr { break-inside: avoid; }
.manual-iso .secao-manual { break-inside: auto; }
.fluxograma-iso { margin: 3mm 0; break-inside: avoid; }
.fluxograma-iso svg { display: block; width: 100%; height: auto; }
.tabela-rastreio { font-size: 7pt; }
.tabela-rastreio tr.inicio-grupo td { border-top: 0.3mm solid #999; }
/* Dashboard de produção: cards do dia, pendentes de impressão primeiro (MVP DashboardProducao) */
.rolagem-cards { max-height: 6rem; overflow-y: auto; border-top: 1px solid #e4e7eb; padding-top: 0.25rem; }
/* Recado de atenção em parágrafo (lembrete do arquivo frio e outros avisos) */
p.aviso { background: #fffaeb; border: 1px solid #fec84b; color: #93370d; border-radius: 4px; padding: 0.4rem 0.6rem; }

/* =============================================================================
   Tema do MVP (styles.css, AppShell.tsx e componentes shadcn da Lovable), pedido de 2026-12-03:
   o visual tem de ser igual ao do MVP. Vem por último para valer sobre as regras antigas acima.
   Cores do Capflex Design System: marinho institucional + roxo Capflex, em oklch como no MVP.
   Fontes: Archivo (títulos) e Inter Tight (texto). A política de segurança só aceita arquivos do
   próprio servidor, então elas precisam estar em /fontes/; sem os arquivos, valem as de reserva.
   ============================================================================= */
/* Fontes do MVP (Google Fonts, SIL Open Font License 1.1): variáveis, subconjunto latin, servidas daqui por causa da CSP. */
@font-face { font-family: "Inter Tight"; font-weight: 400 600; font-display: swap; src: local("Inter Tight"), url("/fontes/inter-tight.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 500 800; font-display: swap; src: local("Archivo"), url("/fontes/archivo.woff2") format("woff2"); }

:root {
    --raio: 0.5rem;
    --fundo: oklch(0.975 0.004 70);
    --texto: oklch(0.26 0.07 268);
    --cartao: oklch(1 0 0);
    --primaria: oklch(0.31 0.095 267);
    --primaria-texto: oklch(0.98 0.004 70);
    --secundaria: oklch(0.945 0.008 290);
    --suave: oklch(0.955 0.005 290);
    --suave-texto: oklch(0.52 0.03 280);
    --destaque: oklch(0.49 0.125 328);
    --perigo: oklch(0.55 0.21 25);
    --sucesso: oklch(0.55 0.13 155);
    --info: oklch(0.62 0.13 230);
    --alerta: oklch(0.72 0.16 65);
    --borda: oklch(0.9 0.01 290);
    --lateral: oklch(0.31 0.095 267);
    --lateral-texto: oklch(0.93 0.01 290);
    --lateral-ativo: oklch(0.49 0.125 328);
    --lateral-realce: oklch(0.37 0.09 270);
    --lateral-borda: oklch(0.4 0.08 270);
    --sombra-painel: 0 1px 2px oklch(0.25 0.06 268 / 0.06), 0 12px 32px -18px oklch(0.25 0.06 268 / 0.28);
    --fonte-texto: "Inter Tight", "Inter", "Segoe UI", system-ui, sans-serif;
    --fonte-titulo: "Archivo", "Inter Tight", "Segoe UI", system-ui, sans-serif;
}

body {
    background: var(--fundo);
    color: var(--texto);
    font-family: var(--fonte-texto);
    font-size: 0.875rem;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--fonte-titulo); letter-spacing: -0.015em; color: var(--texto); }
a { color: var(--destaque); }
.discreto, .descricao { color: var(--suave-texto); }

/* ---- Casca: menu lateral + barra superior (AppShell) ---- */
.casca { display: flex; min-height: 100vh; }
.menu-chave { display: none; }
.lateral {
    position: sticky; top: 0; height: 100vh; width: 16rem; flex-shrink: 0;
    display: flex; flex-direction: column; background: var(--lateral); color: var(--lateral-texto);
}
.lateral-marca { display: flex; align-items: center; gap: 0.625rem; padding: 1.25rem; color: var(--lateral-texto); text-decoration: none; min-width: 0; }
.lateral-logo { height: 4rem; width: 4rem; object-fit: contain; border-radius: 0.375rem; flex-shrink: 0; }
.lateral-iniciais {
    display: grid; place-items: center; height: 4rem; width: 4rem; flex-shrink: 0; border-radius: 0.375rem;
    background: var(--lateral-ativo); color: var(--primaria-texto); font-family: var(--fonte-titulo); font-size: 1.25rem; font-weight: 700;
}
.lateral-nome { display: grid; min-width: 0; }
.lateral-nome span { font-family: var(--fonte-titulo); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lateral-nome small { font-size: 0.75rem; opacity: 0.7; }
.lateral-divisor { border: 0; border-top: 1px solid var(--lateral-borda); margin: 0; }
.lateral-menu { display: flex; flex: 1; flex-direction: column; gap: 0.25rem; overflow-y: auto; padding: 0 0.75rem 1rem; }
.lateral-secao { margin: 0; padding: 1rem 0.75rem 0.25rem; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: color-mix(in oklab, var(--lateral-texto) 50%, transparent); }
.lateral-secao + .lateral-item { margin-top: 0; }
.lateral-menu .lateral-secao:not(:first-child) { padding-top: 1.25rem; }
.lateral-item {
    display: flex; align-items: center; gap: 0.75rem; border-radius: 0.375rem; padding: 0.5rem 0.75rem;
    font-size: 0.875rem; font-weight: 500; text-decoration: none; color: color-mix(in oklab, var(--lateral-texto) 85%, transparent);
    transition: background-color 120ms ease, color 120ms ease;
}
.lateral-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lateral-item:hover { background: var(--lateral-realce); color: var(--primaria-texto); }
.lateral-item.ativo { background: var(--lateral-ativo); color: var(--primaria-texto); }
.lateral-versao { margin: auto 0 0; padding: 1.5rem 0.75rem 0; font-size: 11px; color: color-mix(in oklab, var(--lateral-texto) 50%, transparent); }
.icone { width: 1rem; height: 1rem; flex-shrink: 0; }
.casca-conteudo { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.barra {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.75rem 1.5rem; border-bottom: 1px solid var(--borda); background: color-mix(in oklab, var(--cartao) 95%, transparent);
    backdrop-filter: blur(8px);
}
.barra-usuario { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.barra-quem { min-width: 0; }
.barra-nome { margin: 0; font-size: 0.875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-papel { margin: 0; font-size: 0.75rem; color: var(--suave-texto); }
.barra-acoes { display: flex; align-items: center; gap: 0.25rem; flex-shrink: 0; }
.barra-acoes form { margin: 0; }
/* Na barra, o selo fica em linha (o MVP o põe no slot do cabeçalho), sem cobrir o botão Sair. */
.barra-acoes .selo-barcode { position: static; max-width: 14rem; box-shadow: none; }
.botao-menu { display: none; cursor: pointer; padding: 0.4rem; border-radius: 0.375rem; color: var(--texto); }
.botao-menu .icone { width: 1.25rem; height: 1.25rem; }
button.botao-icone { display: grid; place-items: center; height: 2.25rem; width: 2.25rem; padding: 0; border: 0; background: transparent; color: var(--texto); }
button.botao-icone:hover { background: var(--suave); }
.menu-fundo { display: none; }
.casca-conteudo > main { flex: 1; padding: 1.5rem 2rem; min-width: 0; }
@media (max-width: 1023px) {
    .lateral { position: fixed; z-index: 40; left: 0; top: 0; width: 18rem; transform: translateX(-100%); transition: transform 160ms ease; }
    .menu-chave:checked ~ .lateral { transform: none; }
    .menu-chave:checked ~ .menu-fundo { display: block; position: fixed; inset: 0; z-index: 30; background: oklch(0 0 0 / 0.4); }
    .botao-menu { display: grid; place-items: center; }
    .casca-conteudo > main { padding: 1.5rem 1rem; }
    .barra { padding: 0.75rem 1rem; }
}

/* ---- Cabeçalho da página (PageHeader do MVP) ---- */
main h1 { font-size: 1.875rem; font-weight: 700; line-height: 1.2; margin: 0 0 0.25rem; }
main h1 + .descricao { margin: 0 0 1.5rem; font-size: 0.875rem; }
@media (max-width: 639px) { main h1 { font-size: 1.5rem; } }

/* ---- Painéis (surface-panel) ---- */
.painel {
    background: var(--cartao); color: var(--texto); border: 1px solid var(--borda);
    border-radius: calc(var(--raio) + 4px); box-shadow: var(--sombra-painel); padding: 1.25rem;
}
.painel h2 { font-size: 1.125rem; font-weight: 600; }
.painel h3 { font-size: 1rem; font-weight: 600; }

/* ---- Abas no estilo Windows (win-tabs) ---- */
.abas { align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--borda); margin-bottom: 1rem; }
.abas a {
    position: relative; margin-bottom: -1px; padding: 6px 14px; border: 1px solid transparent; border-bottom: none;
    border-radius: 8px 8px 0 0; color: var(--suave-texto); font-weight: 500; transition: background-color 120ms ease, color 120ms ease;
}
.abas a:hover { color: var(--texto); background: var(--suave); }
.abas a.ativa { background: var(--cartao); color: var(--texto); font-weight: 600; border-color: var(--borda); border-bottom: 1px solid var(--cartao); margin-bottom: -1px; }
.abas .abas-pendentes { color: var(--suave-texto); }
.subabas { align-items: flex-end; gap: 2px; border-bottom: 1px solid color-mix(in oklab, var(--borda) 70%, transparent); margin-bottom: 1rem; }
.subabas a {
    margin-bottom: -1px; padding: 5px 12px; font-size: 0.8125rem; border: 1px solid transparent; border-bottom: none;
    border-radius: 8px 8px 0 0; color: var(--suave-texto); font-weight: 500;
}
.subabas a:hover { color: var(--texto); background: var(--suave); }
.subabas a.ativa { background: var(--cartao); color: var(--texto); font-weight: 600; border-color: var(--borda); border-bottom: 1px solid var(--cartao); }

/* ---- Tabelas (Table do shadcn) ---- */
.tabela { background: transparent; border-radius: 0; box-shadow: none; font-size: 0.875rem; }
.tabela th, .tabela td { padding: 0.5rem; border-bottom: 1px solid var(--borda); }
.tabela th { background: transparent; height: 2.5rem; color: var(--suave-texto); font-size: 0.875rem; font-weight: 500; white-space: nowrap; }
.tabela tbody tr:hover td { background: color-mix(in oklab, var(--suave) 50%, transparent); }
.tabela tr.linha-alerta td { background: color-mix(in oklab, var(--perigo) 8%, transparent); }
.tabela tr.linha-selecionada td, .tabela tr.selecionada td { background: color-mix(in oklab, var(--destaque) 8%, transparent); }

/* ---- Selos (Badge) ---- */
.selo { padding: 0.125rem 0.625rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--secundaria); color: var(--primaria); border: 1px solid transparent; }
.selo-ok { background: color-mix(in oklab, var(--sucesso) 15%, transparent); color: var(--sucesso); }
.selo-perigo { background: color-mix(in oklab, var(--perigo) 15%, transparent); color: var(--perigo); }
.selo-aviso { background: color-mix(in oklab, var(--alerta) 18%, transparent); color: oklch(0.5 0.13 60); }

/* ---- Botões e campos (Button e Input do shadcn) ---- */
button:not(.link) {
    min-height: 2.25rem; padding: 0.4rem 1rem; border: 1px solid var(--borda); border-radius: calc(var(--raio) - 2px);
    background: var(--cartao); color: var(--texto); font-size: 0.875rem; font-weight: 500; transition: background-color 120ms ease;
}
button:not(.link):hover { background: var(--suave); }
button.principal, .form-linha button[type=submit], .acesso-cartao button[type=submit]:not(.link) {
    background: var(--primaria); border-color: var(--primaria); color: var(--primaria-texto);
}
button.principal:hover, .form-linha button[type=submit]:hover { background: color-mix(in oklab, var(--primaria) 90%, white); }
button.perigo { color: var(--perigo); border-color: color-mix(in oklab, var(--perigo) 35%, transparent); }
button[disabled] { opacity: 0.5; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]), select, textarea {
    min-height: 2.25rem; padding: 0.25rem 0.75rem; border: 1px solid var(--borda); border-radius: calc(var(--raio) - 2px);
    background: transparent; color: var(--texto); font-size: 0.875rem; box-sizing: border-box;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
    outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--destaque) 35%, transparent); border-color: var(--destaque);
}
input[type=checkbox], input[type=radio] { accent-color: var(--primaria); }

/* ---- Mensagens ---- */
.aviso-ok { color: var(--sucesso); background: color-mix(in oklab, var(--sucesso) 10%, transparent); border-color: color-mix(in oklab, var(--sucesso) 35%, transparent); border-radius: var(--raio); }
.erro { color: var(--perigo); }
p.aviso { background: color-mix(in oklab, var(--alerta) 12%, transparent); border-color: color-mix(in oklab, var(--alerta) 45%, transparent); color: oklch(0.45 0.12 60); border-radius: var(--raio); }

/* ---- Tela de entrada no tema (o layout do logon pode ser diferente do MVP, mas as cores seguem) ---- */
.acesso-cartao { border: 1px solid var(--borda); border-radius: calc(var(--raio) + 4px); box-shadow: var(--sombra-painel); background: var(--cartao); }

/* =============================================================================
   Componentes do MVP que a porta tinha trocado por texto: selo com borda (Badge outline),
   botões de ícone, janela modal (Dialog), avisos flutuantes (toast) e detalhes de tabela.
   ============================================================================= */
.selo { display: inline-flex; align-items: center; gap: 0.25rem; border-radius: calc(var(--raio) - 2px); border: 1px solid var(--borda); background: transparent; color: var(--texto); white-space: nowrap; }
.selo-ok { border-color: var(--sucesso); background: color-mix(in oklab, var(--sucesso) 10%, transparent); color: var(--sucesso); }
.selo-aviso { border-color: var(--alerta); background: color-mix(in oklab, var(--alerta) 10%, transparent); color: var(--alerta); }
.selo-perigo { border-color: var(--perigo); background: color-mix(in oklab, var(--perigo) 10%, transparent); color: var(--perigo); }
.selo-discreto { color: var(--suave-texto); }
.selo .icone { width: 0.875rem; height: 0.875rem; }
.selo-alto { height: 1.75rem; padding: 0 0.5rem; }

/* Botão só com ícone, 28 px (Button size="sm" h-7 w-7 p-0). */
button.icone-acao, a.icone-acao {
    display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; min-height: 0; padding: 0; flex-shrink: 0;
    border: 1px solid var(--borda); border-radius: calc(var(--raio) - 2px); background: var(--fundo); color: var(--texto);
    box-shadow: 0 1px 2px oklch(0 0 0 / 0.05); text-decoration: none; cursor: pointer;
}
.icone-acao .icone { width: 0.875rem; height: 0.875rem; }
button.icone-acao:hover, a.icone-acao:hover { background: var(--suave); }
.icone-acao.primaria { border-color: var(--primaria); color: var(--primaria); }
.icone-acao.primaria:hover { background: color-mix(in oklab, var(--primaria) 10%, transparent); }
.icone-acao.perigo { border-color: var(--perigo); color: var(--perigo); }
.icone-acao.perigo:hover { background: color-mix(in oklab, var(--perigo) 10%, transparent); }
button.icone-acao.cheio-ok { border-color: var(--sucesso); background: var(--sucesso); color: var(--primaria-texto); }
button.icone-acao.cheio-aviso { border-color: var(--alerta); background: var(--alerta); color: var(--texto); }
.icone-acao[disabled], .icone-acao.bloqueado { border-color: var(--borda); color: var(--suave-texto); opacity: 0.5; cursor: not-allowed; }
/* Botão fantasma pequeno com ícone e texto (variant="ghost" size="sm"), e o só-ícone de 36 px. */
button.fantasma { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 2rem; padding: 0 0.75rem; border: 0; background: transparent; font-size: 0.875rem; }
button.fantasma:hover { background: var(--suave); }
button.fantasma .icone { width: 1rem; height: 1rem; }
button.fantasma.so-icone { width: 2.25rem; height: 2.25rem; padding: 0; justify-content: center; }
.botoes-linha { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.25rem; }
button .icone + span, a .icone + span { margin-left: 0.375rem; }
button:has(> .icone) { display: inline-flex; align-items: center; justify-content: center; }

/* Janela modal (Dialog do shadcn): <dialog> nativo, aberto por js/modal.js. */
dialog.modal {
    width: calc(100% - 2rem); max-width: 32rem; max-height: calc(100dvh - 2rem); overflow: auto; padding: 1.5rem;
    border: 1px solid var(--borda); border-radius: var(--raio); background: var(--fundo); color: var(--texto);
    box-shadow: 0 10px 15px -3px oklch(0 0 0 / 0.1), 0 4px 6px -4px oklch(0 0 0 / 0.1);
}
dialog.modal.largo { max-width: 42rem; }
dialog.modal::backdrop { background: oklch(0 0 0 / 0.8); }
dialog.modal[open] { animation: modal-entra 150ms ease-out; }
@keyframes modal-entra { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: none; } }
.modal-titulo { margin: 0 2rem 0.375rem 0; font-size: 1.125rem; font-weight: 600; line-height: 1; letter-spacing: -0.01em; font-family: var(--fonte-texto); }
.modal-descricao { margin: 0 0 1rem; font-size: 0.875rem; color: var(--suave-texto); }
.modal-corpo { display: grid; gap: 0.75rem; font-size: 0.875rem; }
.modal-rodape { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }
.modal-rodape.separado { justify-content: space-between; }
.modal-fechar { position: absolute; top: 1rem; right: 1rem; }
dialog.modal { position: fixed; }
dialog.modal .modal-fechar { width: 1.5rem; height: 1.5rem; min-height: 0; padding: 0; border: 0; background: transparent; opacity: 0.7; }
dialog.modal .modal-fechar:hover { opacity: 1; background: transparent; }
.modal-mensagem:empty { display: none; }
.modal-mensagem p { margin: 0 0 0.75rem; }

/* Avisos flutuantes (toast do sonner): a caixa #mensagem sai do fluxo e fica no canto. */
#mensagem { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: grid; gap: 0.5rem; width: min(22rem, calc(100% - 2rem)); }
#mensagem p {
    margin: 0; padding: 1rem; border: 1px solid var(--borda); border-radius: var(--raio); background: var(--cartao);
    box-shadow: 0 4px 12px oklch(0 0 0 / 0.1); font-size: 0.8125rem; font-weight: 500; cursor: pointer;
}
#mensagem p.erro { color: var(--perigo); border-color: color-mix(in oklab, var(--perigo) 30%, transparent); background: oklch(0.98 0.012 25); }
#mensagem p.aviso-ok { color: var(--sucesso); border-color: color-mix(in oklab, var(--sucesso) 30%, transparent); background: oklch(0.98 0.015 155); }

/* Tabela: linha de grupos (1 · Planejamento ...), divisórias e números. */
.tabela tr.grupos th { height: auto; padding-top: 0.5rem; padding-bottom: 0.5rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.025em; color: var(--primaria); }
.tabela .borda-e { border-left: 1px solid var(--borda); }
.tabela td.compacta { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.texto-ok { color: var(--sucesso); }
.texto-perigo { color: var(--perigo); }
.texto-aviso { color: var(--alerta); }
.numero-tab { font-variant-numeric: tabular-nums; }
/* Caixinha de 20 px da coluna Prod. (material em poder da Produção). */
.caixa-estado { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border: 1px solid var(--borda); border-radius: 2px; color: var(--suave-texto); font-size: 0.75rem; }
.caixa-estado .icone { width: 0.875rem; height: 0.875rem; }
.caixa-estado.ok { border-color: var(--info); background: color-mix(in oklab, var(--info) 15%, transparent); color: var(--info); }
.caixa-estado.ok .icone { width: 1rem; height: 1rem; }
.caixa-estado.falta { border-color: var(--alerta); color: var(--alerta); }

/* Cabeçalho de seção (SectionHeader do MVP): ícone, título e ações à direita. */
.secao-cabecalho { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.75rem; }
.secao-cabecalho > .icone { width: 1.25rem; height: 1.25rem; margin-top: 0.125rem; color: var(--primaria); }
.secao-cabecalho h2 { margin: 0; font-size: 1rem; font-weight: 600; font-family: var(--fonte-texto); }
.legenda-linha { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 1.25rem 0 0.5rem; }
.legenda-linha h3 { margin: 0; font-size: 1rem; font-weight: 600; font-family: var(--fonte-texto); }
.legenda { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; font-size: 0.75rem; color: var(--suave-texto); }
.legenda span { display: inline-flex; align-items: center; gap: 0.25rem; }
.legenda .icone { width: 0.875rem; height: 0.875rem; }
.filtros-linha { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; margin-bottom: 0.5rem; }
.filtros-linha label { display: grid; gap: 0.25rem; font-size: 0.75rem; font-weight: 500; }
.filtros-linha .cresce { flex: 1; min-width: 14rem; }
.filtros-linha .caixa { display: flex; align-items: center; gap: 0.5rem; height: 2.25rem; font-size: 0.875rem; font-weight: 400; }
.filtros-linha input[type=search] { width: 100%; }
.selects-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.selects-linha select { width: 12rem; }
.painel-tabela { padding: 0; overflow-x: auto; }
.rodape-form { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; border-top: 1px solid var(--borda); padding-top: 0.75rem; margin-top: 0.75rem; }
.centro { text-align: center; }
.sem-margem { margin: 0; }
.largura-texto { max-width: 48rem; margin: 0 0 1rem; }
.maiusculas { text-transform: uppercase; }
/* Formulário em grade de 4 colunas (grid gap-3 sm:grid-cols-4) com rótulo em cima. */
.grade-4 { display: grid; gap: 0.75rem; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 0.75rem; }
.grade-4 label, .modal-corpo > label, .modal-rodape label { display: grid; gap: 0.375rem; font-size: 0.875rem; font-weight: 500; }
.grade-4 input, .grade-4 select, .modal-corpo input:not([type=checkbox]):not([type=hidden]), .modal-corpo select, .modal-corpo textarea { width: 100%; }
@media (max-width: 639px) { .grade-4 { grid-template-columns: minmax(0, 1fr); } }
.linha-item-edicao { display: grid; grid-template-columns: 1fr 9rem 7rem; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
/* Caixas de aviso dentro das janelas (rounded-md border p-3). */
.caixa-aviso, .caixa-ok, .caixa-primaria { margin: 0; padding: 0.75rem; border: 1px solid; border-radius: calc(var(--raio) - 2px); }
.caixa-aviso { border-color: var(--alerta); background: color-mix(in oklab, var(--alerta) 10%, transparent); }
.caixa-aviso strong { color: var(--alerta); }
.caixa-ok { border-color: var(--sucesso); background: color-mix(in oklab, var(--sucesso) 10%, transparent); font-weight: 600; }
.caixa-primaria { display: flex; justify-content: space-between; padding: 0.5rem 0.75rem; border-color: color-mix(in oklab, var(--primaria) 40%, transparent); background: color-mix(in oklab, var(--primaria) 10%, transparent); }
.modal-rodape.alinhado-base { align-items: flex-end; }
button.secundario { background: var(--secundaria); border-color: transparent; color: var(--primaria); }
button.secundario:hover { background: color-mix(in oklab, var(--secundaria) 80%, var(--primaria)); }
button.perigo-cheio { background: var(--perigo); border-color: var(--perigo); color: var(--primaria-texto); }
button.perigo-cheio:hover { background: color-mix(in oklab, var(--perigo) 90%, black); }
a.botao-fantasma { display: inline-flex; align-items: center; height: 2rem; padding: 0 0.75rem; border-radius: calc(var(--raio) - 2px); color: var(--texto); font-size: 0.875rem; font-weight: 500; text-decoration: none; }
a.botao-fantasma:hover { background: var(--suave); }
/* Itens do pedido novo: uma linha por item (grid sm:grid-cols-[1fr_130px_140px_140px_auto]). */
.itens-pedido { display: grid; gap: 0.5rem; }
.item-linha { display: grid; gap: 0.5rem; grid-template-columns: minmax(0, 1fr) 130px 140px 140px 2.25rem; align-items: center; }
.item-linha > select, .item-linha > input { width: 100%; }
.campo-fixo { display: flex; align-items: center; min-height: 2.25rem; padding: 0 0.75rem; border: 1px solid var(--borda); border-radius: calc(var(--raio) - 2px); background: var(--suave); font-size: 0.875rem; }
@media (max-width: 639px) { .item-linha { grid-template-columns: minmax(0, 1fr); } }
button.pequeno-botao { min-height: 2rem; padding: 0 0.75rem; font-size: 0.75rem; }
.modal-mensagem p.erro { margin: 0 2rem 0.75rem 0; padding: 0.5rem 0.75rem; border: 1px solid color-mix(in oklab, var(--perigo) 40%, transparent); border-radius: calc(var(--raio) - 2px); background: color-mix(in oklab, var(--perigo) 8%, transparent); font-size: 0.875rem; }
