/* SS Salgados Artesanais — cores tiradas do logotipo oficial. */
:root {
  --fundo: #FBF6EE;
  --superficie: #FFFFFF;
  --superficie-2: #F5ECDF;
  --borda: #EADDCB;
  --texto: #2B1A10;
  --texto-suave: #7A6352;
  --marrom: #5A2A14;
  --marrom-forte: #3F1C0C;
  --caramelo: #C8742A;
  --dourado: #E9B04A;
  --creme: #FBF3E6;
  --verde: #2F7D4F;
  --verde-claro: #E3F1E8;
  --vermelho: #B3261E;
  --vermelho-claro: #FBE6E4;
  --amarelo: #9A6100;
  --amarelo-claro: #FCF0D6;
  --azul: #3D5A80;
  --azul-claro: #E5ECF5;
  --sombra: 0 1px 2px rgba(63, 28, 12, .06), 0 6px 18px rgba(63, 28, 12, .06);
  --raio: 16px;
  --raio-p: 10px;
  --titulo: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --corpo: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #17110D;
    --superficie: #221913;
    --superficie-2: #2C2119;
    --borda: #3B2D23;
    --texto: #F6ECDF;
    --texto-suave: #BFAA95;
    --marrom: #E9B04A;
    --marrom-forte: #F3C76E;
    --caramelo: #E08C42;
    --verde: #6BC290;
    --verde-claro: #1B3326;
    --vermelho: #F08A80;
    --vermelho-claro: #3A1C19;
    --amarelo: #F0C060;
    --amarelo-claro: #3A2C12;
    --azul: #9CB6DA;
    --azul-claro: #1E2836;
    --sombra: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 17px/1.45 var(--corpo);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--titulo); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
