* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


body {
    font-family: Arial, Helvetica, sans-serif;

    background: #f4f7f5;

    color: #1f2937;

    padding-bottom: 88px;
}


button,
input,
select {
    font: inherit;
}


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

.topo {

    background: #16a34a;

    color: white;

    padding: 15px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    position: sticky;

    top: 0;

    z-index: 20;

    box-shadow:
        0 2px 8px rgba(0,0,0,.15);

}


.topo h1 {

    font-size: 21px;

    margin-bottom: 4px;

}


.topo p {

    font-size: 12px;

    opacity: .9;

}


.btn-header {

    border: none;

    background: white;

    color: #15803d;

    border-radius: 12px;

    padding: 10px 12px;

    font-weight: 700;

    white-space: nowrap;

    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);

}


.btn-primario {

    background: linear-gradient(135deg, #2ecb6a 0%, #16a34a 100%);

    color: white;

    border: none;

    border-radius: 12px;

    font-weight: 700;

    box-shadow: 0 10px 18px rgba(22, 163, 74, 0.22);

    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;

    cursor: pointer;

}


.btn-primario:hover {

    transform: translateY(-1px);

    box-shadow: 0 14px 26px rgba(22, 163, 74, 0.28);

    filter: brightness(1.03);

}


.btn-secundario {

    background: #f3f4f6;

    color: #374151;

    border: none;

    border-radius: 12px;

    font-weight: 600;

    cursor: pointer;

    transition: background .15s ease, transform .15s ease;

}


.btn-secundario:hover {

    background: #e5e7eb;

    transform: translateY(-1px);

}


.btn-icon {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 48px;

    min-height: 48px;

    padding: 0 14px;

    font-size: 18px;

}


.btn-header-action {

    padding: 11px 18px;

    font-size: 15px;

    letter-spacing: 0.01em;

}


/* =====================================================
   CONTEÚDO
===================================================== */

.conteudo {

    width: 100%;

    max-width: 700px;

    margin: auto;

    padding: 14px;

}


.tela {

    display: none;

}


.tela.ativa {

    display: block;

}


.cadastro-screen {

    padding-top: 8px;

}


.rodape-navegacao {

    position: fixed;

    bottom: 0;

    left: 50%;

    transform: translateX(-50%);

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 6px;

    width: min(100%, 700px);

    margin: 0;

    padding: 8px 14px calc(8px + env(safe-area-inset-bottom));

    background: rgba(255, 255, 255, 0.96);

    border-top: 1px solid #e5ebe6;

    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.07);

    z-index: 30;

    backdrop-filter: blur(12px);

}


.nav-item {

    border: none;

    background: transparent;

    color: #6b7280;

    border-radius: 10px;

    padding: 9px 5px;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    transition: background .15s ease, color .15s ease;

}


.nav-item.active {

    background: #ecfdf3;

    color: #15803d;

    box-shadow: inset 0 0 0 1px #bbf7d0;

}


.nav-item:hover {

    background: #f3f4f6;

}


.cadastro-topo {

    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 14px;

}


.cadastro-topo h2 {

    font-size: 22px;

    color: #166534;

}


.btn-voltar {

    border: none;

    background: #f3f4f6;

    color: #374151;

    border-radius: 10px;

    padding: 8px 12px;

    font-weight: 700;

    cursor: pointer;

}


.cadastro-card {

    background: white;

    border-radius: 18px;

    padding: 18px;

    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);

    border: 1px solid #edf2ee;

}


/* =====================================================
   PESQUISA
===================================================== */

.barra-acoes {

    display: flex;

    gap: 8px;

    margin-bottom: 12px;

}


.pesquisa {

    flex: 1;

    min-width: 0;

    background: white;

    border: 1px solid #d1d5db;

    border-radius: 14px;

    display: flex;

    align-items: center;

    gap: 7px;

    padding: 0 12px;

    box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04);

    transition: border-color .15s ease, box-shadow .15s ease;

}


