/* Tema único da Ametiê: fundo off-white (#F7F7F7), menu e seleções no vinho (#800112), escolhas especiais no verde (#2D351D). */
:root {
  color-scheme: light;
  --fundo: #F7F7F7;
  --cartao: #FFFFFF;
  --texto: #111111;
  --suave: #6B6B6B;
  --linha: #E6E4E1;
  --vinho: #800112;
  --vinho-escuro: #56000C;
  --vinho-claro: #F5E4E6;
  --vinho-2: #DDB3B8;
  --musgo: #2D351D;
  --musgo-claro: #E4E7DC;
  --musgo-2: #B9C2A4;
  --vermelho: #B3261E;
  --vermelho-claro: #FBE7E5;
  --ambar: #9A6A12;
  --ambar-claro: #FBF0D6;
  --zap: #1FA855;
  --sombra: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 18px rgba(0, 0, 0, .07);
  --raio: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--fundo); color: var(--texto); font: 18px/1.4 "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: Fraunces, Georgia, serif; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 15px; font-family: "Atkinson Hyperlegible", sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); margin: 26px 0 10px; }
h3 { font-size: 21px; }
.num-tab { font-variant-numeric: tabular-nums; }

.app { min-height: 100%; display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; }
main { flex: 1; padding: calc(18px + env(safe-area-inset-top, 0px)) 16px 110px; }
.carregando { padding: 40px 16px; text-align: center; color: var(--suave); }

