/* ============================================================
   Nosso Buteco — App de Pedidos Corporativos (B2B)
   Visual claro e "clínico", com a identidade do Nosso Buteco
   (amarelo + vermelho) sobre fundo cor de creme. Mobile-first.
   ============================================================ */

:root {
  --amarelo: #FFD21E;
  --amarelo-dark: #B8860B;
  --vermelho: #E5483D;
  --azul: #2E9BFF;
  --ok: #1FA876;
  --bg: #FBF6EE;
  --bg-2: #FFFFFF;
  --txt: #2A2620;
  --txt-dim: #8C8579;
  --glass: #FFFFFF;
  --glass-brd: #ECE3D4;
  --glass-brd-2: #DACCB4;
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--txt);
  min-height: 100svh;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: var(--vermelho); }

/* ---------- Layout ---------- */
.page { max-width: 560px; margin: 0 auto; padding: 1rem 1rem 3rem; min-height: 100svh; }
.page-wide { max-width: 1120px; margin: 0 auto; padding: 1rem 1rem 3rem; min-height: 100svh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.85rem 0.25rem 1.1rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(229,72,61,0.18)); }
.brand-name {
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--vermelho);
}
.brand-name span { color: var(--txt-dim); display: block; font-size: 0.65rem; letter-spacing: 0.12em; }
.topbar-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; justify-content: flex-end; }
.nav-link.ativo { border-color: var(--amarelo); background: rgba(255, 210, 30, 0.16); color: var(--amarelo-dark); }

/* ---------- Navegação inferior (mobile, área do funcionário) ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  background: var(--bg-2);
  border-top: 1px solid var(--glass-brd);
  padding: 0.35rem 0.4rem calc(env(safe-area-inset-bottom, 0px) + 0.35rem);
  justify-content: space-around;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  flex: 1;
  padding: 0.4rem 0.2rem;
  border-radius: 12px;
  color: var(--txt-dim);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
}
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.ativo { color: var(--amarelo-dark); background: rgba(255, 210, 30, 0.14); }

@media (max-width: 760px) {
  .topbar-actions .nav-link { display: none; }
  .bottom-nav { display: flex; }
  body.has-bottom-nav { padding-bottom: 64px; }
  body.has-bottom-nav .page, body.has-bottom-nav .page-wide { padding-bottom: 1.5rem; }
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  padding: 1.4rem 1.15rem 1.5rem;
  margin-top: 1rem;
  box-shadow: 0 14px 34px -24px rgba(60, 40, 10, 0.18);
}
.card.center { text-align: center; }
.card h1, .card h2 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.card h1 { font-size: 1.7rem; }
.card h2 { font-size: 1.25rem; margin-bottom: 0.9rem; }
.card .sub { color: var(--txt-dim); font-size: 0.95rem; line-height: 1.45; margin-top: 0.45rem; }

/* ---------- Forms ---------- */
.q { margin-top: 1.3rem; }
.q:first-of-type { margin-top: 1rem; }
.q-label {
  display: block;
  font-weight: 600;
  font-size: 0.97rem;
  line-height: 1.35;
  margin-bottom: 0.55rem;
}
.q-sub { color: var(--txt-dim); font-size: 0.85rem; margin-top: -0.35rem; margin-bottom: 0.55rem; }
.req { color: var(--vermelho); margin-left: 0.15rem; }

.inp, select.inp, textarea.inp {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--glass-brd);
  border-radius: 13px;
  font: inherit;
  color: var(--txt);
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.inp::placeholder { color: rgba(42, 38, 32, 0.32); }
.inp:focus {
  outline: none;
  border-color: var(--amarelo);
  box-shadow: 0 0 0 3px rgba(255, 210, 30, 0.22);
}
textarea.inp { resize: vertical; min-height: 78px; line-height: 1.45; }
select.inp { appearance: none; cursor: pointer; }

