/* Painel adm. Herda tokens, botões, gaveta, chat e toast de style.css; aqui só fica o que é do painel. */
@import url('style.css');

body { min-height: 100dvh; }

/* ===== Login ===== */
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background:
    radial-gradient(ellipse 60% 60% at 10% 0%, rgba(242, 177, 52, 0.25), transparent 60%),
    radial-gradient(ellipse 50% 70% at 100% 100%, rgba(194, 65, 12, 0.35), transparent 60%),
    var(--ink);
}
.login-card {
  width: min(400px, 100%);
  display: grid;
  gap: var(--space-3);
  padding: 36px 32px;
  background: var(--paper);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.login-card .brand-mark { width: 44px; height: 44px; border-radius: 12px; font-size: 1.3rem; margin-bottom: 4px; }
.login-card h1 { margin: 0; font-family: var(--serif); font-size: 1.9rem; font-weight: 600; letter-spacing: -0.02em; }
.login-card p { margin: 0 0 6px; color: var(--muted); }
.login-card input {
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}
.login-card input:focus { outline: var(--focus-ring); outline-offset: 0; }
.login-card .btn { min-height: 48px; }
.err { color: var(--red) !important; font-weight: 600; }

/* ===== Topbar escura ===== */
.topbar {
  height: auto;
  min-height: 72px;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: 12px clamp(16px, 4vw, 40px);
  background: var(--ink);
  color: var(--cream);
}
.admin-brand { display: flex; align-items: center; gap: 12px; }
.admin-brand .brand-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 1.15rem; }
.topbar .brand { display: block; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--cream); line-height: 1.2; }
.topbar .sub { color: #cbb8a4; font-size: 0.82rem; }
.topbar .sub::first-letter { text-transform: uppercase; }
.sub { display: block; font-size: 0.85rem; color: var(--muted); }
.top-actions { display: flex; gap: var(--space-2); }
.btn.ghost {
  padding: var(--space-2) 16px;
  border: 1px solid rgba(251, 243, 230, 0.3);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--cream);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.88rem;
}
.btn.ghost:hover { background: rgba(255, 255, 255, 0.1); }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-5) clamp(16px, 4vw, 40px) 60px;
}

/* ===== Abas (controle segmentado) ===== */
.tabs {
  display: inline-flex;
  gap: 4px;
  margin: var(--space-2) 0 var(--space-5);
  padding: 4px;
  border-radius: var(--radius-pill);
  background: #ebe0cf;
}
.tabs button {
  padding: 9px 22px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  transition: background 0.15s, color 0.15s;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-pressed='true'] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ===== Indicadores ===== */
