* {
    box-sizing: border-box;
}

:root {
    --azul: #1557b0;
    --azul-escuro: #0e3975;
    --verde: #167a3f;
    --verde-claro: #e8f7ee;
    --vermelho: #b42318;
    --vermelho-claro: #fff0ee;
    --amarelo: #946200;
    --amarelo-claro: #fff7d6;
    --cinza-100: #f4f6f8;
    --cinza-200: #e5e9ef;
    --cinza-400: #9aa4b2;
    --cinza-700: #344054;
    --texto: #17202a;
    --branco: #ffffff;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: var(--texto);
    background: var(--cinza-100);
}

button,
input {
    font: inherit;
}

.pagina {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 7px 16px 14px;
}


/* =========================================================
   CABEÇALHO
========================================================= */

.cabecalho {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    margin-bottom: 6px;
}

.acao-modo {
    grid-column: 1;
    justify-self: start;
}

.titulo-pagina {
    grid-column: 2;
    text-align: center;
}

.cabecalho h1 {
    margin: 0 0 1px;
    font-size: 21px;
}

.cabecalho p {
    margin: 0;
    color: var(--cinza-700);
    font-size: 13px;
    line-height: 15px;
}

.acoes-topo {
    display: flex;
    grid-column: 3;
    justify-self: end;
    gap: 6px;
}


/* =========================================================
   PAINÉIS
========================================================= */

.painel {
    margin-bottom: 7px;
    padding: 8px 12px;
    border: 1px solid var(--cinza-200);
    border-radius: 9px;
    background: var(--branco);
    box-shadow: 0 2px 7px rgb(16 24 40 / 6%);
}

.painel h2 {
    margin: 0;
    font-size: 16px;
}


/* =========================================================
   INFORMAÇÕES DO ORÇAMENTO
========================================================= */

.linha-identificacao {
    display: grid;
    grid-template-columns:
        170px
        minmax(240px, 1.35fr)
        minmax(190px, 1fr)
        155px
        125px;
    gap: 8px;
    align-items: end;
}

.campo {
    position: relative;
    min-width: 0;
}

.campo label {
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 700;
}

.campo input {
    width: 100%;
    height: 30px;
    padding: 4px 8px;
    border: 1px solid var(--cinza-400);
    border-radius: 6px;
    color: var(--texto);
    background: var(--branco);
    outline: none;
}

.campo input:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 2px rgb(21 87 176 / 15%);
}

.campo input:disabled,
.campo input[readonly] {
    color: #475467;
    background: #f2f4f7;
}

.dado-resumo {
    min-width: 0;
    padding-bottom: 2px;
}

.dado-resumo span {
    display: block;
    margin-bottom: 1px;
    color: var(--cinza-700);
    font-size: 11px;
    text-transform: uppercase;
}

.dado-resumo strong {
    display: block;
    overflow: hidden;
    font-size: 13px;
    line-height: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   RESPONSÁVEL
========================================================= */

.linha-responsavel {
    display: grid;
    grid-template-columns:
        190px
        minmax(260px, 1fr);
    gap: 8px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--cinza-200);
}


/* =========================================================
   MENSAGENS E STATUS
========================================================= */

.mensagem,
.resultado-leitura {
    min-height: 15px;
    margin-top: 4px;
    font-size: 13px;
    line-height: 15px;
    font-weight: 700;
}

.mensagem.sucesso,
.resultado-leitura.sucesso {
    color: var(--verde);
}

.mensagem.erro,
.resultado-leitura.erro {
    color: var(--vermelho);
}

.mensagem.aviso,
.resultado-leitura.aviso {
    color: var(--amarelo);
}

.status {
    color: var(--amarelo);
}

.status.encerrada {
    color: var(--verde);
}


/* =========================================================
   LISTA DE USUÁRIOS
========================================================= */

.lista-usuarios {
    position: absolute;
    z-index: 20;
    top: calc(100% + 3px);
    left: 0;
    width: min(520px, 90vw);
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--cinza-400);
    border-radius: 6px;
    background: var(--branco);
    box-shadow: 0 8px 20px rgb(16 24 40 / 18%);
}

.usuario-opcao {
    display: flex;
    width: 100%;
    padding: 7px 10px;
    border: 0;
    border-bottom: 1px solid var(--cinza-200);
    gap: 10px;
    text-align: left;
    color: var(--texto);
    background: var(--branco);
    cursor: pointer;
}

.usuario-opcao:last-child {
    border-bottom: 0;
}

.usuario-opcao:hover,
.usuario-opcao:focus {
    background: #eef4ff;
}

.usuario-opcao strong {
    min-width: 55px;
    color: var(--azul-escuro);
}


/* =========================================================
   LEITURA E QUANTIDADES
========================================================= */

.painel-leitura {
    padding-top: 7px;
    padding-bottom: 5px;
    border-color: #b8d2f4;
    background: #f8fbff;
}

.linha-leitura-resumo {
    display: grid;
    grid-template-columns:
        minmax(320px, 1fr)
        105px
        105px
        105px
        105px;
    gap: 7px;
    align-items: end;
}

.campo-codigo input {
    height: 38px;
    border-width: 2px;
    border-color: var(--azul);
    font-size: 17px;
    font-weight: 700;
}

.resumo-item {
    min-height: 38px;
    padding: 4px 7px;
    border: 1px solid var(--cinza-200);
    border-radius: 7px;
    background: var(--branco);
}