.pesquisa:focus-within {

    border-color: #22c55e;

    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);

}


.pesquisa input {

    width: 100%;

    border: none;

    outline: none;

    padding: 12px 0;

    background: transparent;

    font-size: 15px;

}


.btn-scanner {

    border: none;

    border-radius: 12px;

    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);

    color: white;

    padding: 0 13px;

    font-weight: bold;

    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.22);

    transition: transform .15s ease, box-shadow .15s ease;

}


.btn-scanner:hover {

    transform: translateY(-1px);

    box-shadow: 0 12px 24px rgba(22, 163, 74, 0.28);

}


/* =====================================================
   RESUMO
===================================================== */

.resumo {

    background: white;

    border-radius: 16px;

    padding: 12px 15px;

    display: flex;

    justify-content: space-around;

    margin-bottom: 14px;

    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);

    border: 1px solid #edf1ee;

}


.resumo div {

    text-align: center;

    min-width: 100px;

}


.resumo span {

    display: block;

    color: #6b7280;

    font-size: 12px;

    margin-bottom: 3px;

}


.resumo strong {

    color: #16a34a;

    font-size: 19px;

}


/* =====================================================
   LISTA
===================================================== */

.lista-area {

    background: white;

    border-radius: 16px;

    padding: 14px;

    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);

    border: 1px solid #edf2ee;

}


.titulo-lista {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 10px;

    margin-bottom: 10px;

    padding-bottom: 8px;

    border-bottom: 1px solid #eef2f0;

}


.titulo-lista h2 {

    font-size: 18px;

    color: #166534;

    font-weight: 700;

}


.btn-limpar {

    border: none;

    background: #f0fdf4;

    color: #15803d;

    padding: 7px 9px;

    border-radius: 8px;

    font-size: 12px;

}


/* =====================================================
   SETORES / CATEGORIAS
===================================================== */

.setor {

    border: 1px solid #e5e7eb;

    border-radius: 14px;

    overflow: hidden;

    margin-top: 10px;

    background: white;

    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);

}


.cabecalho-setor {

    width: 100%;

    border: none;

    background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);

    color: #166534;

    padding: 12px 13px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    font-weight: 700;

    cursor: pointer;

}


.setor-nome {

    display: flex;

    align-items: center;

    gap: 7px;

    text-align: left;

}


.setor-quantidade {

    font-size: 12px;

    color: #6b7280;

    display: flex;

    align-items: center;

    gap: 7px;

}


.seta {

    font-size: 12px;

    transition: transform .2s;

}


.conteudo-setor {

    padding: 0 10px;

}


.setor.fechado
.conteudo-setor {

    display: none;

}


.setor.fechado
.seta {

    transform: rotate(-90deg);

}


/* =====================================================
   PRODUTO
===================================================== */

.produto {

    display: grid;

    grid-template-columns:
        36px
        minmax(0, 1fr)
        auto
        30px;

    gap: 7px;

    align-items: center;

    padding: 12px 8px;

    border-bottom: 1px solid #e5e7eb;

    border-radius: 10px;

    transition: background .15s ease, transform .15s ease;

}

.produto-catalogo {

    grid-template-columns:
        minmax(0, 1fr)
        auto
        30px;

}


.produto-acoes {

    grid-column: 1 / -1;

    display: flex;

    justify-content: flex-end;

    padding-top: 3px;

}


.btn-alternar-lista,
.btn-remover-lista {

    border: 1px solid #bbf7d0;

    border-radius: 9px;

    padding: 8px 12px;

    background: #ecfdf3;

    color: #15803d;

    font-size: 12px;

    font-weight: 700;

    cursor: pointer;

}


.btn-alternar-lista.selecionado {

    background: #f3f4f6;

    border-color: #e5e7eb;

    color: #4b5563;

}


.btn-remover-lista {

    background: white;

    border-color: #e5e7eb;

    color: #6b7280;

}


.produto:hover {

    background: #f9fdf9;

}


