/* Paleta da marca "Quentinha da Su" -- extraida da logo (terracota + amarelo + branco).
   Trocou o vinho generico (#781108) usado ate aqui por essas cores. */
:root {
  --cor-terracota: #c1693f;
  --cor-terracota-escuro: #a3542f;
  --cor-amarelo: #f2db6b;
  --cor-amarelo-escuro: #8a6100;
  --cor-fundo: #fbf6ee;
  --cor-texto: #3a2418;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--cor-fundo);
  color: var(--cor-texto);
}

.tela {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  animation: entrada-tela 0.12s ease-out;
}

@keyframes entrada-tela {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tela-login {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cartao {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.logo-login {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 12px;
  border-radius: 50%;
  object-fit: cover;
}

.tela-login h1 {
  text-align: center;
}

h1 {
  font-size: 22px;
  margin: 0 0 16px;
  color: var(--cor-terracota-escuro);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 4px;
  color: #555;
}

input, select, textarea {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--cor-terracota);
  outline-offset: 1px;
  border-color: var(--cor-terracota);
}

button {
  font-size: 16px;
  padding: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  margin-top: 16px;
}

.btn-primario {
  background: var(--cor-terracota);
  color: #fff;
  font-weight: 600;
}

.btn-primario:not(:disabled):active {
  background: var(--cor-terracota-escuro);
}

.btn-primario:disabled {
  opacity: 0.6;
}

.erro {
  background: #fde8e6;
  color: #9c1c12;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 12px;
}

.topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.topo h1 { margin: 0; }

.btn-secundario {
  width: auto;
  margin-top: 0;
  background: #fff;
  border: 1px solid #ccc;
  color: #444;
  font-size: 14px;
  padding: 10px 14px;
}

.barra-acoes { display: flex; gap: 10px; margin-bottom: 16px; }

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-perigo {
  color: #9c1c12;
  border-color: #f0b8b3;
}

.btn-perigo:disabled { opacity: 0.6; }

.lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.item {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.item.inativo { opacity: 0.55; }

.item-info { min-width: 0; color: inherit; text-decoration: none; flex: 1; }
.item-nome { font-weight: 600; font-size: 15px; }
.item-detalhe { font-size: 13px; color: #777; margin-top: 2px; }

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 30px;
  flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch .trilho {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 30px;
  transition: 0.15s;
}

.switch .trilho::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.15s;
}

.switch input:checked + .trilho { background: var(--cor-terracota); }
.switch input:checked + .trilho::before { transform: translateX(20px); }

.vazio {
  text-align: center;
  color: #888;
  padding: 40px 16px;
}

select {
  width: auto;
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
}

.pedido-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pedido-topo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: #eee;
  color: #555;
}

.badge-RECEBIDO { background: #fde8e6; color: #9c1c12; }
.badge-EM_PREPARO { background: #fdf1d6; color: #8a6100; }
.badge-SAIU_ENTREGA { background: #dce8fb; color: #1a4d9c; }
.badge-ENTREGUE { background: #dcf3e0; color: #1c7a35; }

.pedido-itens {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
  color: #444;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pedido-itens li {
  display: flex;
  justify-content: space-between;
}

.pedido-rodape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.pedido-rodape .item-detalhe { display: block; }

.btn-avancar {
  width: auto;
  margin-top: 0;
  padding: 10px 14px;
  font-size: 14px;
}

.conversa-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  display: block;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.conversa-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conversa-preview {
  font-size: 13px;
  color: #777;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-aguardando {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--cor-amarelo);
  color: var(--cor-amarelo-escuro);
  white-space: nowrap;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bolha-linha {
  display: flex;
}

.bolha-linha.cliente { justify-content: flex-start; }
.bolha-linha.su { justify-content: flex-end; }

.bolha {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.bolha-linha.cliente .bolha {
  background: #fff;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.bolha-linha.su .bolha {
  background: var(--cor-terracota);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bolha-hora {
  font-size: 11px;
  color: #999;
  margin-top: 3px;
}

.bolha-linha.su .bolha-hora { text-align: right; }

.cartao-status {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.status-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}

.qr-imagem {
  width: 100%;
  max-width: 260px;
  border-radius: 8px;
  border: 1px solid #eee;
}

/* Navegacao fixa embaixo, presente nas 3 telas principais (Cardapio/Pedidos/
   Conversas) -- troca os links soltos que existiam no topo de cada tela por
   um padrao unico, sempre visivel, mais facil de usar com o polegar no
   celular (uso majoritariamente mobile, espec da Su). */
.tela-com-nav { padding-bottom: 80px; }

.nav-inferior {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-around;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.07);
  z-index: 10;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  text-decoration: none;
  color: #999;
  font-size: 11px;
  font-weight: 600;
}

.nav-item .nav-icone { display: flex; }
.nav-item .nav-icone svg { width: 22px; height: 22px; }

.nav-item.ativo { color: var(--cor-terracota-escuro); }

.categoria-grupo { margin-bottom: 14px; }

.categoria-titulo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px;
  font-weight: 700;
  font-size: 15px;
  color: var(--cor-terracota-escuro);
  cursor: pointer;
  list-style: none;
}

.categoria-titulo::-webkit-details-marker { display: none; }

.categoria-titulo::before {
  content: "▸";
  margin-right: 8px;
  display: inline-block;
  transition: transform 0.15s;
}

details[open] > .categoria-titulo::before { transform: rotate(90deg); }

.categoria-contagem {
  font-size: 12px;
  font-weight: 600;
  color: #999;
}

.categoria-grupo .lista { margin-top: 6px; }

.item-observacao {
  background: var(--cor-fundo);
  border-left: 3px solid var(--cor-amarelo);
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--cor-texto) !important;
}

.checkbox-linha {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
  margin: -6px 0 16px;
}

.checkbox-linha input { width: auto; }

.pagamento-linha {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #9c1c12;
  padding-top: 4px;
  border-top: 1px dashed #eee;
  margin-top: 4px;
}

.pagamento-linha input { width: auto; }

.pagamento-linha.confirmado { color: #1c7a35; }
