/* App KazaKora Vendas: cara de app nativo do iPhone, na cor da loja. */
:root {
  --marca: #F2691C;
  --sobre-marca: #FFFFFF;
  --sobre-marca-suave: rgba(255, 255, 255, .78);
  --trilho: rgba(0, 0, 0, .14);
  --segmento-sel: #FFFFFF;
  --segmento-sel-texto: #C24F0E;
  --ativo: #E35F12;
  --serie-visitas: rgba(242, 105, 28, .22);
  --serie-pedidos: #E35F12;
  --botao-login: #FFFFFF;
  --botao-login-texto: #C24F0E;
  --cartao: #FFFFFF;
  --texto: #111113;
  --suave: #6C6C72;
  --linha: rgba(60, 60, 67, .13);
  --campo: rgba(255, 255, 255, .96);
  --sobe: #1B8A3A;
  --desce: #D23B2F;
  --abas: rgba(250, 250, 252, .86);
  --abas-inativa: #8E8E93;
  --selo-pago: #E7F6EC; --selo-pago-t: #17723A;
  --selo-espera: #FFF4DB; --selo-espera-t: #8A5A00;
  --selo-cancel: #F1F1F3; --selo-cancel-t: #6C6C72;
  --selo-envio: #E8F0FE; --selo-envio-t: #1D4FB8;
  --raio: 20px;
  --fonte: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --marca: #B94A0C;
    --trilho: rgba(0, 0, 0, .28);
    --segmento-sel: #FFFFFF;
    --ativo: #FF8A45;
    --serie-visitas: rgba(255, 138, 69, .28);
    --serie-pedidos: #FF8A45;
    --cartao: #1C1C1E;
    --texto: #F2F2F7;
    --suave: #9A9AA1;
    --linha: rgba(84, 84, 88, .55);
    --campo: rgba(28, 28, 30, .96);
    --sobe: #3DD46A;
    --desce: #FF6B5E;
    --abas: rgba(22, 22, 24, .86);
    --selo-pago: rgba(61, 212, 106, .16); --selo-pago-t: #5BE584;
    --selo-espera: rgba(255, 196, 0, .16); --selo-espera-t: #FFD166;
    --selo-cancel: rgba(142, 142, 147, .2); --selo-cancel-t: #B9B9BF;
    --selo-envio: rgba(80, 140, 255, .18); --selo-envio-t: #8DB4FF;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: var(--marca);
  color: var(--texto);
  font: 17px/1.35 var(--fonte);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
input { -webkit-user-select: text; user-select: text; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: default; }
img { display: block; }

/* ---------- Login ---------- */
.login { display: none; position: fixed; inset: 0; flex-direction: column; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 48px) 24px calc(env(safe-area-inset-bottom) + 20px); overflow-y: auto; color: var(--sobre-marca); }
[data-sessao="fora"] .login { display: flex; }
.login-miolo { width: 100%; max-width: 420px; margin: 0 auto; text-align: center; }
.login-logo { width: 104px; height: 104px; margin: 24px auto 20px; border-radius: 24px; box-shadow: 0 10px 30px rgba(0,0,0,.22); }
.login h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: .3px; }
.login-sub { margin: 6px 0 36px; color: var(--sobre-marca-suave); font-size: 17px; }
.grupo { background: var(--campo); border-radius: 14px; overflow: hidden; text-align: left; color: var(--texto); }
.campo { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; }
.campo + .campo { border-top: .5px solid var(--linha); }
.campo span { width: 64px; flex: none; font-size: 17px; }
.campo input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--texto); font: 17px var(--fonte); padding: 14px 0; }
.campo input::placeholder { color: #A1A1A8; }
.botao-login { display: block; width: 100%; margin-top: 20px; min-height: 52px; border-radius: 14px; background: var(--botao-login); color: var(--botao-login-texto);
  font-size: 17px; font-weight: 600; transition: transform .12s, opacity .12s; }
.botao-login:active { transform: scale(.98); opacity: .85; }
.botao-login:disabled { opacity: .6; }
.login-erro { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.22); font-size: 15px; }
.login-rodape { text-align: center; font-size: 13px; color: var(--sobre-marca-suave); margin: 24px 0 0; }