.suave { color: var(--texto-suave); }
.pequeno { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.oculto { display: none !important; }

/* ---------- Estrutura ---------- */
.topo {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--fundo) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--borda);
}
.topo .marca { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.topo .marca img { width: 36px; height: 36px; border-radius: 50%; }
.topo .marca span { font-family: var(--titulo); font-weight: 600; font-size: 17px; white-space: nowrap; }
.topo .acoes { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.conteudo { max-width: 760px; margin: 0 auto; padding: 18px 16px 96px; }
.cabecalho { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.cabecalho .voltar { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--texto-suave); font-size: 15px; margin-bottom: 6px; min-height: 32px; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--superficie) 94%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--borda);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--texto-suave);
  font-size: 11.5px; font-weight: 500; min-height: 50px; justify-content: center; border-radius: 12px;
}
.nav a svg { width: 25px; height: 25px; }
.nav a.ativo { color: var(--marrom); }
.nav a.ativo svg { stroke-width: 2.2; }
.fab {
  position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 31;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--marrom); color: #FFF6E8; text-decoration: none;
  font-weight: 600; font-size: 16px; padding: 0 20px; height: 54px; border-radius: 27px;
  box-shadow: 0 8px 22px rgba(63, 28, 12, .28);
}
@media (prefers-color-scheme: dark) { .fab { color: #1C120B; } }
.fab svg { width: 22px; height: 22px; }

@media (min-width: 900px) {
  body { padding-bottom: 0; padding-left: 232px; }
  .nav {
    top: 0; right: auto; width: 232px; bottom: 0;
    display: flex; flex-direction: column; gap: 4px;
    padding: 84px 12px 16px; border-top: 0; border-right: 1px solid var(--borda);
    background: var(--superficie);
  }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 16px; padding: 0 14px; min-height: 46px; }
  .nav a.ativo { background: var(--superficie-2); }
  .topo { margin-left: -232px; padding-left: 20px; z-index: 35; }
  .conteudo { padding-bottom: 40px; }
  .fab { top: 12px; bottom: auto; right: 20px; height: 44px; box-shadow: none; position: fixed; z-index: 40; }
  .topo .acoes { margin-right: 170px; }
  .conteudo { padding-top: 28px; }
}

/* ---------- Cartões e listas ---------- */
.cartao {
  background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio);
  box-shadow: var(--sombra); padding: 16px;
}
.cartao + .cartao, .secao + .secao { margin-top: 14px; }
.secao { margin-top: 22px; }
.secao > .titulo-secao { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 10px; }
.secao > .titulo-secao h2 { font-size: 19px; }
.secao > .titulo-secao a { font-size: 15px; color: var(--caramelo); text-decoration: none; font-weight: 600; }
.lista { list-style: none; margin: 0; padding: 0; background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); overflow: hidden; }
.lista > li + li { border-top: 1px solid var(--borda); }
.lista .item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; min-height: 60px; }
.lista .item .principal { flex: 1; min-width: 0; }
.lista .item .linha1 { font-weight: 600; display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.lista .item .linha2 { color: var(--texto-suave); font-size: 14.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .item .valor { font-weight: 600; white-space: nowrap; }
.lista .vazio { padding: 22px 16px; color: var(--texto-suave); text-align: center; }
.grupo-data { margin: 18px 4px 8px; font-size: 14px; font-weight: 700; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .04em; }
.grupo-data:first-child { margin-top: 4px; }
.miniatura { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--superficie-2); flex: none; }
.miniatura.vazia { display: grid; place-items: center; color: var(--texto-suave); }

/* Indicadores */
.numeros { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.numero { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 14px; box-shadow: var(--sombra); text-decoration: none; display: block; }
.numero .rotulo { font-size: 13.5px; color: var(--texto-suave); }
.numero .valor { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.numero .nota { font-size: 12.5px; color: var(--texto-suave); margin-top: 2px; }
.numero.destaque { background: var(--marrom); border-color: var(--marrom); color: #FFF3E2; }
.numero.destaque .rotulo, .numero.destaque .nota { color: #E9CDA8; }
@media (prefers-color-scheme: dark) { .numero.destaque { color: #1C120B; } .numero.destaque .rotulo, .numero.destaque .nota { color: #4A3320; } }
.positivo { color: var(--verde); }
.negativo { color: var(--vermelho); }

/* Etiquetas de situação */
.etiqueta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.etq-novo { background: var(--azul-claro); color: var(--azul); }
.etq-producao { background: var(--amarelo-claro); color: var(--amarelo); }
.etq-pronto { background: var(--verde-claro); color: var(--verde); }
.etq-entregue { background: var(--superficie-2); color: var(--texto-suave); }
.etq-cancelado { background: var(--vermelho-claro); color: var(--vermelho); }
.etq-pago { background: var(--verde-claro); color: var(--verde); }
.etq-parcial { background: var(--amarelo-claro); color: var(--amarelo); }
.etq-pendente { background: var(--vermelho-claro); color: var(--vermelho); }
.etq-neutra { background: var(--superficie-2); color: var(--texto-suave); }

/* Cartão de pedido */
.pedido-cartao { display: block; text-decoration: none; padding: 14px 16px; }
.pedido-cartao .topo-cartao { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.pedido-cartao .cliente { font-weight: 700; font-size: 17px; }
.pedido-cartao .hora { font-variant-numeric: tabular-nums; color: var(--texto-suave); font-size: 15px; white-space: nowrap; }
.pedido-cartao .itens { color: var(--texto-suave); font-size: 14.5px; margin: 4px 0 10px; }
.pedido-cartao .rodape-cartao { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pedido-cartao .rodape-cartao .total { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.avancar { margin-top: 10px; width: 100%; }

/* ---------- Botões ---------- */
.botao {
  -webkit-appearance: none; appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 14px;
  font: 600 16px/1 var(--corpo); text-decoration: none;
  background: var(--superficie-2); color: var(--texto);
  touch-action: manipulation;
}
.botao:active { transform: scale(.98); }
.botao.principal { background: var(--marrom); color: #FFF4E4; }
@media (prefers-color-scheme: dark) { .botao.principal { color: #1C120B; } }
.botao.secundario { background: transparent; border: 1.5px solid var(--borda); }
.botao.perigo { background: transparent; color: var(--vermelho); border: 1.5px solid color-mix(in srgb, var(--vermelho) 35%, transparent); }
.botao.whats { background: #1F8A4C; color: #fff; }
.botao.pequeno { min-height: 38px; padding: 0 12px; font-size: 14.5px; border-radius: 11px; }
.botao.largo { width: 100%; }
.botao[disabled] { opacity: .55; pointer-events: none; }
.botao svg { width: 20px; height: 20px; }
.icone-botao { -webkit-appearance: none; border: 0; background: transparent; color: var(--texto-suave); width: 44px; height: 44px; border-radius: 12px; display: inline-grid; place-items: center; cursor: pointer; text-decoration: none; }
.icone-botao svg { width: 22px; height: 22px; }
.botoes { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.botoes > .botao { flex: 1 1 auto; }

/* Filtros em pílulas */
.filtros { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -16px 6px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.filtros::-webkit-scrollbar { display: none; }
.filtros a { flex: none; text-decoration: none; padding: 8px 14px; border-radius: 999px; background: var(--superficie); border: 1px solid var(--borda); font-size: 15px; font-weight: 500; min-height: 38px; display: inline-flex; align-items: center; }
.filtros a.ativo { background: var(--marrom); border-color: var(--marrom); color: #FFF4E4; }
@media (prefers-color-scheme: dark) { .filtros a.ativo { color: #1C120B; } }

.mes { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--superficie); border: 1px solid var(--borda); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.mes strong { font-weight: 600; }

/* ---------- Formulários ---------- */
.campo { display: block; margin-bottom: 14px; }
.campo > span, .rotulo-campo { display: block; font-size: 14.5px; font-weight: 600; margin: 0 2px 6px; }
.campo > small { display: block; color: var(--texto-suave); font-size: 13.5px; margin: 5px 2px 0; }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; font: 17px/1.3 var(--corpo); color: var(--texto);
  background: var(--superficie); border: 1.5px solid var(--borda); border-radius: 12px;
  padding: 12px 14px; min-height: 50px; -webkit-appearance: none; appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237A6352' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--caramelo); box-shadow: 0 0 0 3px color-mix(in srgb, var(--caramelo) 22%, transparent); }
input[type=date], input[type=time] { min-width: 0; }
.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tres { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
.alternador { display: grid; grid-template-columns: 1fr 1fr; background: var(--superficie-2); border-radius: 13px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.alternador label { position: relative; }
.alternador input { position: absolute; opacity: 0; pointer-events: none; }
.alternador span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 10px; font-weight: 600; font-size: 15.5px; color: var(--texto-suave); cursor: pointer; }
.alternador input:checked + span { background: var(--superficie); color: var(--texto); box-shadow: var(--sombra); }
.marcar { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 500; cursor: pointer; }
.marcar input { width: 24px; height: 24px; accent-color: var(--marrom); flex: none; }
.linha-item { display: grid; grid-template-columns: 1fr 86px 104px 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.linha-item .remover { width: 40px; height: 50px; }
.linha-item .detalhe { grid-column: 1 / -1; margin-top: -2px; }
@media (max-width: 420px) {
  .linha-item { grid-template-columns: 1fr 1fr 76px 40px; }
  .linha-item > select[data-produto] { grid-column: 1 / 3; }
  .linha-item .preco-item { grid-column: 1 / 2; grid-row: 2; }
  .linha-item .detalhe { grid-column: 2 / 5; grid-row: 2; margin-top: 0; }
}
.linha-item + .linha-item { padding-top: 8px; border-top: 1px dashed var(--borda); }
.total-ao-vivo { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; background: var(--superficie-2); border-radius: 14px; font-size: 16px; }
.total-ao-vivo strong { font-size: 22px; font-variant-numeric: tabular-nums; }
fieldset { border: 0; padding: 0; margin: 0 0 6px; }
legend { font-family: var(--titulo); font-size: 18px; font-weight: 600; padding: 0; margin: 8px 0 12px; }

/* ---------- Avisos ---------- */
.aviso { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 15.5px; }
.aviso.ok { background: var(--verde-claro); color: var(--verde); }
.aviso.erro { background: var(--vermelho-claro); color: var(--vermelho); }
.aviso.info { background: var(--amarelo-claro); color: var(--amarelo); }
.toast { position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--texto); color: var(--fundo); padding: 12px 18px; border-radius: 14px; font-weight: 600; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: calc(100vw - 32px); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* Detalhe */
.detalhes { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 16px; }
.detalhes dt { color: var(--texto-suave); }
.detalhes dd { margin: 0; text-align: right; font-weight: 500; }
.tabela { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.tabela td, .tabela th { padding: 10px 0; border-bottom: 1px solid var(--borda); text-align: left; vertical-align: top; }
.tabela th { color: var(--texto-suave); font-weight: 600; font-size: 13.5px; }
.tabela .dir { text-align: right; white-space: nowrap; }
.tabela tr:last-child td { border-bottom: 0; }
.etapas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.etapas button { min-height: 52px; border-radius: 12px; border: 1.5px solid var(--borda); background: var(--superficie); font: 600 13.5px/1.15 var(--corpo); color: var(--texto-suave); cursor: pointer; padding: 4px; }
.etapas button.feito { background: var(--superficie-2); color: var(--texto); }
.etapas button.atual { background: var(--marrom); border-color: var(--marrom); color: #FFF4E4; }
@media (prefers-color-scheme: dark) { .etapas button.atual { color: #1C120B; } }
.foto-produto { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--raio); background: var(--superficie-2); }
.anexos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.anexos a { display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--superficie-2); position: relative; }
.anexos a img { width: 100%; height: 100%; object-fit: cover; }
.anexos .pdf { display: grid; place-items: center; height: 100%; font-weight: 700; color: var(--texto-suave); }
.envio { position: relative; }
.envio input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.progresso { height: 6px; background: var(--superficie-2); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progresso > div { height: 100%; width: 0; background: var(--caramelo); transition: width .15s; }

/* Entrar */
.tela-entrar { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); text-align: center; }
body.sem-nav { padding: 0; }
.tela-entrar .logo { width: 168px; height: 168px; border-radius: 50%; margin: 0 auto 22px; box-shadow: 0 10px 30px rgba(63,28,12,.18); }
.tela-entrar h1 { font-size: 26px; }
.tela-entrar p { color: var(--texto-suave); margin: 8px 0 26px; }
.tela-entrar .google { display: flex; justify-content: center; min-height: 48px; }

dialog { border: 0; border-radius: 18px; padding: 22px; max-width: min(420px, calc(100vw - 32px)); background: var(--superficie); color: var(--texto); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(30, 18, 10, .45); }
dialog h2 { margin-bottom: 8px; }
