/* ============================================================
   Comanda Fácil — design system v2 "Brasa"
   Identidade: laranja ember sobre carvão quente; serviço ágil.
   Mobile-first, sem framework. Todas as classes das views cobertas.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* paleta */
  --carvao-900: #17100b;   /* topbar / cozinha */
  --carvao-800: #241a12;
  --papel: #f7f2ec;        /* fundo da página, cream quente */
  --superficie: #ffffff;
  --texto: #2a2118;
  --borda: #e8ddd1;
  --ember: #ea580c;        /* ação principal */
  --ember-escuro: #c2410c;
  --ember-claro: #feeadd;
  --dourado: #f5a623;
  --verde: #16a34a;
  --verde-claro: #dcf5e5;
  --vermelho: #dc2626;
  --vermelho-claro: #fde8e8;
  --sombra-1: 0 1px 2px rgba(42, 33, 24, .06), 0 1px 3px rgba(42, 33, 24, .09);
  --sombra-2: 0 4px 12px rgba(42, 33, 24, .09), 0 12px 32px rgba(42, 33, 24, .11);
  --raio: 14px;
  --fonte-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --fonte-corpo: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--fonte-corpo);
  color: var(--texto);
  background: var(--papel);
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--ember-escuro); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { font-family: var(--fonte-display); letter-spacing: -.02em; }
h1 { font-size: 1.45rem; font-weight: 800; margin-bottom: 1rem; }
h2 { font-size: 1.08rem; font-weight: 700; margin: 1.4rem 0 .6rem; }

/* ---------- topbar: carvão com brasa ---------- */
header.topo {
  background: linear-gradient(135deg, var(--carvao-900), #2c1c10 90%);
  color: #fff;
  padding: .8rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 3px solid var(--ember);
}
header.topo .logo {
  font-family: var(--fonte-display);
  font-weight: 800; font-size: 1.08rem; color: #fff; letter-spacing: -.01em;
}
header.topo .logo:hover { text-decoration: none; }
header.topo .mudo a { font-weight: 600; }

/* ---------- navegação: pílulas ---------- */
nav.menu {
  display: flex; gap: .3rem;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--borda);
  overflow-x: auto; padding: .5rem .7rem;
  position: sticky; top: 0; z-index: 20;
  scrollbar-width: none;
}
nav.menu::-webkit-scrollbar { display: none; }
nav.menu a {
  padding: .5rem .85rem; white-space: nowrap; font-size: .9rem;
  font-weight: 500; color: #6d5b48; border-radius: 99px;
  transition: background .15s ease, color .15s ease;
}
nav.menu a:hover { background: var(--ember-claro); color: var(--ember-escuro); text-decoration: none; }
nav.menu a.ativo {
  background: var(--carvao-900); color: #fff; font-weight: 600;
  box-shadow: var(--sombra-1);
}

main { padding: 1.2rem 1rem 3rem; max-width: 900px; margin: 0 auto; }

/* ---------- cartões ---------- */
.cartao {
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 1.1rem 1.2rem;
  margin-bottom: .9rem;
  box-shadow: var(--sombra-1);
}

/* ---------- métricas ---------- */
.grade-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.cartao.metrica {
  text-align: center; padding: 1rem .4rem 1.1rem;
  position: relative; overflow: hidden;
}
.cartao.metrica::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: linear-gradient(180deg, var(--dourado), var(--ember));
  border-radius: 4px 0 0 4px;
}
.metrica b {
  display: block; font-family: var(--fonte-display);
  font-size: 2rem; font-weight: 800; color: var(--carvao-900);
  font-variant-numeric: tabular-nums; line-height: 1.15;
}
.metrica span {
  font-size: .74rem; color: #8a7660; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
}