/* opções (radio cards) */
.opcoes { display: grid; gap: 0.55rem; }
.opcao {
  position: relative;
  display: block;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 1px solid var(--glass-brd);
  border-radius: 13px;
  background: var(--bg);
  color: var(--txt);
  font: inherit;
  font-size: 0.97rem;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.08s;
}
.opcao input { position: absolute; opacity: 0; pointer-events: none; }
.opcao:active { transform: scale(0.99); }
.opcao::before {
  content: "";
  width: 16px; height: 16px;
  border: 2px solid var(--glass-brd-2);
  border-radius: 50%;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 0.6rem;
  transition: all 0.18s;
}
.opcao:has(input:checked) {
  border-color: var(--amarelo);
  background: rgba(255, 210, 30, 0.14);
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255, 210, 30, 0.45);
}
.opcao:has(input:checked)::before {
  border-color: var(--amarelo);
  background: radial-gradient(circle, var(--amarelo) 0 45%, transparent 55%);
  box-shadow: 0 0 8px rgba(255, 210, 30, 0.55);
}

/* steppers de quantidade (complementos) */
.stepper-list { display: grid; gap: 0.55rem; }
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--glass-brd);
  border-radius: 13px;
  background: var(--bg);
}
.stepper.ativo { border-color: var(--amarelo); background: rgba(255, 210, 30, 0.12); }
.stepper-nome { font-weight: 600; font-size: 0.95rem; min-width: 0; word-break: break-word; }
.stepper-ctrl { display: flex; align-items: center; gap: 0.6rem; }
.stepper-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--glass-brd-2);
  background: var(--bg-2);
  color: var(--txt);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: grid; place-items: center;
}
.stepper-btn:active { transform: scale(0.94); }
.stepper-val { min-width: 1.4rem; text-align: center; font-weight: 700; }

/* upload de comprovante */
.upload {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.05rem;
  border: 1px dashed rgba(46, 155, 255, 0.55);
  border-radius: 13px;
  color: var(--azul);
  font-weight: 600;
  cursor: pointer;
  background: rgba(46, 155, 255, 0.06);
}
.upload-thumb {
  width: 60px; height: 60px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--glass-brd-2);
  flex-shrink: 0;
}
.upload-nome { font-size: 0.85rem; color: var(--txt-dim); word-break: break-all; }

