:root {
  --cor: #FFC400;
  --cor-texto: #1c1c1c;
  --cor-forte: #C98A00;
  --fundo: #f4f6f8;
  --cartao: #ffffff;
  --texto: #1f2933;
  --suave: #6b7785;
  --borda: #e3e7eb;
  --ok: #15803d;
  --perigo: #b42318;
  --raio: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
  background: var(--fundo);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.05rem; margin: 0 0 1rem; }
[hidden] { display: none !important; }

/* topo */
.topo {
  background: var(--cor); color: var(--cor-texto); padding: .9rem 1.25rem;
  display: flex; justify-content: space-between; align-items: center;
}
.marca { display: flex; gap: .5rem; align-items: center; font-weight: 700; font-size: 1.1rem; }
.logo { font-size: 1.4rem; }
.tag { background: rgba(0,0,0,.12); font-size: .7rem; padding: .15rem .5rem; border-radius: 99px; font-weight: 600; }

.container { width: 100%; max-width: 640px; margin: 0 auto; padding: 1.25rem; flex: 1; }
.container.largo { max-width: 900px; }
.hero { text-align: center; margin: 1.5rem 0 1.25rem; }
.hero p { color: var(--suave); margin: 0; }
.selo {
  display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .9rem;
  background: #fff4e0; color: #8a4b00; border: 1px solid #f6d9a8;
  padding: .35rem .8rem; border-radius: 99px; font-size: .82rem; font-weight: 600;
}

.cartao {
  background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio);
  padding: 1.25rem; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,.03);
}