/* ---------- formulários ---------- */
form.linha { display: grid; gap: .6rem; }
label { font-size: .85rem; font-weight: 600; color: #52422f; }
input, select, textarea {
  width: 100%; padding: .7rem .8rem;
  border: 1.5px solid var(--borda); border-radius: 10px;
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--texto);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, .16);
}
::placeholder { color: #b5a48f; }

/* ---------- botões ---------- */
button, .botao {
  display: inline-block;
  background: linear-gradient(180deg, var(--ember), var(--ember-escuro));
  color: #fff; border: 0; border-radius: 10px;
  padding: .72rem 1.15rem; font-size: .98rem; font-weight: 600;
  font-family: inherit; cursor: pointer; text-align: center;
  box-shadow: 0 1px 2px rgba(194, 65, 12, .4), inset 0 1px 0 rgba(255, 255, 255, .15);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
button:hover, .botao:hover { filter: brightness(1.07); text-decoration: none; box-shadow: 0 4px 12px rgba(194, 65, 12, .38); }
button:active, .botao:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(194, 65, 12, .3); }
button:focus-visible, .botao:focus-visible, a:focus-visible {
  outline: 3px solid rgba(234, 88, 12, .4); outline-offset: 2px;
}
.botao-verde { background: linear-gradient(180deg, #22c55e, var(--verde)); box-shadow: 0 1px 2px rgba(22, 163, 74, .35), inset 0 1px 0 rgba(255,255,255,.15); }
.botao-verde:hover { box-shadow: 0 4px 12px rgba(22, 163, 74, .35); }
.botao-claro {
  background: var(--ember-claro); color: var(--ember-escuro);
  box-shadow: none; border: 1px solid #f9d3b8;
}
.botao-claro:hover { box-shadow: 0 2px 8px rgba(234, 88, 12, .18); }
.botao-mini { padding: .34rem .7rem; font-size: .84rem; border-radius: 8px; }

/* ---------- tabelas ---------- */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th {
  text-align: left; padding: .55rem .5rem;
  font-size: .72rem; font-weight: 700; color: #8a7660;
  text-transform: uppercase; letter-spacing: .07em;
  border-bottom: 2px solid var(--borda);
}
td { text-align: left; padding: .62rem .5rem; border-bottom: 1px solid #f0e8dd; }
tr:last-child td { border-bottom: 0; }
table tr { transition: background .12s ease; }
table tr:hover td { background: #fbf6f0; }

/* ---------- etiquetas de status ---------- */
.etiqueta {
  display: inline-flex; align-items: center; gap: .35em;
  padding: .18rem .6rem; border-radius: 99px;
  font-size: .74rem; font-weight: 700; letter-spacing: .01em;
  white-space: nowrap;
}
.etiqueta::before { content: ""; width: .45em; height: .45em; border-radius: 50%; background: currentColor; }
.et-pendente { background: #fdf3d7; color: #92600a; }
.et-pronto { background: var(--verde-claro); color: #15803d; }
.et-entregue { background: #ece7e0; color: #6d5b48; }
.et-cancelado { background: var(--vermelho-claro); color: #c81e1e; text-decoration: line-through; }

/* ---------- avisos ---------- */
.erro {
  background: var(--vermelho-claro); color: #c81e1e;
  padding: .7rem .9rem; border-radius: 10px; margin-bottom: .8rem;
  border: 1px solid #f8c9c9; font-weight: 500; font-size: .95rem;
}
.aviso-bemvindo {
  background: linear-gradient(135deg, #f2fdf5, var(--verde-claro));
  border: 1px solid #b8ecc9; border-radius: var(--raio);
  padding: 1.1rem 1.2rem; margin-bottom: 1.1rem; box-shadow: var(--sombra-1);
}
.aviso-bemvindo ol { margin: .5rem 0 0 1.2rem; }
.aviso-bemvindo li { margin: .2rem 0; }

.total-grande {
  font-family: var(--fonte-display); font-size: 1.5rem; font-weight: 800;
  color: #15803d; font-variant-numeric: tabular-nums;
}
.rodape-acao { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.mudo { color: #8a7660; font-size: .86rem; }

/* ---------- telas de entrada (login/registro) ---------- */
body:has(> .centro) {
  min-height: 100vh;
  background:
    radial-gradient(1100px 480px at 85% -10%, rgba(234, 88, 12, .22), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(245, 166, 35, .16), transparent 60%),
    var(--carvao-900);
  display: grid; align-items: center;
}
.centro { max-width: 430px; margin: 6vh auto; padding: 0 1rem; width: 100%; }
.centro .marca {
  text-align: center; margin-bottom: 1.2rem;
  font-family: var(--fonte-display); font-size: 1.7rem; font-weight: 800;
  color: #fff; letter-spacing: -.02em; text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}
.centro .cartao {
  padding: 1.6rem 1.5rem; border: 0; box-shadow: var(--sombra-2);
  border-radius: 18px;
}
.centro h1 { font-size: 1.25rem; }
.centro button { width: 100%; margin-top: .2rem; padding: .8rem; }

/* ---------- grade de mesas abertas (dashboard) ---------- */
.grade-mesas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.mesa-cartao {
  background: var(--superficie); border: 1px solid var(--borda);
  border-radius: var(--raio); padding: .95rem; display: block;
  color: var(--texto); position: relative;
  box-shadow: var(--sombra-1);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.mesa-cartao:hover {
  transform: translateY(-2px); box-shadow: var(--sombra-2);
  border-color: #f0b489; text-decoration: none;
}
.mesa-cartao b {
  display: block; font-family: var(--fonte-display);
  font-size: 1.2rem; font-weight: 800; color: var(--ember-escuro);
}
.mesa-cartao .sino {
  position: absolute; top: .55rem; right: .6rem;
  background: var(--verde); color: #fff; border-radius: 99px;
  font-size: .72rem; padding: .12rem .5rem; font-weight: 700;
  animation: pulso-sino 1.6s ease-in-out infinite;
}
@keyframes pulso-sino {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); }
  50% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
}

/* ---------- cardápio do garçom: 1 toque ---------- */
.grade-produtos { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: .55rem; }
.grade-produtos button {
  background: #fff; color: var(--texto); border: 1.5px solid var(--borda);
  text-align: left; padding: .7rem .75rem; border-radius: 12px;
  box-shadow: var(--sombra-1); font-weight: 500;
}
.grade-produtos button b { color: var(--ember-escuro); display: block; font-family: var(--fonte-display); }
.grade-produtos button:hover { border-color: #f0b489; filter: none; }
.grade-produtos button:active { background: var(--ember-claro); transform: scale(.98); }

/* ---------- painel da cozinha (TV/tablet na parede) ---------- */
body.tela-cozinha { background: #12100e; color: #fff; min-height: 100vh; }
.cozinha-topo {
  display: flex; justify-content: space-between; align-items: center;
  padding: .9rem 1.3rem; background: rgba(0, 0, 0, .45);
  border-bottom: 2px solid var(--ember);
  font-family: var(--fonte-display); position: sticky; top: 0; backdrop-filter: blur(6px);
}
.cozinha-grade {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: .9rem; padding: 1.1rem;
}
.pedido {
  background: linear-gradient(180deg, #26201a, #1e1914);
  border-radius: 14px; padding: 1.05rem;
  border: 1px solid #372c21; border-left: 6px solid var(--dourado);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
  animation: chegou .3s ease;
}
@keyframes chegou { from { opacity: 0; transform: translateY(6px); } }
.pedido.pronto { border-left-color: var(--verde); opacity: .62; }
.pedido .mesa {
  font-family: var(--fonte-display); font-size: 1.3rem; font-weight: 800;
  color: #ffd9b8;
}
.pedido .desc { font-size: 1.18rem; margin: .35rem 0; font-weight: 600; }
.pedido .obs { color: #ffcf70; font-size: .95rem; background: rgba(245, 166, 35, .1); border-radius: 8px; padding: .3rem .55rem; margin: .3rem 0; }
.pedido .tempo { color: #a08e79; font-size: .85rem; font-variant-numeric: tabular-nums; }
.pedido button { width: 100%; margin-top: .7rem; background: linear-gradient(180deg, #22c55e, var(--verde)); font-size: 1.08rem; padding: .8rem; }

/* ---------- fechamento: QR Pix + copia-e-cola ---------- */
.qr-pix { text-align: center; }
.qr-pix img {
  max-width: 280px; width: 100%; border-radius: 14px;
  border: 1px solid var(--borda); box-shadow: var(--sombra-1);
  background: #fff; padding: .4rem;
}
.copia-cola {
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
  font-size: .78rem; word-break: break-all;
  background: #f3ece3; border: 1px dashed #d5c4ad;
  padding: .7rem .8rem; border-radius: 10px; color: #52422f;
}

@media (min-width: 700px) {
  h1 { font-size: 1.7rem; }
  main { padding-top: 1.6rem; }
  .metrica b { font-size: 2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