.produto:last-child {

    border-bottom: none;

}


.produto.comprado {

    opacity: .58;

}


.produto.comprado
.produto-info strong {

    text-decoration: line-through;

}


/* =====================================================
   CHECK
===================================================== */

.check {

    width: 33px;

    height: 33px;

    border: 2px solid #16a34a;

    border-radius: 10px;

    background: white;

    color: white;

    font-size: 20px;

    font-weight: bold;

    display: flex;

    align-items: center;

    justify-content: center;

    transition: background .15s ease, transform .15s ease, box-shadow .15s ease;

}


.check:hover {

    transform: translateY(-1px);

    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.12);

}


.check.marcado {

    background: #16a34a;

    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.18);

}


/* =====================================================
   PRODUTO INFO
===================================================== */

.produto-info {

    min-width: 0;

}


.produto-info strong {

    display: block;

    font-size: 14px;

    line-height: 1.3;

    overflow-wrap: anywhere;

}


.produto-info small {

    display: block;

    color: #9ca3af;

    font-size: 9px;

    margin-top: 4px;

    overflow-wrap: anywhere;

}


/* =====================================================
   PREÇOS
===================================================== */

.precos {

    display: flex;

    gap: 8px;

    align-items: center;

    text-align: right;

}


.precos > div {

    min-width: 52px;

}


.precos span {

    display: block;

    color: #9ca3af;

    font-size: 9px;

    margin-bottom: 2px;

}


.precos strong {

    display: block;

    font-size: 11px;

    color: #4b5563;

    white-space: nowrap;

}


.precos .preco-atual {

    color: #16a34a;

    font-size: 12px;

}


/* =====================================================
   LÁPIS
===================================================== */

.btn-editar {

    width: 30px;

    height: 30px;

    border: none;

    background: #f3f4f6;

    border-radius: 8px;

    cursor: pointer;

    font-size: 16px;

    display: flex;

    align-items: center;

    justify-content: center;

    transition: background .15s ease, transform .15s ease;

}


.btn-editar:hover {

    background: #e5e7eb;

    transform: translateY(-1px);

}


/* =====================================================
   LISTA VAZIA
===================================================== */

.lista-vazia {

    text-align: center;

    color: #9ca3af;

    padding: 35px 10px;

}


/* =====================================================
   MODAIS
===================================================== */

.modal {

    position: fixed;

    inset: 0;

    background: rgba(15, 23, 42, 0.5);

    display: flex;

    justify-content: center;

    align-items: center;

    z-index: 100;

    padding: 12px;

}


.modal.oculto {

    display: none;

}


.modal-conteudo {

    width: min(100%, 500px);

    background: white;

    border-radius: 20px;

    padding: 20px;

    position: relative;

    max-height: 92vh;

    overflow: auto;

    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);

}


.modal-cabecalho {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    margin-bottom: 18px;

}


.modal-cabecalho h2 {

    font-size: 19px;

}


.btn-fechar {

    border: none;

    background: transparent;

    color: #6b7280;

    font-size: 28px;

    line-height: 1;

    cursor: pointer;

    padding: 0;

}


.modal-conteudo label {

    display: block;

    font-size: 13px;

    font-weight: bold;

    margin-bottom: 12px;

}


.modal-conteudo label small {

    color: #6b7280;

    font-weight: normal;

}


.modal-conteudo input,
.modal-conteudo select {

    width: 100%;

    display: block;

    margin-top: 6px;

    border: 1px solid #d1d5db;

    border-radius: 9px;

    padding: 12px;

    outline: none;

    background: white;

}


.modal-conteudo input:focus,
.modal-conteudo select:focus {

    border-color: #16a34a;

}


.modal-botoes {

    display: flex;

    gap: 10px;

    margin-top: 18px;

}


.btn-cancelar,
.btn-salvar {

    flex: 1;

    border: none;

    border-radius: 10px;

    padding: 12px 14px;

    font-weight: bold;

    cursor: pointer;

}


