*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family:var(--font-body);
  background:#e9e2d4;
  color:var(--ink-900);
  -webkit-font-smoothing:antialiased;
}
a{ color:inherit; text-decoration:none; }
button{ font-family:var(--font-body); }
img{ max-width:100%; display:block; }

/* ---------- moldura do app (centraliza como um telefone em telas largas) ---------- */
.app-frame{
  max-width:var(--app-max-w);
  margin:0 auto;
  min-height:100vh;
  background:var(--bg-canvas);
  position:relative;
  box-shadow:0 0 60px rgba(0,0,0,0.12);
  display:flex;
  flex-direction:column;
}
.app-scroll{
  flex:1;
  overflow-y:auto;
  padding:16px 16px calc(var(--bottomnav-h) + 22px);
}

/* ---------- header superior ---------- */
.app-topbar{
  height:var(--topbar-h);
  display:flex; align-items:center; justify-content:space-between;
  padding:0 16px; background:var(--bg-dark); color:var(--cream-100);
  position:sticky; top:0; z-index:15;
}
.app-topbar-left{ display:flex; align-items:center; gap:9px; }
.app-topbar-left img{ width:26px; height:26px; object-fit:contain; }
.app-topbar-title{ font-family:var(--font-display); font-weight:700; font-size:14.5px; line-height:1.1; }
.app-topbar-sub{ font-size:9.5px; color:var(--terracotta); letter-spacing:.06em; text-transform:uppercase; font-weight:700; }
.app-topbar-icon{
  width:32px; height:32px; border-radius:9px; background:rgba(255,255,255,0.08);
  display:flex; align-items:center; justify-content:center; color:var(--cream-100); position:relative; cursor:pointer;
}
.app-topbar-icon svg{ width:16px; height:16px; }
.app-topbar-icon .dot{ position:absolute; top:5px; right:5px; width:6px; height:6px; border-radius:50%; background:var(--terracotta); border:1.5px solid var(--bg-dark); }

/* ---------- bottom nav ---------- */
.bottom-nav{
  position:fixed; left:50%; transform:translateX(-50%); bottom:0;
  width:100%; max-width:var(--app-max-w);
  height:var(--bottomnav-h);
  background:var(--bg-dark);
  display:flex; align-items:stretch; justify-content:space-around;
  z-index:20; box-shadow:0 -6px 20px rgba(0,0,0,0.18);
  padding-bottom:6px;
}
.nav-tab{
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  color:rgba(169,183,172,0.65); font-size:10px; font-weight:600; position:relative; cursor:pointer;
}
.nav-tab svg{ width:20px; height:20px; }
.nav-tab.ativo{ color:var(--brass); }
.nav-tab .nav-badge{
  position:absolute; top:2px; right:calc(50% - 20px);
  min-width:15px; height:15px; padding:0 3px; border-radius:100px;
  background:var(--oxblood); color:#fff; font-size:9px; font-weight:700;
  display:flex; align-items:center; justify-content:center; border:1.5px solid var(--bg-dark);
}
.nav-tab.central{ position:relative; top:-14px; }
.nav-tab.central .central-btn{
  width:50px; height:50px; border-radius:50%;
  background:linear-gradient(135deg, var(--terracotta), var(--oxblood));
  display:flex; align-items:center; justify-content:center; box-shadow:0 6px 16px rgba(122,36,32,0.4);
  color:#fff;
}
.nav-tab.central .central-btn svg{ width:22px; height:22px; }
.nav-tab.central span{ margin-top:2px; }

/* ---------- cards genéricos ---------- */
.card{
  background:var(--bg-card); border-radius:var(--radius-lg); padding:16px;
  box-shadow:var(--shadow-sm); margin-bottom:12px;
}
.section-title{ font-family:var(--font-display); font-weight:700; font-size:15px; margin:4px 0 2px; color:var(--ink-900); }
.section-sub{ font-size:11.5px; color:var(--ink-400); margin:0 0 10px; }