/* ---------- Botões ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  padding: 1rem 1.4rem;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  color: #2A2620;
  background: linear-gradient(180deg, var(--amarelo), #f3b500);
  box-shadow: 0 8px 22px -10px rgba(255, 210, 30, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.1s, filter 0.15s;
  text-decoration: none;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:hover { filter: brightness(1.03); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary.full, .btn-ghost.full { width: 100%; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--glass-brd-2);
  background: var(--bg-2);
  color: var(--txt);
  padding: 0.85rem 1.1rem;
  font: inherit; font-weight: 600; font-size: 0.92rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}
.btn-ghost:active { transform: scale(0.98); }

.btn-sm { padding: 0.5rem 0.85rem; font-size: 0.82rem; border-radius: 10px; }
.btn-danger { color: var(--vermelho); border-color: rgba(229, 72, 61, 0.4); }
.btn-ok { color: var(--ok); border-color: rgba(31, 168, 118, 0.4); }

/* ---------- Mensagens ---------- */
.alerta {
  border-radius: 12px;
  padding: 0.8rem 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
.alerta-erro { background: rgba(229, 72, 61, 0.08); border: 1px solid rgba(229, 72, 61, 0.35); color: #9C2A21; }
.alerta-ok { background: rgba(31, 168, 118, 0.08); border: 1px solid rgba(31, 168, 118, 0.35); color: #136B4C; }
.alerta-info { background: rgba(46, 155, 255, 0.08); border: 1px solid rgba(46, 155, 255, 0.35); color: #1C5FA8; }

.disclaimer {
  text-align: left;
  background: rgba(255, 210, 30, 0.16);
  border: 1px solid rgba(255, 210, 30, 0.5);
  border-left: 4px solid var(--amarelo);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin: 1rem 0 0.4rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--txt);
}
.disclaimer b { color: var(--amarelo-dark); }

/* ---------- Badges de status ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-recebido { background: #EFEAE0; color: var(--txt-dim); }
.badge-confirmado { background: rgba(46,155,255,0.14); color: #1C5FA8; }
.badge-em_preparo { background: rgba(255,210,30,0.22); color: var(--amarelo-dark); }
.badge-pronto { background: rgba(31,168,118,0.16); color: #136B4C; }
.badge-entregue { background: rgba(31,168,118,0.30); color: #0D4D37; }
.badge-cancelado { background: rgba(229,72,61,0.14); color: #9C2A21; }

/* ---------- Tabelas (CRM) ---------- */
.tabela-wrap { overflow-x: auto; margin-top: 0.5rem; }
table.tabela { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.tabela th, table.tabela td {
  text-align: left;
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--glass-brd);
  white-space: nowrap;
}
table.tabela th { color: var(--txt-dim); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
table.tabela tr:last-child td { border-bottom: none; }
table.tabela td.wrap { white-space: normal; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; margin-top: 0.8rem; }
.kpi { background: var(--bg-2); border: 1px solid var(--glass-brd); border-radius: 14px; padding: 1rem 0.85rem; text-align: center; }
.kpi-v { font-size: 1.7rem; font-weight: 700; line-height: 1; color: var(--vermelho); }
.kpi-l { font-size: 0.7rem; color: var(--txt-dim); margin-top: 0.35rem; text-transform: uppercase; letter-spacing: 0.04em; }
@media (max-width: 700px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpi-v { font-size: 1.4rem; } }

/* ---------- Painel: layout com sidebar ---------- */
.dash-layout { display: flex; gap: 1.2rem; max-width: 1200px; margin: 0 auto; align-items: flex-start; padding-top: 0.8rem; }
.sidebar {
  position: sticky; top: 0.8rem;
  width: 220px; flex: 0 0 220px;
  display: flex; flex-direction: column; gap: 0.4rem;
  background: var(--bg-2); border: 1px solid var(--glass-brd);
  border-radius: 16px; padding: 1rem;
}
.sidebar a {
  display: block; padding: 0.6rem 0.7rem; border-radius: 10px;
  color: var(--txt); text-decoration: none; font-weight: 600; font-size: 0.92rem;
  border: 1px solid transparent;
}
.sidebar a:hover, .sidebar a.ativo { border-color: var(--amarelo); background: rgba(255,210,30,0.12); color: var(--amarelo-dark); }
.dash-main { flex: 1; min-width: 0; }
@media (max-width: 860px) {
  .dash-layout { flex-direction: column; }
  .sidebar { position: static; width: auto; flex: auto; display: flex; flex-direction: row; flex-wrap: wrap; }
  .sidebar a { flex: 1 1 auto; text-align: center; }
}

/* ---------- Seletor de dias (pedido) ---------- */
.dia-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  margin: 0.9rem 0 0.2rem;
  padding-bottom: 0.3rem;
  -webkit-overflow-scrolling: touch;
}
.dia-tabs a {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--glass-brd-2);
  border-radius: 13px;
  background: var(--bg);
  color: var(--txt);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}
.dia-tabs a .dia-sub { font-size: 0.68rem; font-weight: 500; color: var(--txt-dim); text-transform: uppercase; letter-spacing: 0.03em; }
.dia-tabs a.ativo { border-color: var(--amarelo); background: rgba(255, 210, 30, 0.16); color: var(--amarelo-dark); }
.dia-tabs a.feito .dia-sub { color: var(--ok); }

/* ---------- Kanban ---------- */
.kanban-tabs {
  display: none;
  gap: 0.4rem;
  overflow-x: auto;
  margin-top: 0.8rem;
  padding-bottom: 0.2rem;
  -webkit-overflow-scrolling: touch;
}
.kanban-tabs button {
  flex: 0 0 auto;
  border: 1px solid var(--glass-brd-2);
  background: var(--bg-2);
  color: var(--txt);
  padding: 0.55rem 0.9rem;
  font: inherit; font-weight: 600; font-size: 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.kanban-tabs button b { color: var(--vermelho); margin-left: 0.3rem; }
.kanban-tabs button.ativo { border-color: var(--amarelo); background: rgba(255,210,30,0.16); color: var(--amarelo-dark); }
.kanban-tabs button.ativo b { color: var(--amarelo-dark); }

.kanban { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.8rem; margin-top: 1rem; align-items: start; }
@media (max-width: 1000px) {
  .kanban {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 1fr);
    overflow-x: auto;
    padding-bottom: 0.4rem;
  }
}
@media (max-width: 640px) {
  .kanban-tabs { display: flex; }
  .kanban {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: 1fr;
    overflow-x: visible;
  }
  .kanban-col { display: none; }
  .kanban-col.ativo { display: block; }
}
.kanban-col { background: var(--bg-2); border: 1px solid var(--glass-brd); border-radius: 14px; padding: 0.8rem; min-height: 120px; }
.kanban-col h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--txt-dim); margin-bottom: 0.7rem; display: flex; justify-content: space-between; }
.kanban-col h3 b { color: var(--vermelho); }
.pedido-card {
  background: var(--bg);
  border: 1px solid var(--glass-brd);
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
}
.pedido-card .nome { font-weight: 700; margin-bottom: 0.2rem; }
.pedido-card .empresa { color: var(--txt-dim); font-size: 0.75rem; margin-bottom: 0.4rem; }
.pedido-card .itens { line-height: 1.5; margin-bottom: 0.5rem; }
.pedido-card .itens b { color: var(--amarelo-dark); }
.pedido-card .acoes { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.pedido-card .obs { margin-top: 0.4rem; font-size: 0.8rem; color: var(--txt-dim); font-style: italic; }
.pedido-card .pagamento { margin-top: 0.4rem; font-size: 0.78rem; }
.pagamento.ok { color: var(--ok); }
.pagamento.pendente { color: var(--vermelho); }

/* ---------- Hero / login ---------- */
.hero { text-align: center; padding: 2rem 1.2rem 1.2rem; }
.hero .kicker { font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--azul); font-weight: 600; }
.hero h1 {
  font-size: 2.2rem; font-weight: 700; line-height: 1.05; letter-spacing: -0.03em;
  margin: 0.5rem 0 0.2rem;
  background: linear-gradient(180deg, var(--txt) 35%, var(--vermelho));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero .lead { color: var(--txt-dim); font-size: 1rem; line-height: 1.5; margin-top: 0.6rem; }
.logo-badge {
  width: 96px; height: 96px;
  object-fit: contain;
  margin: 0 auto 0.6rem;
  display: block;
  position: relative;
  background: radial-gradient(circle at 50% 45%, rgba(255, 210, 30, 0.18), transparent 62%);
  border-radius: 50%;
  filter: drop-shadow(0 6px 18px rgba(60, 40, 10, 0.18));
}

/* ---------- Cards de cardápio (com foto) ---------- */
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; margin-top: 0.8rem; }
.menu-card {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--glass-brd);
  text-decoration: none;
  color: var(--txt);
}
.menu-card img { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--bg); }
.menu-card-body { padding: 0.6rem 0.7rem 0.8rem; }
.menu-card-cat { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--txt-dim); font-weight: 700; }
.menu-card-nome { font-weight: 700; font-size: 0.92rem; margin-top: 0.15rem; line-height: 1.25; }
.menu-card-desc { font-size: 0.78rem; color: var(--txt-dim); margin-top: 0.25rem; line-height: 1.45; }

.menu-hero {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--glass-brd);
  text-decoration: none;
  color: var(--txt);
  margin-top: 1rem;
}
.menu-hero img { width: 100%; height: 180px; object-fit: cover; display: block; background: var(--bg); }
.menu-hero-body { padding: 0.9rem 1rem 1.1rem; }
.menu-hero-cat { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--azul); font-weight: 700; }
.menu-hero-nome { font-weight: 800; font-size: 1.15rem; margin-top: 0.2rem; }
.menu-hero-desc { font-size: 0.85rem; color: var(--txt-dim); margin-top: 0.3rem; line-height: 1.5; }

.section-title { font-size: 1.05rem; font-weight: 800; margin: 1.4rem 0 0.2rem; }
.section-title:first-child { margin-top: 0.4rem; }

.muted { color: var(--txt-dim); font-size: 0.92rem; }
.center { text-align: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