.stats {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.stat {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: 'ic label' 'val val';
  align-items: center;
  gap: 14px 10px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat-ic {
  grid-area: ic;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.stat > span:not(.stat-ic) { grid-area: label; color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.stat strong {
  grid-area: val;
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat.accent {
  background:
    radial-gradient(ellipse 80% 120% at 100% 0%, rgba(242, 177, 52, 0.3), transparent 60%),
    var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}
.stat.accent > span:not(.stat-ic) { color: #cbb8a4; }
.stat.accent .stat-ic { background: rgba(242, 177, 52, 0.18); color: var(--gold); }

/* ===== Filtros ===== */
.filters {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin: 26px 0 var(--space-4);
}
.filters button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.88rem;
}
.filters button:hover { border-color: var(--accent); }
.filters button[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.filters .count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.72rem;
  text-align: center;
}
.filters button[aria-pressed='true'] .count { background: var(--gold); color: var(--ink); }

/* ===== Pedidos ===== */
.orders {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.none {
  grid-column: 1 / -1;
  margin: var(--space-3) 0 0;
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
  background: var(--paper);
  border: 1px dashed #d8c7b1;
  border-radius: var(--radius);
}
.orders .none::before {
  content: '🧾';
  display: block;
  margin-bottom: 10px;
  font-size: 2.4rem;
}

.order {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.order.novo { box-shadow: 0 0 0 1px #f0cf8a, var(--shadow); }
.order.preparo { border-top-color: #2563eb; }
.order.pronto { border-top-color: var(--green); }
.order.entregue { border-top-color: #9ca3af; }
.order.cancelado { border-top-color: var(--red); }
.order.entregue, .order.cancelado { background: #fcfbfa; box-shadow: none; }

.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-2); }
.order-head h2 { margin: 0; font-size: 1.3rem; font-family: var(--serif); font-weight: 600; }
.order-head time { color: var(--muted); font-size: 0.8rem; }
.pill {
  padding: var(--space-1) 10px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 800;
  background: #fff1d6;
  color: #8a5a00;
  white-space: nowrap;
}
.pill.preparo { background: #dbeafe; color: #1e40af; }
.pill.pronto { background: #dcfce7; color: #166534; }
.pill.entregue { background: #e5e7eb; color: #374151; }
.pill.cancelado { background: #fee2e2; color: #991b1b; }

.cust { font-size: 0.92rem; }
.cust strong { display: block; }
.cust a { color: var(--accent-dark); font-weight: 600; }
.cust .meta { color: var(--muted); font-size: 0.86rem; }

.items {
  margin: 0;
  padding: var(--space-3) 14px;
  list-style: none;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.items li { display: flex; justify-content: space-between; gap: var(--space-2); padding: 3px 0; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.note { margin: 0; padding: var(--space-2) var(--space-3); background: var(--gold-soft); border-radius: var(--radius-sm); font-size: 0.88rem; }
.order-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.order-foot .total { font-family: var(--serif); font-weight: 600; font-size: 1.4rem; color: var(--ink); }
.actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.actions .btn { padding: var(--space-2) 14px; font-size: 0.86rem; }
.btn.next { background: var(--green); color: #fff; }
.btn.next:hover { background: #256640; }
.btn.line { background: #fff; border: 1px solid var(--line-strong); color: var(--ink); }
.btn.line:hover { border-color: var(--accent); color: var(--accent); }
.btn.danger { background: #fff; border: 1px solid #e8a39c; color: var(--red); }
.btn.danger:hover { background: #fef2f2; }

/* ===== Chat do adm: cliente à esquerda, loja à direita ===== */
.msg.cliente { align-self: flex-start; align-items: flex-start; }
.msg.loja { align-self: flex-end; align-items: flex-end; }
.msg.cliente .bubble { background: #fff; color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 6px; border-bottom-right-radius: 18px; }
.msg.loja .bubble { background: var(--accent); color: #fff; border: 0; border-bottom-right-radius: 6px; border-bottom-left-radius: 18px; }
.drawer .none { padding: var(--space-4); border: 0; background: none; }
.drawer-head strong { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }

/* ===== Rota da entrega ===== */
.route {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #eef7f1;
  border: 1px solid #cfe6d7;
}
.route-km { font-size: 0.84rem; font-weight: 700; color: #1f5c38; }
.route-links { display: flex; flex-wrap: wrap; gap: 6px; }
.route-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid #9fcbb0;
  color: #1f5c38;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}
.route-links a:hover { background: var(--green); border-color: var(--green); color: #fff; }

/* ===== Conversas ===== */
.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}
.convs {
  display: grid;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.convs .none { margin: 0; border: 0; border-radius: 0; }
.convs .none::before { content: '💬'; display: block; margin-bottom: 10px; font-size: 2.4rem; }
.conv {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: background 0.15s;
}
.conv:last-child { border-bottom: 0; }
.conv:hover { background: var(--cream); }
.conv.waiting { background: #fffaf0; box-shadow: inset 4px 0 0 var(--accent); }
.conv.waiting:hover { background: var(--gold-soft); }
.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
}
.conv.waiting .avatar { background: var(--accent); color: #fff; }
.conv-main { display: grid; gap: 1px; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.conv-top strong { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-top time { flex-shrink: 0; color: var(--muted); font-size: 0.78rem; }
.conv-meta { color: var(--muted); font-size: 0.8rem; }
.conv-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 0.9rem; }
.conv.waiting .conv-last { color: var(--ink); font-weight: 600; }
.conv .badge { background: var(--accent); }
.conv-ok { color: var(--green); font-weight: 800; }
.actions .btn .badge { margin-left: 2px; background: var(--red); }

/* ===== Acesso por API ===== */
.agent-box {
  display: grid;
  gap: var(--space-2);
  padding: 18px 20px;
  margin-bottom: var(--space-5);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.agent-box h2 { margin: 0; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.agent-box .sub { margin: 0; }
.agent-box .checks input:disabled { opacity: 0.5; }

/* ===== Cardápio (produtos) ===== */
.prod-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: 0 0 var(--space-4);
}
.prod-head .sub { margin: 0; font-weight: 600; }
.prod-head .btn { min-height: 42px; }
.pgrid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.pcard {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.pcard.is-hidden { opacity: 0.6; }
.pthumb {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--gold-soft), var(--accent-soft));
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 2rem;
}
.pthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pinfo { min-width: 0; display: grid; gap: var(--space-1); }
.pinfo h3 { margin: 0; font-family: var(--serif); font-size: 1.1rem; font-weight: 600; overflow-wrap: anywhere; }
.pinfo .meta { margin: 0; color: var(--muted); font-size: 0.86rem; }
.ptags { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.pcard .btn.line { padding: 8px 14px; font-size: 0.86rem; }

/* ===== Editor de produto (gaveta) ===== */
#product-drawer { display: flex; flex-direction: column; width: min(460px, 100%); }
.pform { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pform-body {
  flex: 1;
  overflow-y: auto;
  display: grid;
  gap: var(--space-4);
  align-content: start;
  padding: var(--space-4) var(--space-5);
}
.pform label { display: grid; gap: var(--space-1); font-weight: 700; font-size: 0.88rem; }
.pform input:not([type='checkbox']),
.pform select,
.pform textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
.pform textarea { resize: vertical; }
.pform input:focus,
.pform select:focus,
.pform textarea:focus { outline: var(--focus-ring); outline-offset: 0; }
.pform fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: var(--space-2); }
.pform legend { font-weight: 700; font-size: 0.88rem; padding: 0; margin-bottom: var(--space-2); }
.checks label { display: flex; align-items: center; gap: var(--space-2); font-weight: 500; }
.checks input { width: 18px; height: 18px; accent-color: var(--accent); }
.photo-box {
  position: relative;
  width: 160px;
  height: 160px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: linear-gradient(160deg, var(--gold-soft), var(--accent-soft));
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.9rem;
}
.photo-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo .hint { text-align: left; margin: 0; }
.photo .btn.line { justify-self: start; }
.pform-body .err { margin: 0; }
.pform-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--line);
  background: var(--cream);
}
.pform-actions .btn { padding: 10px 20px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

@media (max-width: 600px) {
  .topbar { padding: 10px 14px; }
  .admin-brand .brand-mark { display: none; }
  .tabs { display: flex; }
  .tabs button { flex: 1; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 14px; gap: 10px 8px; }
  .stat strong { font-size: 1.6rem; }
  .stat.accent { grid-column: 1 / -1; }
  .orders { grid-template-columns: 1fr; }
  .pgrid { grid-template-columns: 1fr; }
  .pcard { grid-template-columns: 72px 1fr auto; }
  .pthumb { width: 72px; height: 72px; }
  .topbar .top-actions .btn.ghost { padding: var(--space-2) var(--space-3); }
}

/* Botão de avisos: chama atenção enquanto estiver desligado */
#notify-btn[aria-pressed='false'] { border-color: var(--gold); color: var(--gold); }
#notify-btn[aria-pressed='true'] { border-color: rgba(95, 208, 139, 0.6); color: #9be3b5; }
@media (max-width: 600px) {
  .top-actions { width: 100%; }
  #notify-btn { flex: 1; }
}

/* ===== Logística ===== */
.tab-badge.gold { background: var(--gold); color: var(--ink); }
.logi-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.logi-head .sub { margin: 0; font-weight: 600; }
.logi-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.logi-actions .btn { min-height: 42px; text-decoration: none; }
.logi-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.logi-map {
  position: sticky;
  top: 90px;
  height: min(620px, calc(100dvh - 130px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #e8e2d8;
  box-shadow: var(--shadow-sm);
  z-index: 0;
}
.logi-list { display: grid; gap: var(--space-3); }
.lcard {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.lcard.preparo { border-left-color: #2563eb; }
.lcard.pronto { border-left-color: var(--green); }
.lcard-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.lcard-title { display: grid; gap: 2px; min-width: 0; }
.lcard-title strong { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.lcard-title span { color: var(--muted); font-size: 0.88rem; overflow-wrap: anywhere; }
.lcard-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 0.84rem; }
.lcard-meta a { color: var(--accent-dark); font-weight: 600; }
.route.warn { background: #fff8e6; border-color: #f0d9a0; }
.route.warn .route-km { color: #8a5a00; }
.route.warn .route-links a { border-color: #e6c77a; color: #8a5a00; }
.lnum, .lpin span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.9rem;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.lnum.preparo, .lpin.preparo span { background: #2563eb; color: #fff; }
.lnum.pronto, .lpin.pronto span { background: var(--green); color: #fff; }
.lpin.store span { width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: var(--gold); font-family: var(--serif); font-style: italic; font-size: 1.1rem; }
.logi-map .none { margin: 0; height: 100%; display: grid; place-items: center; border: 0; }
@media (max-width: 900px) {
  .logi-grid { grid-template-columns: 1fr; }
  .logi-map { position: relative; top: 0; height: 320px; }
}

/* ===== Ícones do topo e das abas ===== */
.btn.ghost, .tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.ghost .ic { width: 18px; height: 18px; flex: none; }
.tabs .ic { display: none; }
.tabs .tab-badge { margin-left: 0; }

/* =====================================================================
   Celular: navegação de app (abas fixas no rodapé), topo compacto,
   números do dia em faixa, filtros com rolagem lateral.
   ===================================================================== */
html, body { overflow-x: clip; }
.wrap, .orders, .order, .lcard, .conv, .pcard, .stats, .stat { min-width: 0; }

@media (max-width: 700px) {
  .wrap { padding: 14px 12px calc(96px + env(safe-area-inset-bottom)); }

  /* Topo numa linha só, ações viram botões redondos */
  .topbar { position: sticky; top: 0; z-index: 30; flex-wrap: nowrap; min-height: 0; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
  .admin-brand { min-width: 0; flex: 1; }
  .admin-brand .brand-mark { display: grid; width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; flex: none; }
  .admin-brand > div { min-width: 0; }
  .topbar .brand { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .sub { font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top-actions { width: auto; flex: none; gap: 6px; }
  .top-actions .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topbar .top-actions .btn.ghost, #notify-btn { flex: none; width: 42px; height: 42px; padding: 0; border-radius: 50%; }
  .btn.ghost .ic { width: 20px; height: 20px; }

  /* Abas = barra inferior */
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
    margin: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-radius: 0; background: var(--paper);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(29, 20, 16, 0.08);
  }
  .tabs button {
    position: relative; flex-direction: column; gap: 3px;
    min-height: 56px; padding: 6px 2px; border-radius: 14px;
    font-size: 0.72rem; line-height: 1.1; color: var(--muted);
  }
  .tabs .ic { display: block; }
  .tabs button[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent-dark); box-shadow: none; }
  .tabs .tab-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; font-size: 0.66rem; box-shadow: 0 0 0 2px var(--paper); }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)) !important; }

  /* Números do dia: 3 pequenos + faturamento numa linha */
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { grid-template-columns: 1fr; grid-template-areas: 'label' 'val'; gap: 4px; padding: 10px 12px; border-radius: 14px; }
  .stat-ic { display: none; }
  .stat > span:not(.stat-ic) { font-size: 0.72rem; }
  .stat strong { font-size: 1.45rem; }
  .stat.accent { grid-column: 1 / -1; grid-template-columns: 1fr auto; grid-template-areas: 'label val'; padding: 12px 14px; }
  .stat.accent strong { font-size: 1.35rem; }

  /* Filtros: uma linha com rolagem lateral */
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 14px -12px 12px; padding: 2px 12px 4px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; min-height: 40px; scroll-snap-align: start; }

  /* Cartões de pedido: botões grandes, fáceis de tocar */
  .orders { gap: 12px; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .actions .btn { min-height: 46px; font-size: 0.92rem; justify-content: center; }
  .actions .btn:only-child, .actions .btn.next { grid-column: 1 / -1; }
  .route-links { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .route-links a { display: flex; align-items: center; justify-content: center; min-height: 40px; text-align: center; }
  .route-links a:last-child:nth-child(odd) { grid-column: 1 / -1; }

  /* Logística */
  .logi-head { margin-bottom: 10px; }
  .logi-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .logi-actions .btn { min-height: 46px; justify-content: center; }
  .logi-map { height: 260px; border-radius: 16px; }
  .lcard { padding: 14px; }
  .lcard-head { grid-template-columns: auto 1fr; }
  .lcard-head .pill { grid-column: 2; justify-self: start; }

  /* Gavetas (conversa e produto) em tela cheia */
  .drawer { width: 100%; height: 100dvh; }
  .drawer-head { padding-top: max(14px, env(safe-area-inset-top)); }
  .chat-input { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .chat-input input { font-size: 16px; } /* evita o zoom automático do iPhone */
  .pform input, .pform select, .pform textarea, .login-card input { font-size: 16px; }
  .pform-actions { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .pform-actions .btn { flex: 1; min-height: 48px; }

  .prod-head { flex-wrap: wrap; }
  .prod-head .btn { min-height: 44px; }
}

/* Botão de enquadrar o mapa da Logística */
.logi-fit { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid rgba(0,0,0,.2); border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; background-clip: padding-box; }
.logi-fit:hover { background: #f4f4f4; }

/* Botões da Logística: centralizados, ícone e texto alinhados */
.logi-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; text-align: center; white-space: nowrap; }
@media (max-width: 700px) {
  .logi-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .logi-actions .btn { min-height: 48px; padding: 0 10px; font-size: 0.86rem; white-space: normal; line-height: 1.15; }
  .logi-actions .btn:only-child, .logi-actions .btn:not([hidden]):first-child:nth-last-child(1) { grid-column: 1 / -1; }
  .logi-head .sub { font-size: 0.82rem; }
}

/* Entregador ao vivo */
.live-tag { padding: 2px 10px; border-radius: 99px; background: #e7f6ec; color: var(--green); font-weight: 800; }
.lpin.moto span { width: 38px; height: 38px; background: #fff; border: 3px solid var(--green); font-size: 1.2rem; }