.btn-cancelar {

    background: #f3f4f6;

    color: #374151;

}


.btn-salvar {

    background: #16a34a;

    color: white;

}


#modalPreco input {

    font-size: 18px;

    font-weight: bold;

    text-align: center;

}


#nomeProdutoPreco {

    background: #f0fdf4;

    color: #15803d;

    border-radius: 9px;

    padding: 10px;

    margin-bottom: 15px;

    font-size: 14px;

    font-weight: bold;

}


.campo-codigo-barras {

    display: flex;

    align-items: center;

    gap: 8px;

    width: 100%;

    box-sizing: border-box;

}


.campo-codigo-barras input {

    flex: 1 1 auto;

    width: 0;

    min-width: 0;

    box-sizing: border-box;

}


.cadastro-card label {

    display: block;

    font-size: 13px;

    font-weight: 700;

    margin: 14px 0 8px;

}


.cadastro-card input,
.cadastro-card select {

    width: 100%;

    border: 1px solid #d1d5db;

    border-radius: 10px;

    padding: 12px;

    background: white;

    outline: none;

}


.cadastro-card input:focus,
.cadastro-card select:focus {

    border-color: #16a34a;

    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.08);

}


.nova-categoria {

    display: flex;

    gap: 8px;

    margin: -2px 0 14px;

}


.nova-categoria input {

    flex: 1;

    min-width: 0;

}


.btn-adicionar-categoria {

    flex: 0 0 auto;

    border: 1px solid #bbf7d0;

    border-radius: 10px;

    padding: 0 12px;

    background: #ecfdf3;

    color: #15803d;

    font-size: 13px;

    font-weight: 700;

    cursor: pointer;

}


.btn-ler-codigo {

    flex: 0 0 auto;

    min-width: 75px;

    height: 44px;

    padding: 0 12px;

    border: none;

    border-radius: 10px;

    background: #16a34a;

    color: white;

    font-size: 14px;

    font-weight: 600;

    white-space: nowrap;

    cursor: pointer;

}


.btn-ler-codigo:active {

    transform: scale(0.97);

}


.scanner-conteudo {

    width: min(100%, 560px);

}


.area-camera {

    position: relative;

    width: 100%;

    aspect-ratio: 4 / 3;

    background: #111827;

    border-radius: 13px;

    overflow: hidden;

}


.area-camera video {

    width: 100%;

    height: 100%;

    object-fit: cover;

    display: block;

}


.mira-scanner {

    position: absolute;

    width: 72%;

    height: 28%;

    left: 14%;

    top: 36%;

    border: 2px solid #22c55e;

    border-radius: 8px;

    box-shadow: 0 0 0 9999px rgba(0,0,0,.18);

}


.status-scanner {

    min-height: 36px;

    padding: 10px 0 0;

    color: #374151;

    font-size: 13px;

}


.btn-fechar-camera {

    width: 100%;

    margin-top: 12px;

}


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

@media (max-width: 480px) {

    .topo h1 {

        font-size: 19px;

    }


    .topo p {

        font-size: 11px;

    }


    .btn-header {

        padding: 8px 9px;

        font-size: 12px;

    }


    .btn-scanner {

        padding: 0 10px;

        font-size: 12px;

    }


    .produto {

        grid-template-columns:
            34px
            minmax(0, 1fr)
            auto
            27px;

        gap: 5px;

    }

    .produto-catalogo {

        grid-template-columns:
            minmax(0, 1fr)
            auto
            27px;

    }


    .produto-info strong {

        font-size: 13px;

    }


    .produto-info small {

        font-size: 8px;

    }


    .precos {

        gap: 5px;

    }


    .precos > div {

        min-width: 46px;

    }


    .precos strong {

        font-size: 10px;

    }


    .precos .preco-atual {

        font-size: 11px;

    }


    .btn-editar {

        width: 26px;

        height: 26px;

        font-size: 15px;

    }


    .cabecalho-setor {

        padding: 11px;

    }

}
