* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 180px; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f3f5f9; color: #1d2433; font-size: 17px; line-height: 1.35;
}
.topo { position: sticky; top: 0; z-index: 10; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); padding: 10px 14px 0; }
.topo-linha { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.topo h1 { font-size: 1.15rem; margin: 0 0 8px; }
.topo-linha h1 { margin-bottom: 0; }
.sair { flex: 0 0 auto; min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.barra { height: 14px; background: #e3e7ef; border-radius: 99px; overflow: hidden; }
.barra-fill { height: 100%; width: 0; background: var(--cor, #f2994a); border-radius: 99px; transition: width .3s; }
.topo .barra-fill { background: linear-gradient(90deg, #2f80ed, #27ae60); }
.geral-info { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: #4a5568; margin: 5px 0 8px; }
.abas { display: flex; gap: 8px; }
.aba {
  flex: 1; border: 0; border-bottom: 5px solid transparent; background: #f3f5f9; border-radius: 12px 12px 0 0;
  padding: 10px 6px; font: inherit; color: #1d2433; display: flex; flex-direction: column; align-items: center; cursor: pointer; min-height: 56px;
}
.aba small { color: #667; }
.aba.ativa { background: var(--cor); color: #fff; }
.aba.ativa small { color: #fff; opacity: .9; }

main { max-width: 760px; margin: 0 auto; padding: 14px 12px 80px; }
.resumo { background: #fff; border-radius: 16px; padding: 14px; border-left: 8px solid var(--cor); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.resumo-topo { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.resumo h2 { margin: 0; color: var(--cor); }
.resumo-topo span { color: #667; font-size: .9rem; }

.ferramentas { margin: 14px 0; display: grid; gap: 10px; }
#busca { width: 100%; padding: 14px; font-size: 1rem; border: 2px solid #d5dbe7; border-radius: 12px; background: #fff; }
#busca:focus, .campos input:focus { outline: 0; border-color: var(--cor); }
.filtros, .acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.chip, .btn {
  font: inherit; font-size: .95rem; border: 2px solid #d5dbe7; background: #fff; border-radius: 99px;
  padding: 12px 16px; min-height: 48px; cursor: pointer; color: #1d2433;
}
.chip { flex: 1; text-align: center; }
.chip.ativo { background: var(--cor); border-color: var(--cor); color: #fff; font-weight: 600; }
.btn { border-radius: 12px; flex: 1; }
.btn.perigo, .btn.perigo-leve { color: #c0392b; border-color: #e8b4ae; }
.btn.perigo { background: #c0392b; color: #fff; border-color: #c0392b; }

.cat { margin-top: 20px; }
.cat h2 { font-size: 1.05rem; margin: 0 0 8px; color: var(--cor); display: flex; justify-content: space-between; gap: 8px; }
.cat h2 small { color: #667; font-weight: normal; white-space: nowrap; }
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item { background: #fff; border-radius: 14px; border: 2px solid transparent; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.linha { display: flex; gap: 14px; align-items: flex-start; padding: 14px; cursor: pointer; }
.linha input { position: absolute; opacity: 0; width: 0; height: 0; }
.caixa {
  flex: 0 0 34px; height: 34px; border: 3px solid var(--cor); border-radius: 10px; background: #fff;
  display: grid; place-items: center; margin-top: 1px;
}
.linha input:checked + .caixa { background: var(--cor); }
.linha input:checked + .caixa::after { content: "✓"; color: #fff; font-size: 24px; font-weight: 700; line-height: 1; }
.linha input:focus-visible + .caixa { outline: 3px solid #1d2433; outline-offset: 2px; }
.texto { display: grid; gap: 3px; min-width: 0; }
.nome { font-weight: 600; overflow-wrap: anywhere; }
.qtd { display: inline-block; background: var(--cor); color: #fff; border-radius: 99px; padding: 1px 10px; font-size: .8rem; font-weight: 600; white-space: nowrap; vertical-align: 1px; }
.obs { font-size: .88rem; color: #5a6578; overflow-wrap: anywhere; }
.nota-resumo, .preco-resumo { font-size: .88rem; color: #333; }
.preco-resumo { font-weight: 700; color: #1b7a43; }
.item.feito { background: #eef0f4; }
.item.feito .nome, .item.feito .obs { text-decoration: line-through; color: #98a0ae; }
.item.feito .qtd { background: #b9c0cc; }

details { padding: 0 14px 10px 62px; }
summary { cursor: pointer; font-size: .9rem; color: var(--cor); padding: 8px 0; min-height: 40px; }
.campos { display: grid; gap: 10px; }
.campos label { display: grid; gap: 4px; font-size: .85rem; color: #4a5568; }
.campos input { padding: 12px; font-size: 1rem; border: 2px solid #d5dbe7; border-radius: 10px; width: 100%; }
.vazio { text-align: center; color: #667; margin-top: 30px; }

.status { position: fixed; left: 12px; right: 12px; bottom: 12px; padding: 12px; border-radius: 12px; display: none; text-align: center; color: #fff; background: #333; }
.status.visivel { display: block; }
.status.erro { background: #c0392b; }

dialog { border: 0; border-radius: 16px; padding: 20px; max-width: 360px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0,0,0,.5); }
.dlg-botoes { display: flex; gap: 10px; margin-top: 16px; }

.login { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: min(100%, 420px); padding: 24px; background: #fff; border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,.1); }
.login-card h1 { margin: 0 0 8px; font-size: 1.2rem; }
.login-card p { color: #4a5568; }
.login-card label { display: block; margin: 18px 0 6px; font-weight: 600; }
.login-card input { width: 100%; padding: 14px; font: inherit; border: 2px solid #d5dbe7; border-radius: 10px; }
.login-card input:focus { outline: 0; border-color: #2f80ed; }
.login-erro { min-height: 1.35em; margin: 8px 0; color: #c0392b !important; font-size: .9rem; }
.login-submit { width: 100%; background: #2f80ed; color: #fff; border-color: #2f80ed; }