.topo { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.topo small { display: block; color: var(--suave); font-size: 15px; }
.topo .logo-topo { width: 52px; height: auto; flex: none; }
.voltar { border: 0; background: var(--cartao); color: var(--texto); box-shadow: var(--sombra); width: 46px; height: 46px; border-radius: 50%; font-size: 22px; cursor: pointer; flex: none; }

/* cartões de número: o destaque (vendeu hoje) é a escolha especial, em verde */
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.num { background: var(--cartao); color: var(--texto); border-radius: var(--raio); padding: 16px; box-shadow: var(--sombra); text-align: left; border: 0; }
.num small { display: block; color: var(--suave); font-size: 14px; font-weight: 700; }
.num strong { display: block; font: 700 clamp(22px, 7vw, 30px)/1.15 Fraunces, Georgia, serif; margin: 4px 0 2px; white-space: nowrap; }
.num span { font-size: 14px; color: var(--suave); }
.num.destaque { background: var(--musgo); color: #fff; }
.num.destaque small, .num.destaque span { color: #D6DCC6; }
.num.alerta { background: var(--ambar-claro); cursor: pointer; }
.num.alerta strong, .num.alerta small { color: var(--ambar); }
.num.cheio { grid-column: 1 / -1; }

/* botões: ação comum em vinho, ação especial (confirmar venda, chegou mais) em verde */
.botao { border: 0; background: var(--vinho); color: #fff; min-height: 58px; padding: 12px 18px; border-radius: 16px; font-weight: 700; font-size: 19px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.botao.leve { background: var(--cartao); color: var(--vinho); border: 2px solid var(--vinho-2); }
.botao.verde { background: var(--zap); }
.botao.musgo { background: var(--musgo); }
.botao.perigo { background: var(--cartao); color: var(--vermelho); border: 2px solid var(--vermelho-claro); }
.botao.pequeno { min-height: 44px; font-size: 16px; padding: 8px 14px; width: auto; border-radius: 12px; }
.botao:disabled { opacity: .45; cursor: default; }
.atalhos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.atalho { background: var(--cartao); border: 0; box-shadow: var(--sombra); border-radius: var(--raio); padding: 16px 12px; display: grid; gap: 6px; justify-items: center; cursor: pointer; font-weight: 700; font-size: 17px; color: var(--texto); }
.atalho .ic { width: 46px; height: 46px; border-radius: 14px; background: var(--vinho-claro); color: var(--vinho); display: grid; place-items: center; font-size: 24px; }

.lista { background: var(--cartao); border-radius: var(--raio); box-shadow: var(--sombra); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 68px; border: 0; border-bottom: 1px solid var(--linha); cursor: pointer; text-align: left; width: 100%; background: none; color: var(--texto); }
.item.fixo { cursor: default; }
.item.parcela .meio b { white-space: normal; }
.item.parcela .valor { font-size: 17px; }
.item:last-child { border-bottom: 0; }
.item .meio { flex: 1; min-width: 0; }
.item .meio b { display: block; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meio small { color: var(--suave); font-size: 15px; display: block; }
.item .valor { font-weight: 700; white-space: nowrap; font-size: 18px; text-align: right; }
.item .valor small { display: block; font-weight: 400; color: var(--suave); font-size: 14px; }
.item .seta { color: var(--vinho-2); font-size: 22px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--vinho-claro); color: var(--vinho); display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--vinho-claro); color: var(--vinho); margin-left: 6px; vertical-align: middle; }
.tag.parado { background: var(--ambar-claro); color: var(--ambar); }
.tag.atrasado { background: var(--vermelho-claro); color: var(--vermelho); }
.tag.ok { background: var(--musgo-claro); color: var(--musgo); }
.tag.zero { background: var(--vermelho-claro); color: var(--vermelho); }
.vazio { padding: 28px 16px; text-align: center; color: var(--suave); }
.pos { color: var(--musgo); }
.neg { color: var(--vermelho); }

/* abas e chips: seleção de menu em vinho */
.abas { display: flex; background: var(--linha); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.abas button { flex: 1; border: 0; background: transparent; padding: 12px 6px; border-radius: 11px; font-weight: 700; cursor: pointer; color: var(--suave); font-size: 16px; }
.abas button.on { background: var(--vinho); color: #fff; box-shadow: var(--sombra); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chip { flex: none; border: 2px solid var(--linha); background: var(--cartao); color: var(--texto); padding: 9px 16px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 16px; white-space: nowrap; }
.chip.on { background: var(--vinho); border-color: var(--vinho); color: #fff; }
.mes-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.mes-nav b { font-family: Fraunces, Georgia, serif; font-size: 20px; }

.form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 15px; font-weight: 700; color: var(--suave); }
input, select, textarea { width: 100%; padding: 14px 16px; border: 2px solid var(--linha); border-radius: 14px; background: var(--cartao); font-size: 19px; color: var(--texto); }
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--vinho); outline-offset: 1px; }
.busca { position: relative; margin-bottom: 12px; }
.busca input { padding-left: 46px; }
.busca span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--suave); font-size: 20px; }
.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tres { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.opcoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* opção escolhida no formulário (forma de pagamento, vezes, pra quem): escolha especial, em verde */
.opcao { border: 2px solid var(--linha); background: var(--cartao); padding: 14px 10px; border-radius: 14px; font-weight: 700; font-size: 18px; cursor: pointer; display: grid; gap: 2px; justify-items: center; color: var(--texto); }
.opcao small { font-weight: 400; color: var(--suave); font-size: 14px; }
.opcao.on { border-color: var(--musgo); background: var(--musgo); color: #fff; }
.opcao.on small { color: #D6DCC6; }
.total-venda { background: var(--musgo); color: #fff; border-radius: var(--raio); padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; }
.total-venda small { display: block; color: #D6DCC6; font-size: 15px; }
.total-venda strong { font: 700 34px/1 Fraunces, Georgia, serif; }
.passo { display: flex; align-items: center; gap: 10px; margin: 20px 0 10px; }
.passo b { width: 32px; height: 32px; border-radius: 50%; background: var(--vinho); color: #fff; display: grid; place-items: center; font-size: 16px; flex: none; }
.passo h3 { font-size: 20px; }
.passo .feito { margin-left: auto; color: var(--musgo); font-weight: 700; font-size: 15px; }
.qtd { display: inline-flex; align-items: center; gap: 4px; }
.qtd button { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--vinho-2); background: var(--cartao); font-size: 22px; cursor: pointer; color: var(--vinho); }
.qtd b { min-width: 28px; text-align: center; font-size: 20px; }
.fiado-caixa { background: var(--cartao); border: 2px solid var(--musgo-2); border-radius: 14px; padding: 14px; display: grid; gap: 12px; margin-top: 12px; }
.erro { color: var(--vermelho); font-weight: 700; text-align: center; margin: 0; font-size: 16px; }

.ficha-topo { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin-bottom: 14px; }
.ficha-topo .avatar { width: 64px; height: 64px; font-size: 26px; }
.dados { background: var(--cartao); border-radius: var(--raio); box-shadow: var(--sombra); padding: 4px 16px; }
.dado { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linha); }
.dado:last-child { border-bottom: 0; }
.dado small { color: var(--suave); font-size: 15px; font-weight: 700; }
.dado b { text-align: right; }

#aviso { position: fixed; left: 50%; bottom: calc(104px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--musgo); color: #fff; padding: 12px 20px; border-radius: 99px; font-weight: 700; transition: .25s; pointer-events: none; z-index: 30; max-width: 92vw; text-align: center; line-height: 1.3; box-shadow: var(--sombra); }
#aviso.on { opacity: 1; transform: translateX(-50%); }
#aviso.ruim { background: var(--vermelho); }
.folha-fundo { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.folha { background: var(--fundo); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
.folha .alca { width: 44px; height: 5px; background: var(--vinho-2); border-radius: 9px; margin: 0 auto 16px; }
.folha h3 { margin-bottom: 14px; }
.folha p { margin: 0 0 14px; }

/* menu de baixo: item ativo e o "+" em vinho */
nav.menu { position: fixed; left: 0; right: 0; bottom: 0; background: var(--cartao); border-top: 1px solid var(--linha); z-index: 10; }
nav.menu[hidden] { display: none; }
nav.menu .dentro { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; padding: 6px 6px calc(8px + env(safe-area-inset-bottom, 0px)); }
nav.menu button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; color: var(--suave); padding: 6px 0; cursor: pointer; }
nav.menu button .i { font-size: 24px; line-height: 1; }
nav.menu button.on { color: var(--vinho); }
nav.menu button.mais .i { width: 62px; height: 62px; margin-top: -30px; border-radius: 50%; background: var(--vinho); color: #fff; display: grid; place-items: center; font-size: 34px; box-shadow: 0 8px 20px rgba(128, 1, 18, .35); }

.entrar { min-height: 100%; display: grid; place-content: center; gap: 22px; text-align: center; padding: 40px 24px; }
.entrar img { width: min(260px, 70vw); height: auto; margin: 0 auto; display: block; }
.entrar p { color: var(--suave); margin: 10px 0 0; }
.bolinhas { display: flex; justify-content: center; gap: 14px; }
.bolinhas i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--vinho-2); }
.bolinhas i.on { background: var(--vinho); border-color: var(--vinho); }
.teclado { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; justify-content: center; }
.teclado button { height: 76px; border-radius: 50%; border: 0; background: var(--cartao); box-shadow: var(--sombra); font-size: 28px; font-weight: 700; cursor: pointer; color: var(--texto); }
.teclado button.apagar { background: transparent; box-shadow: none; font-size: 22px; color: var(--suave); }
.parado-resumo { background: var(--ambar-claro); border-radius: var(--raio); padding: 16px; display: grid; gap: 4px; margin-bottom: 14px; }
.parado-resumo strong { font: 700 28px/1.1 Fraunces, Georgia, serif; color: var(--ambar); }
.parado-resumo small { color: var(--ambar); font-weight: 700; font-size: 15px; }
.parado-resumo p { margin: 6px 0 0; font-size: 16px; }
.nota { font-size: 15px; color: var(--suave); margin: 8px 0 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media (min-width: 960px) {
  body { padding-left: 240px; }
  .app { max-width: 720px; }
  nav.menu { top: 0; right: auto; width: 240px; border-top: 0; border-right: 1px solid var(--linha); }
  nav.menu .dentro { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 24px 16px; max-width: none; }
  nav.menu button { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 16px; padding: 12px 14px; border-radius: 12px; }
  nav.menu button.on { background: var(--vinho-claro); }
  nav.menu button .i { width: 22px; text-align: center; }
  nav.menu button.mais { order: -1; margin-bottom: 14px; background: var(--vinho); color: #fff; }
  nav.menu button.mais .i { width: auto; height: auto; margin: 0; background: none; box-shadow: none; font-size: 22px; }
  .grade { grid-template-columns: repeat(3, 1fr); }
  .num.cheio { grid-column: auto; }
}