/* ---------- kpi ---------- */
.kpi-row{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.kpi-mini{
  background:var(--bg-card); border-radius:var(--radius); padding:13px 14px;
  box-shadow:var(--shadow-sm); border-left:3px solid var(--pine);
}
.kpi-mini.azul{ border-left-color:var(--river); }
.kpi-mini.verde{ border-left-color:var(--pine); }
.kpi-mini .lbl{ font-size:10.5px; color:var(--ink-400); margin:0 0 3px; }
.kpi-mini .val{ font-family:var(--font-mono); font-size:18px; font-weight:600; color:var(--ink-900); margin:0; }
.kpi-mini .sub{ font-size:10.5px; color:var(--ink-600); margin:2px 0 0; }

/* ---------- ações rápidas ---------- */
.quick-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.quick-action{
  background:var(--bg-card); border-radius:var(--radius); padding:14px;
  display:flex; align-items:center; gap:10px; box-shadow:var(--shadow-sm); cursor:pointer; position:relative;
}
.quick-action .ic{
  width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex:none; color:#fff;
}
.quick-action .ic svg{ width:18px; height:18px; }
.quick-action span{ font-size:12.5px; font-weight:600; color:var(--ink-900); }
.quick-action .badge-count{
  position:absolute; top:8px; right:10px; background:var(--oxblood); color:#fff;
  font-size:9.5px; font-weight:700; min-width:16px; height:16px; border-radius:100px;
  display:flex; align-items:center; justify-content:center; padding:0 4px;
}

/* ---------- banner de pedido em aberto ---------- */
.banner-pedido{
  background:linear-gradient(135deg, var(--pine), var(--pine-strong));
  color:#fff; border-radius:var(--radius-lg); padding:14px 16px;
  display:flex; align-items:center; gap:12px; box-shadow:var(--shadow-md); cursor:pointer;
}
.banner-pedido .ic{ width:38px; height:38px; border-radius:10px; background:rgba(255,255,255,0.15); display:flex; align-items:center; justify-content:center; flex:none; }
.banner-pedido .ic svg{ width:19px; height:19px; }
.banner-pedido .txt strong{ display:block; font-size:13.5px; }
.banner-pedido .txt span{ font-size:11.5px; opacity:.85; }
.banner-pedido .seta{ margin-left:auto; opacity:.8; }

/* ---------- status card genérico (loading/erro/aviso) ---------- */
.status-card{
  display:flex; gap:12px; align-items:flex-start; padding:14px 16px; border-radius:var(--radius-lg);
  background:var(--bg-card); box-shadow:var(--shadow-sm); margin-bottom:12px;
}
.status-card .ic{ width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex:none; }
.status-card .ic svg{ width:18px; height:18px; }
.status-card h4{ font-size:13px; font-weight:700; margin:0 0 3px; color:var(--ink-900); }
.status-card p{ font-size:11.5px; color:var(--ink-600); margin:0; line-height:1.5; }
.status-card button{ margin-top:8px; }

/* ---------- dica IA ---------- */
.tip-card{
  border-radius:var(--radius-lg); padding:14px 16px; margin-bottom:12px;
  background:linear-gradient(160deg, #fff, var(--warning-bg));
  border:1px solid var(--line); box-shadow:var(--shadow-sm);
}
.tip-card .pill{ display:inline-block; font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--brass-strong); background:#fff; padding:3px 9px; border-radius:100px; margin-bottom:8px; }
.tip-card h4{ font-family:var(--font-display); font-size:13.5px; font-weight:700; margin:0 0 5px; color:var(--ink-900); }
.tip-card p{ font-size:12px; color:var(--ink-700); margin:0; line-height:1.5; }

/* ---------- badges / status ---------- */
.badge{ display:inline-flex; align-items:center; gap:4px; font-size:10.5px; font-weight:700; padding:3px 9px; border-radius:100px; }
.badge.success{ background:var(--success-bg); color:var(--success); }
.badge.warning{ background:var(--warning-bg); color:var(--brass-strong); }
.badge.danger{ background:var(--danger-bg); color:var(--danger); }
.badge.info{ background:var(--info-bg); color:var(--river); }
.badge.neutral{ background:var(--bg-canvas); color:var(--ink-600); }

/* ---------- busca ---------- */
.search-box{
  display:flex; align-items:center; gap:8px; background:var(--bg-card); border:1px solid var(--line);
  border-radius:100px; padding:9px 14px; margin-bottom:12px; box-shadow:var(--shadow-sm);
}
.search-box svg{ width:16px; height:16px; color:var(--ink-400); flex:none; }
.search-box input{ border:none; outline:none; background:none; font-size:13px; width:100%; color:var(--ink-900); }

/* ---------- chips de filtro ---------- */
.chip-row{ display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; margin-bottom:12px; scrollbar-width:none; }
.chip-row::-webkit-scrollbar{ display:none; }
.chip{
  flex:none; font-size:12px; font-weight:600; padding:7px 14px; border-radius:100px;
  background:var(--bg-card); border:1px solid var(--line); color:var(--ink-600); cursor:pointer; white-space:nowrap;
}
.chip.ativo{ background:var(--pine); border-color:var(--pine); color:#fff; }

/* ---------- lista de clientes / itens ---------- */
.list-item{
  display:flex; align-items:center; gap:12px; background:var(--bg-card); border-radius:var(--radius);
  padding:12px 14px; margin-bottom:9px; box-shadow:var(--shadow-sm); cursor:pointer;
}
.list-item .avatar{
  width:40px; height:40px; border-radius:11px; background:var(--pine); color:#fff;
  display:flex; align-items:center; justify-content:center; font-family:var(--font-display); font-weight:700; font-size:14px; flex:none;
}
.list-item .info{ flex:1; min-width:0; }
.list-item .info .nome{ font-size:13.5px; font-weight:700; color:var(--ink-900); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.list-item .info .meta{ font-size:11px; color:var(--ink-400); margin-top:2px; }
.list-item .right{ text-align:right; flex:none; }
.list-item .right .valor{ font-family:var(--font-mono); font-size:12.5px; font-weight:600; color:var(--ink-900); }
.list-item .chevron{ color:var(--ink-400); flex:none; }
.list-item .chevron svg{ width:16px; height:16px; }

/* ---------- ranking ---------- */
.ranking-badge{
  width:26px; height:26px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  font-family:var(--font-mono); font-size:11px; font-weight:700; color:#fff; flex:none;
}

/* ---------- produtos (grid) ---------- */
.produto-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.produto-card{
  background:var(--bg-card); border-radius:var(--radius-lg); overflow:hidden; box-shadow:var(--shadow-sm); position:relative;
}
.produto-card .foto{
  height:92px; background:linear-gradient(150deg, var(--bg-canvas), #e7ddc9);
  display:flex; align-items:center; justify-content:center; color:var(--ink-400);
}
.produto-card .foto svg{ width:30px; height:30px; }
.produto-card .fav{
  position:absolute; top:8px; right:8px; width:26px; height:26px; border-radius:50%;
  background:rgba(255,255,255,0.9); display:flex; align-items:center; justify-content:center; color:var(--oxblood);
}
.produto-card .fav svg{ width:14px; height:14px; }
.produto-card .corpo{ padding:10px 11px 12px; }
.produto-card .nome{ font-size:12px; font-weight:700; color:var(--ink-900); line-height:1.3; min-height:31px; }
.produto-card .preco{ font-family:var(--font-mono); font-size:13px; font-weight:700; color:var(--pine); margin:6px 0 8px; }
.produto-card .btn-add{
  width:100%; border:none; background:var(--brass); color:#fff; font-weight:700; font-size:11.5px;
  padding:7px; border-radius:8px; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:5px;
}
.produto-card .btn-add svg{ width:13px; height:13px; }

/* ---------- carrinho / item pedido ---------- */
.carrinho-item{
  display:flex; align-items:center; gap:11px; background:var(--bg-card); border-radius:var(--radius);
  padding:11px 13px; margin-bottom:9px; box-shadow:var(--shadow-sm);
}
.carrinho-item .info{ flex:1; min-width:0; }
.carrinho-item .info .nome{ font-size:12.5px; font-weight:700; color:var(--ink-900); }
.carrinho-item .info .meta{ font-size:11px; color:var(--ink-400); margin-top:2px; }
.qtd-stepper{ display:flex; align-items:center; gap:8px; }
.qtd-stepper button{
  width:26px; height:26px; border-radius:8px; border:1px solid var(--line); background:var(--bg-canvas);
  display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--ink-700);
}
.qtd-stepper span{ font-family:var(--font-mono); font-size:12.5px; font-weight:600; min-width:20px; text-align:center; }
.carrinho-item .remover{ color:var(--ink-400); cursor:pointer; flex:none; }
.carrinho-item .remover svg{ width:15px; height:15px; }

/* ---------- resumo fixo do pedido ---------- */
.resumo-flutuante{
  position:sticky; bottom:0; background:var(--bg-card); border-top:1px solid var(--line);
  padding:12px 16px; margin:0 -16px; box-shadow:0 -4px 14px rgba(0,0,0,0.06);
}
.resumo-flutuante .linha{ display:flex; justify-content:space-between; font-size:12px; color:var(--ink-600); margin-bottom:4px; }
.resumo-flutuante .linha.total{ font-size:15px; font-weight:700; color:var(--ink-900); margin:6px 0 10px; }
.btn-enviar{
  width:100%; border:none; padding:13px; border-radius:12px; font-weight:700; font-size:14px;
  background:linear-gradient(135deg, var(--terracotta), var(--oxblood)); color:#fff; cursor:pointer;
}

/* ---------- botão padrão ---------- */
.btn{
  display:inline-flex; align-items:center; gap:7px; font-size:12.5px; font-weight:700;
  padding:9px 15px; border-radius:10px; border:1px solid var(--line); background:var(--bg-card); color:var(--ink-700); cursor:pointer;
}
.btn-primary{ background:linear-gradient(135deg, var(--brass), var(--brass-strong)); color:#fff; border:none; }
.btn-full{ width:100%; justify-content:center; }

/* ---------- bottom sheet ---------- */
.sheet-overlay{
  position:fixed; inset:0; background:rgba(27,36,32,0.5); z-index:50; display:flex; align-items:flex-end; justify-content:center;
}
.sheet-overlay.hidden{ display:none; }
.sheet-box{
  width:100%; max-width:var(--app-max-w); background:var(--bg-card); border-radius:22px 22px 0 0;
  padding:10px 18px 22px; max-height:85vh; overflow-y:auto; box-shadow:var(--shadow-lg);
}
.sheet-handle{ width:36px; height:4px; border-radius:100px; background:var(--line-strong); margin:6px auto 14px; }
.sheet-box h3{ font-family:var(--font-display); font-size:16px; font-weight:700; margin:0 0 4px; }
.sheet-box .sheet-sub{ font-size:11.5px; color:var(--ink-400); margin:0 0 16px; }
.field{ margin-bottom:12px; }
.field label{ display:block; font-size:11.5px; font-weight:600; color:var(--ink-700); margin-bottom:5px; }
.field input, .field select, .field textarea{
  width:100%; border:1px solid var(--line); border-radius:9px; padding:9px 11px;
  font-size:13px; font-family:var(--font-body); color:var(--ink-900); background:var(--bg-canvas);
}
.field-row{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }

/* ---------- info linhas (detalhe) ---------- */
.info-linha{ display:flex; justify-content:space-between; padding:10px 0; border-bottom:1px solid var(--line); font-size:12.5px; }
.info-linha:last-child{ border-bottom:none; }
.info-linha .lbl{ color:var(--ink-400); }
.info-linha .val{ font-weight:600; color:var(--ink-900); text-align:right; }

/* ---------- empty / skeleton ---------- */
.empty-state{ text-align:center; padding:50px 20px; color:var(--ink-400); }
.empty-state svg{ width:40px; height:40px; margin-bottom:12px; opacity:.5; }
.empty-state p{ font-size:12.5px; margin:0; }

.skeleton{ background:linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%); background-size:200% 100%; animation:skeleton-anim 1.3s infinite; border-radius:var(--radius); }
@keyframes skeleton-anim{ 0%{ background-position:200% 0; } 100%{ background-position:-200% 0; } }

.pending-note{ font-size:10.5px; color:var(--ink-400); text-align:center; margin:14px 0 0; line-height:1.5; }

@media (min-width:520px){
  body{ background:linear-gradient(160deg, #efe6d3, #ddd2ba); }
}
