:root {
  --verde: #2e7d32;
  --verde-claro: #e8f5e9;
  --vermelho: #c62828;
  --amarelo: #f9a825;
  --cinza: #6b7280;
  --fundo: #f5f5f4;
  --texto: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  padding: env(safe-area-inset-top) 12px calc(env(safe-area-inset-bottom) + 24px);
  max-width: 640px;
  margin-inline: auto;
}

.topo { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px; }
.topo h1 { font-size: 1.3rem; margin: 0; }

.cartao {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cartao h2 { margin: 0; font-size: 1.1rem; }

label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--cinza); }

input, select, button { font-size: 16px; /* evita zoom automático no iPhone */ }
input, select {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
}

.linha { display: flex; gap: 8px; }
.linha > * { flex: 1; }

button { border: 0; border-radius: 10px; padding: 12px 14px; cursor: pointer; }
button:disabled { opacity: .5; }
.principal { background: var(--verde); color: #fff; font-weight: 600; }
.alerta { background: var(--vermelho); color: #fff; font-weight: 600; }
.link { background: none; color: var(--cinza); text-decoration: underline; padding: 6px; }

.abas { display: flex; gap: 8px; margin-bottom: 8px; }
.aba { flex: 1; background: #fff; color: var(--texto); }
.aba.ativa { background: var(--verde); color: #fff; font-weight: 600; }

.lista { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.item {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}
.item .info { flex: 1; min-width: 0; }
.item .nome { font-weight: 600; overflow-wrap: anywhere; }
.item .qtd { color: var(--cinza); font-size: .9rem; }
.item .acoes { display: flex; gap: 6px; }
.item .acoes button { padding: 10px 12px; min-width: 44px; background: var(--verde-claro); color: var(--verde); font-weight: 700; }
.item .acoes button.acabou { background: #fdecea; color: var(--vermelho); }

.selo { font-size: .75rem; padding: 2px 8px; border-radius: 99px; margin-left: 6px; font-weight: 600; }
.selo.tem { background: var(--verde-claro); color: var(--verde); }
.selo.acabando { background: #fff8e1; color: #8d6e00; }
.selo.comprar { background: #fdecea; color: var(--vermelho); }

.vazio { text-align: center; color: var(--cinza); padding: 24px; }

.aviso {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 10px 16px;
  border-radius: 99px;
  font-size: .9rem;
  max-width: 90vw;
}
.aviso.erro { background: var(--vermelho); }