/* formulários */
label { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; font-weight: 600; }
label small { font-weight: 400; color: var(--suave); }
input, select {
  font: inherit; padding: .7rem .8rem; border: 1px solid var(--borda); border-radius: 10px;
  background: #fff; color: var(--texto); width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--cor-forte); outline-offset: -1px; border-color: transparent; }
button, .btn-secundario {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 10px;
  padding: .7rem 1.1rem; background: var(--cor); color: var(--cor-texto); text-decoration: none;
  display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap;
}
button:hover { filter: brightness(.95); }
button:disabled { opacity: .6; cursor: wait; }
.btn-secundario { background: #eef1f4; color: var(--texto); font-size: .9rem; padding: .55rem .9rem; }
.btn-texto { background: none; color: inherit; padding: .3rem 0; }
.topo .btn-texto { color: var(--cor-texto); }
#voltar { color: var(--cor-forte); margin-bottom: .75rem; }
.btn-perigo { background: none; color: var(--perigo); border: 1px solid #f3c7c2; }
.erro { color: var(--perigo); font-size: .9rem; min-height: 1em; margin: .5rem 0 0; }

/* busca do cliente */
.busca small { color: var(--suave); display: block; margin-top: .5rem; }
.linha-busca { display: flex; gap: .5rem; margin-top: .4rem; }
.linha-busca input { font-size: 1.05rem; letter-spacing: .02em; }
.aviso { color: var(--suave); text-align: center; }

/* pedido */
.rotulo { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); font-weight: 600; }
.cabecalho-pedido { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.numero-pedido { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.produto { background: #eef1f4; padding: .35rem .7rem; border-radius: 8px; font-size: .9rem; }

.status-atual {
  display: flex; gap: 1rem; align-items: center; margin: 1.25rem 0;
  padding: 1rem; border-radius: 12px;
  background: color-mix(in srgb, var(--cor) 16%, white);
}
.status-atual.ok { background: #e8f6ec; }
.icone-grande { font-size: 2.2rem; }
.titulo-status { font-size: 1.25rem; font-weight: 700; }
.local { margin-top: .15rem; }
.quando { color: var(--suave); font-size: .88rem; margin-top: .15rem; }

/* barra de progresso */
.progresso { list-style: none; padding: 0; margin: 0 0 1.5rem; display: flex; }
.progresso li {
  flex: 1; text-align: center; font-size: .72rem; color: var(--suave); position: relative; padding-top: 1.4rem;
}
.progresso li span {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%; background: var(--borda); z-index: 1;
}
.progresso li::before {
  content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 3px; background: var(--borda);
}
.progresso li:first-child::before { display: none; }
.progresso li.feito span, .progresso li.atual span { background: var(--cor-forte); }
.progresso li.feito::before, .progresso li.atual::before { background: var(--cor-forte); }
.progresso li.atual { color: var(--texto); font-weight: 700; }
.progresso li.atual span { box-shadow: 0 0 0 4px color-mix(in srgb, var(--cor) 45%, white); }

/* linha do tempo */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: .9rem; position: relative; padding-bottom: 1.1rem; }
.timeline li::before {
  content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--borda);
}
.timeline li:last-child::before { display: none; }
.ponto { width: 12px; height: 12px; border-radius: 50%; background: var(--borda); margin-top: 4px; flex-shrink: 0; }
.timeline li.recente .ponto { background: var(--cor-forte); }
.ev-corpo { flex: 1; }
.ev-titulo { font-weight: 600; }
.timeline li:not(.recente) .ev-titulo { color: #4a5560; }
.ev-local { font-size: .9rem; }
.ev-obs { font-size: .9rem; color: var(--suave); font-style: italic; }
.ev-quando { font-size: .8rem; color: var(--suave); margin-top: .1rem; }

/* painel admin */
.login { max-width: 380px; margin: 3rem auto; }
.login form { display: flex; flex-direction: column; gap: .9rem; margin-top: 1rem; }
.barra { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem; }
.largura-total { grid-column: 1 / -1; }
.acoes { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.cabecalho-pedido .acoes { margin-top: 0; }
.filtros { display: flex; gap: 1rem; align-items: center; margin-bottom: .75rem; flex-wrap: wrap; }
#filtro { flex: 1; min-width: 220px; }
.check { flex-direction: row; align-items: center; font-weight: 500; }
.check input { width: auto; }

.lista { display: flex; flex-direction: column; gap: .5rem; }
.item-pedido {
  background: var(--cartao); color: var(--texto); border: 1px solid var(--borda);
  display: flex; align-items: center; gap: .9rem; text-align: left; padding: .9rem 1rem; white-space: normal;
}
.item-pedido:hover { border-color: var(--cor-forte); filter: none; }
.item-pedido.entregue { opacity: .6; }
.item-icone { font-size: 1.5rem; }
.item-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.item-numero { font-weight: 700; font-variant-numeric: tabular-nums; }
.item-sub { font-size: .85rem; color: var(--suave); font-weight: 400; }
.item-status { display: flex; flex-direction: column; align-items: flex-end; font-size: .88rem; text-align: right; }
.item-status small { color: var(--suave); font-weight: 400; }
.btn-remover { background: none; color: var(--suave); padding: .2rem .45rem; font-size: .85rem; align-self: flex-start; }
.btn-remover:hover { color: var(--perigo); }
.zona-perigo { text-align: right; }
.vazio { color: var(--suave); text-align: center; padding: 1.5rem; }
.carregando { text-align: center; color: var(--suave); margin-top: 3rem; }

.toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translate(-50%, 150%);
  background: #1f2933; color: #fff; padding: .7rem 1.1rem; border-radius: 10px;
  transition: transform .25s; font-size: .9rem; z-index: 10;
}
.toast.visivel { transform: translate(-50%, 0); }

.rodape { text-align: center; color: var(--suave); font-size: .8rem; padding: 1.5rem; }

@media (max-width: 560px) {
  .linha-busca { flex-direction: column; }
  .item-status { display: none; }
  h1 { font-size: 1.35rem; }
}

/* produto com foto */
.bloco-produto { display: flex; gap: 1rem; align-items: center; }
.foto-produto {
  width: 88px; height: 88px; object-fit: contain; border-radius: 12px;
  border: 1px solid var(--borda); background: #fff; flex-shrink: 0;
}
.foto-produto.vazia { display: grid; place-items: center; font-size: 2.2rem; background: #f7f8fa; }
.nome-produto { font-size: 1.15rem; font-weight: 700; margin-bottom: .35rem; line-height: 1.25; }
.bloco-produto .numero-pedido { font-size: 1rem; }

.sub { font-weight: 400; color: var(--suave); font-size: .85rem; }
.produto-edicao { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.foto-box {
  width: 140px; height: 140px; border: 1px dashed var(--borda); border-radius: 12px;
  display: grid; place-items: center; color: var(--suave); font-size: .85rem; background: #fafbfc; overflow: hidden;
}
.foto-box img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.campos-produto { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: .9rem; }
.campos-produto input[type=file] { padding: .5rem; }
.btn-tirar-foto { color: var(--perigo); align-self: flex-start; font-size: .9rem; }
.item-foto { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; border: 1px solid var(--borda); background: #fff; }
.dica { display: block; font-weight: 400; color: var(--suave); line-height: 1.4; }
.foto-box.arrastando { border-color: var(--cor-forte); background: color-mix(in srgb, var(--cor) 15%, white); }