/* ---------- Estrutura ---------- */
.app { display: none; position: fixed; inset: 0; }
[data-sessao="dentro"] .app { display: block; }
.telas { position: absolute; inset: 0; overflow: hidden; }
.tela { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding-bottom: calc(env(safe-area-inset-bottom) + 76px); background: var(--marca);
  transition: transform .38s cubic-bezier(.32, .72, 0, 1), opacity .38s; will-change: transform; }
.tela[hidden] { display: none; }
.tela.empilhada { transform: translateX(100%); box-shadow: -8px 0 24px rgba(0,0,0,.12); z-index: 2; }
.tela.empilhada.entrou { transform: translateX(0); }
.tela.recuada { transform: translateX(-28%); }

.cabeca { padding: calc(env(safe-area-inset-top) + 14px) 20px 14px; color: var(--sobre-marca); }
.cabeca-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.titulo-grande { margin: 2px 0 0; font-size: 34px; font-weight: 700; letter-spacing: .2px; line-height: 1.15; }
.subtitulo { margin: 2px 0 0; font-size: 15px; color: var(--sobre-marca-suave); }
.marca-mini { display: flex; align-items: center; gap: 10px; }
.marca-mini img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.voltar { display: inline-flex; align-items: center; gap: 2px; margin-left: -8px; padding: 6px 8px; font-size: 17px; color: var(--sobre-marca); }
.voltar svg { width: 13px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.voltar:active { opacity: .5; }

.miolo { padding: 0 16px; }

/* Segmento (Hoje · Semana · Mês) */
.segmento { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; margin: 6px 0 18px; padding: 3px; border-radius: 12px; background: var(--trilho); }
.segmento button { min-height: 34px; border-radius: 9px; font-size: 15px; font-weight: 600; color: var(--sobre-marca); transition: background .2s, color .2s; }
.segmento button[aria-pressed="true"] { background: var(--segmento-sel); color: var(--segmento-sel-texto); box-shadow: 0 2px 8px rgba(0,0,0,.14); }

/* Cartões */
.cartao { background: var(--cartao); border-radius: var(--raio); padding: 18px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.cartao-topo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cartao h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: .1px; }
.cartao .acao { font-size: 15px; color: var(--ativo); font-weight: 500; }
.cartao .acao:active { opacity: .5; }

.numeros { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.numero { background: var(--cartao); border-radius: var(--raio); padding: 16px 16px 14px; min-height: 118px; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.numero h3 { margin: 0; font-size: 14px; font-weight: 500; color: var(--suave); }
.numero .valor { margin: auto 0 4px; font-size: 30px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.numero .valor.longo { font-size: 24px; }
.var { margin: 0; font-size: 13px; font-weight: 600; color: var(--suave); font-variant-numeric: tabular-nums; min-height: 17px; }
.var .sobe { color: var(--sobe); }
.var .desce { color: var(--desce); }
.var small { font-weight: 400; color: var(--suave); }

/* Gráfico */
.legenda { display: flex; gap: 14px; font-size: 13px; color: var(--suave); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda span::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--serie-visitas); }
.legenda .l-pedidos::before { background: var(--serie-pedidos); border-radius: 50%; }
.grafico svg { display: block; width: 100%; height: 150px; overflow: visible; }
.grafico .eixo { font-size: 11px; fill: var(--suave); font-family: var(--fonte); }

/* Listas */
.lista { list-style: none; margin: 0; padding: 0; }
.lista > li + li { border-top: .5px solid var(--linha); }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; min-height: 60px; transition: opacity .12s; }
button.item, a.item { width: 100%; text-align: left; }
button.item:active, a.item:active { opacity: .55; }
.item-foto { width: 46px; height: 46px; flex: none; border-radius: 10px; object-fit: cover; background: var(--linha); }
.sem-foto { display: flex; align-items: center; justify-content: center; color: var(--suave); }
.sem-foto svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.item-meio { flex: 1; min-width: 0; }
.item-titulo { margin: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { margin: 2px 0 0; font-size: 14px; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-fim { text-align: right; flex: none; }
.item-valor { margin: 0 0 4px; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chevron { width: 8px; height: 13px; flex: none; fill: none; stroke: #C4C4C7; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.selo { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--selo-cancel); color: var(--selo-cancel-t); }
.selo.pago { background: var(--selo-pago); color: var(--selo-pago-t); }
.selo.espera { background: var(--selo-espera); color: var(--selo-espera-t); }
.selo.envio { background: var(--selo-envio); color: var(--selo-envio-t); }

/* Filtros em pílula (Pedidos) */
.pilulas { display: flex; gap: 8px; overflow-x: auto; margin: 4px -16px 16px; padding: 0 16px; scrollbar-width: none; }
.pilulas::-webkit-scrollbar { display: none; }
.pilulas button { flex: none; min-height: 34px; padding: 0 16px; border-radius: 999px; background: var(--trilho); color: var(--sobre-marca); font-size: 15px; font-weight: 600; }
.pilulas button[aria-pressed="true"] { background: var(--segmento-sel); color: var(--segmento-sel-texto); }

/* Busca (Produtos) */
.busca { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; padding: 0 12px; min-height: 40px; border-radius: 12px; background: var(--campo); color: var(--suave); }
.busca svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.busca input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--texto); font: 17px var(--fonte); }

/* Detalhe do pedido */
.linhas { margin: 0; }
.linhas div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; font-size: 16px; }
.linhas div + div { border-top: .5px solid var(--linha); }
.linhas dt { color: var(--suave); }
.linhas dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.linhas .total dt, .linhas .total dd { color: var(--texto); font-weight: 700; font-size: 18px; }
.resumo-pedido { text-align: center; padding: 22px 18px; }
.resumo-pedido .grande { color: var(--texto); margin: 8px 0 6px; font-size: 38px; font-weight: 700; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.resumo-pedido p { margin: 0; color: var(--suave); font-size: 15px; }
.rastreio { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 16px; -webkit-user-select: text; user-select: text; }

/* Mais */
.ajuste { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 50px; padding: 4px 0; font-size: 17px; text-align: left; transition: opacity .12s; }
.ajuste + .ajuste { border-top: .5px solid var(--linha); }
.ajuste:active { opacity: .5; }
.ajuste.perigo { color: var(--desce); }
.ajuste .dir { color: var(--suave); font-size: 15px; }
.chave { position: relative; width: 51px; height: 31px; flex: none; border-radius: 999px; background: rgba(120,120,128,.32); transition: background .25s; }
.chave::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .25s; }
.chave[aria-checked="true"] { background: #34C759; }
.chave[aria-checked="true"]::after { transform: translateX(20px); }
.nota { margin: 8px 4px 18px; font-size: 13px; color: var(--sobre-marca-suave); }
.texto-suave { color: var(--suave); font-size: 15px; margin: 0; }
.aviso { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 15px; background: var(--selo-cancel); color: var(--texto); }
.aviso.ok { background: var(--selo-pago); color: var(--selo-pago-t); }
.aviso.erro { background: rgba(210, 59, 47, .12); color: var(--desce); }

.vazio { padding: 22px 0; text-align: center; color: var(--suave); font-size: 15px; }
.carregar-mais { display: block; width: 100%; padding: 14px; color: var(--ativo); font-weight: 600; }
.esqueleto { color: transparent !important; background: linear-gradient(90deg, var(--linha) 25%, rgba(127,127,127,.08) 50%, var(--linha) 75%); background-size: 200% 100%; border-radius: 8px; animation: brilho 1.2s infinite; }
@keyframes brilho { to { background-position: -200% 0; } }

/* Puxar para atualizar */
.puxar { display: flex; justify-content: center; height: 0; overflow: visible; }
.giro { width: 26px; height: 26px; margin-top: -40px; border-radius: 50%; border: 2.5px solid var(--sobre-marca-suave); border-top-color: transparent; opacity: 0; transition: opacity .15s; }
.puxando .giro { opacity: 1; }
.atualizando .giro { opacity: 1; animation: gira .7s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* Abas */
.abas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 4px 4px max(6px, calc(env(safe-area-inset-bottom) - 14px)); background: var(--abas);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--linha); }
.aba { display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 44px; padding-top: 2px; color: var(--abas-inativa); font-size: 10px; font-weight: 500; letter-spacing: .1px; transition: transform .12s; }
.aba:active { transform: scale(.92); }
.aba svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.aba[data-aba="mais"] svg { fill: currentColor; stroke: none; }
.aba[aria-current="page"] { color: var(--ativo); }
.aba[aria-current="page"] svg { stroke-width: 1.9; }