.resumo-item span {
    display: block;
    margin-bottom: 0;
    color: var(--cinza-700);
    font-size: 11px;
    line-height: 12px;
}

.resumo-item strong {
    display: block;
    font-size: 18px;
    line-height: 19px;
}

.resumo-item.conferidos {
    border-color: #9fd3b2;
    background: var(--verde-claro);
}

.resumo-item.pendentes {
    border-color: #f3b3ad;
    background: var(--vermelho-claro);
}

.resumo-item.excedentes {
    border-color: #e6bd66;
    background: var(--amarelo-claro);
}


/* =========================================================
   PRODUTOS
========================================================= */

.titulo-produtos {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.titulo-produtos span {
    color: var(--cinza-700);
    font-size: 12px;
}

.tabela-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}

th,
td {
    height: 25px;
    padding: 2px 8px;
    border-bottom: 1px solid var(--cinza-200);
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
    line-height: 15px;
}

th {
    color: #344054;
    background: #f2f4f7;
    font-size: 12px;
    text-transform: uppercase;
}

th:nth-child(n + 4),
td:nth-child(n + 4) {
    width: 95px;
    text-align: center;
}

tbody tr.concluido {
    background: var(--verde-claro);
}

tbody tr.excedente {
    background: #ffd9d5;
}

tbody tr.destaque-sucesso {
    animation: sucesso 650ms ease;
}

tbody tr.destaque-erro {
    animation: erro 650ms ease;
}

.valor-conferido {
    color: var(--verde);
    font-weight: 700;
}

.valor-pendente,
.valor-excedente {
    color: var(--vermelho);
    font-weight: 700;
}


/* =========================================================
   BOTÕES
========================================================= */

.botao {
    min-width: 145px;
    min-height: 32px;
    padding: 5px 10px;
    border: 0;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.botao.desfazer {
    color: #7a4d00;
    border: 1px solid #d6a84f;
    background: var(--amarelo-claro);
}

.botao.devolucao {
    color: #7a2e0e;
    border: 1px solid #d5682a;
    background: #fff1e8;
}

.botao.secundario {
    color: var(--azul-escuro);
    border: 1px solid var(--azul);
    background: var(--branco);
}

.botao.principal {
    min-width: 165px;
    color: var(--branco);
    background: var(--verde);
}

.botao:hover:not(:disabled) {
    filter: brightness(0.94);
}

.botao:disabled {
    color: #667085;
    border-color: var(--cinza-200);
    background: #e4e7ec;
    cursor: not-allowed;
}

.oculto {
    display: none !important;
}


/* =========================================================
   JANELA DE QUANTIDADE
========================================================= */

.modal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgb(15 23 42 / 58%);
}

.modal-conteudo {
    width: min(430px, 100%);
    padding: 18px;
    border-radius: 10px;
    background: var(--branco);
    box-shadow: 0 18px 45px rgb(15 23 42 / 30%);
}

.modal-conteudo h2 {
    margin: 0 0 6px;
    font-size: 19px;
}

.modal-conteudo p {
    margin: 0 0 14px;
    color: var(--cinza-700);
    line-height: 19px;
}

.modal-conteudo .campo input {
    height: 42px;
    font-size: 20px;
    font-weight: 700;
}

.modal-acoes {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}


/* =========================================================
   ANIMAÇÕES
========================================================= */

@keyframes sucesso {
    0%,
    100% {
        background: inherit;
    }

    50% {
        background: #a8e2bd;
    }
}

@keyframes erro {
    0%,
    100% {
        background: inherit;
    }

    50% {
        background: #ffaaa2;
    }
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1250px) {
    .cabecalho {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .titulo-pagina {
        width: 100%;
    }

    .acao-modo {
        justify-self: auto;
    }

    .acoes-topo {
        justify-content: center;
    }

    .linha-identificacao {
        grid-template-columns:
            170px
            minmax(210px, 1.25fr)
            minmax(180px, 1fr)
            155px
            125px;
    }
}


/* =========================================================
   TELA MENOR
========================================================= */

@media (max-width: 900px) {
    .linha-identificacao {
        grid-template-columns:
            minmax(170px, 0.8fr)
            minmax(250px, 1.2fr);
    }

    .dado-vendedor {
        grid-column: 1 / -1;
    }

    .linha-leitura-resumo {
        grid-template-columns: repeat(4, 1fr);
    }

    .campo-codigo {
        grid-column: 1 / -1;
    }
}


/* =========================================================
   CELULAR
========================================================= */

@media (max-width: 650px) {
    .pagina {
        padding: 6px 8px 12px;
    }

    .cabecalho {
        gap: 6px;
    }

    .acao-modo {
        width: 100%;
    }

    .acoes-topo {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .botao {
        width: 100%;
        min-width: 0;
    }

    .botao.desfazer {
        grid-column: 1 / -1;
    }

    .painel {
        padding: 7px 9px;
    }

    .linha-identificacao {
        grid-template-columns: 1fr 1fr;
    }

    .campo-orcamento,
    .dado-cliente,
    .dado-vendedor {
        grid-column: 1 / -1;
    }

    .linha-responsavel {
        grid-template-columns: 1fr;
    }

    .linha-leitura-resumo {
        grid-template-columns: 1fr 1fr;
    }

    .campo-codigo {
        grid-column: 1 / -1;
    }

    .resumo-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .modal-acoes {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}