:root {
  color-scheme: dark;
  --magenta: #ed1fb8;
  --magenta-neon: #ff2eda;
  --pink-deep: #c41f8a;
  --verde: #01ff8a;
  --roxo: #7b2fb0;
  --indigo: #241c6b;
  --txt: #f5ecf6;
  --muted: rgba(245, 236, 246, .6);
  --glass: rgba(42, 22, 66, .55);
  --glass-bd: rgba(255, 255, 255, .15);
  --f-display: "Anton", sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "Space Mono", ui-monospace, monospace;
  --bg-html: #1d1568;
  --bg-body:
    radial-gradient(circle at 85% -5%, rgba(1, 255, 138, .14), transparent 38%),
    radial-gradient(circle at 0% 100%, rgba(255, 46, 218, .22), transparent 45%),
    linear-gradient(165deg, #1d1568 0%, #6a1f9c 48%, #c41f8e 100%) no-repeat;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { background: var(--bg-html); }
body {
  font-family: var(--f-body);
  color: var(--txt); margin: 0; min-height: 100vh;
  background: var(--bg-body);
}
.app { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; min-height: 100vh; padding: 18px; }
.hidden { display: none !important; }

h1 {
  font-family: var(--f-display); font-weight: 400; letter-spacing: 1px;
  font-size: 30px; margin: 6px 0; text-transform: uppercase; color: #fff;
  text-shadow: 0 0 14px rgba(255, 46, 218, .65);
}
h2 { font-size: 15px; margin: 22px 0 8px; text-transform: uppercase; letter-spacing: 1.5px; color: #fff; font-weight: 800; padding-left: 10px; border-left: 3px solid var(--magenta-neon); }
p.muted { color: rgba(245, 236, 246, .72); font-size: 14px; }

/* marca na tela de login */
.brand { text-align: center; padding: 18px 0 6px; }
.brand-img { width: 130px; height: auto; filter: drop-shadow(0 6px 22px rgba(255, 46, 218, .5)); margin-bottom: -6px; }
.brand-name { font-family: var(--f-display); font-size: 48px; line-height: .9; color: var(--magenta-neon); text-shadow: 0 0 22px rgba(255, 46, 218, .7); letter-spacing: 1px; }
.brand-name .thin { display: block; font-family: "Cormorant Garamond", serif; font-style: italic; font-weight: 500; font-size: 26px; color: #fff; text-shadow: none; letter-spacing: 0; }

/* saldo destaque */
.saldo-box { background: var(--glass); border: 1px solid var(--glass-bd); border-radius: 20px; padding: 24px; text-align: center; margin-bottom: 14px; }
.saldo-box .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 2px; }
.saldo-box .valor { font-family: var(--f-display); font-size: 46px; color: var(--verde); margin-top: 4px; text-shadow: 0 0 18px rgba(1, 255, 138, .55); }

/* botoes */
button {
  width: 100%; padding: 16px; border: 0; border-radius: 14px; font-size: 16px; font-weight: 800;
  cursor: pointer; margin: 6px 0; color: #fff; font-family: var(--f-body); letter-spacing: .3px;
  background: linear-gradient(135deg, var(--magenta), var(--pink-deep));
  box-shadow: 0 6px 20px rgba(237, 31, 184, .4);
}
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; box-shadow: none; }
button.sec { background: transparent; color: #fff; border: 2px solid var(--magenta); box-shadow: none; }
button.ghost { background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; box-shadow: none; }
button.ok { background: linear-gradient(135deg, var(--verde), #03c46c); color: #06371f; box-shadow: 0 6px 20px rgba(1, 255, 138, .4); }
button.danger { background: linear-gradient(135deg, #ff4d6d, #b3261e); box-shadow: 0 6px 20px rgba(179, 38, 30, .4); }
button.small { width: auto; padding: 11px 16px; font-size: 14px; }

/* inputs */
input, select {
  width: 100%; padding: 14px; border: 1.5px solid rgba(255, 255, 255, .3); border-radius: 12px;
  font-size: 16px; margin: 6px 0 12px; background: rgba(0, 0, 0, .32); color: var(--txt);
}
input::placeholder { color: rgba(245, 236, 246, .45); }
input:focus, select:focus { outline: none; border-color: var(--magenta-neon); box-shadow: 0 0 0 3px rgba(255, 46, 218, .2); }
label { display: block; font-size: 14px; color: rgba(245, 236, 246, .88); font-weight: 600; margin-top: 4px; }
select option { color: #1a1a1a; }

/* cards glass */
.card { background: var(--glass); border: 1px solid var(--glass-bd); border-radius: 14px; padding: 16px; margin: 8px 0; }
.card .top { display: flex; justify-content: space-between; align-items: center; }
.card .apelido { font-family: var(--f-display); font-size: 22px; color: #fff; }
.card .item { color: var(--muted); margin-top: 2px; font-size: 14px; }
.row { display: flex; gap: 8px; }

/* badges */
.badge { display: inline-block; padding: 4px 11px; border-radius: 20px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.b-pendente { background: rgba(255, 196, 0, .18); color: #ffd24a; }
.b-confirmado { background: rgba(1, 255, 138, .18); color: var(--verde); }
.b-recusado { background: rgba(255, 77, 109, .2); color: #ff6b85; }

/* qr */
.qr img { width: 240px; height: 240px; display: block; margin: 14px auto; border-radius: 12px; background: #fff; padding: 8px; }
.copia { font-size: 11px; word-break: break-all; background: rgba(0, 0, 0, .3); padding: 10px; border-radius: 8px; color: var(--muted); }

/* lista de produtos */
.prod-item { display: flex; justify-content: space-between; align-items: center; background: var(--glass); border: 2px solid var(--glass-bd); border-radius: 14px; padding: 16px; margin: 8px 0; cursor: pointer; transition: all .12s; }
.prod-item:active { border-color: var(--magenta); }
.prod-item.sel { border-color: var(--magenta-neon); background: rgba(255, 46, 218, .15); box-shadow: 0 0 16px rgba(255, 46, 218, .35); }
.prod-item .prod-nome { font-size: 17px; font-weight: 700; }
.prod-item .prod-preco { font-size: 16px; font-weight: 800; color: var(--verde); }
.prod-item.sel .prod-nome::before { content: "✓ "; color: var(--magenta-neon); }

/* confirmacao pos-pedido */
.confirma { background: var(--glass); border: 1px solid var(--glass-bd); border-radius: 20px; padding: 28px 20px; text-align: center; margin: 8px 0; }
.confirma .check { width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 50%; background: rgba(1, 255, 138, .18); color: var(--verde); font-size: 34px; line-height: 64px; font-weight: 800; box-shadow: 0 0 20px rgba(1, 255, 138, .4); }
.confirma .resumo { font-size: 20px; font-weight: 800; }
.confirma .apelido-dest { font-family: var(--f-display); font-size: 32px; color: var(--magenta-neon); background: rgba(255, 46, 218, .12); border-radius: 14px; padding: 12px; margin-top: 4px; text-shadow: 0 0 16px rgba(255, 46, 218, .5); }

.dica-pedido { color: rgba(245, 236, 246, .7); font-size: 13.5px; line-height: 1.45; margin: 2px 2px 14px; }
.dica-pedido b { color: var(--magenta-neon); font-weight: 700; }
.erro { background: rgba(255, 77, 109, .18); color: #ff8aa0; padding: 10px; border-radius: 10px; font-size: 14px; margin: 8px 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; }

/* sub-navegação do painel admin */
.subnav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 12px 0 16px; }
.subnav .tab {
  flex: 1 1 auto; max-width: 130px; width: auto; margin: 0; padding: 11px 10px; font-size: 13.5px; font-weight: 700;
  white-space: nowrap;
  background: rgba(255, 255, 255, .06); color: rgba(245, 236, 246, .7);
  border: 1px solid var(--glass-bd); box-shadow: none;
}
.cli-saldo { font-family: var(--f-display); font-size: 20px; color: var(--verde); }

/* passos da página Como usar */
.passo { display: flex; gap: 14px; align-items: flex-start; background: var(--glass); border: 1px solid var(--glass-bd); border-radius: 16px; padding: 18px; margin: 10px 0; }
.passo-num { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--magenta), var(--pink-deep)); color: #fff; font-family: var(--f-display); font-size: 22px; text-align: center; line-height: 40px; box-shadow: 0 4px 14px rgba(237, 31, 184, .4); }
.passo-txt b { font-size: 17px; }
.passo-txt p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.subnav .tab.ativa {
  background: linear-gradient(135deg, var(--magenta), var(--pink-deep)); color: #fff;
  border-color: transparent; box-shadow: 0 4px 14px rgba(237, 31, 184, .4);
}

/* resumo de vendas (histórico admin) */
.resumo-vendas { background: var(--glass); border: 1px solid var(--glass-bd); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.resumo-vendas .rv-grid { display: flex; gap: 8px; }
.resumo-vendas .rv-card { flex: 1; text-align: center; background: rgba(0, 0, 0, .22); border-radius: 12px; padding: 12px 6px; }
.resumo-vendas .rv-lbl { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.resumo-vendas .rv-card b { font-family: var(--f-display); font-size: 20px; font-weight: 400; }
.resumo-vendas .rv-pix { color: var(--magenta-neon); }
.resumo-vendas .rv-vend { color: var(--verde); }
.resumo-vendas .rv-cart { color: #6fd3ff; }
.resumo-vendas .rv-nums { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* itens vendidos (ranking) */
.ist-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--glass); border: 1px solid var(--glass-bd); border-radius: 10px; margin: 6px 0; }
.ist-row .ist-nome { flex: 1; font-weight: 600; }
.ist-row .ist-qtd { font-family: var(--f-display); color: #fff; font-size: 18px; }
.ist-row .ist-val { color: var(--verde); font-weight: 700; min-width: 64px; text-align: right; }
.status-pag { padding: 14px; border-radius: 12px; text-align: center; font-weight: 800; margin-top: 12px; }

/* ---- Fallbacks p/ navegadores antigos ---- */
/* Sem gap em flex (Safari < 14.1, Chrome antigo): espaça os filhos com margem */
@supports not (gap: 1px) {
  .row { margin-left: -4px; margin-right: -4px; }
  .row > * { margin-left: 4px; margin-right: 4px; }
}

/* =================================================================
   TEMA "NEW" — identidade da landing (preto, rosa-choque, fontes do deck)
   ================================================================= */
[data-theme="new"] {
  --magenta: #ff4d97;
  --magenta-neon: #ff4d97;
  --pink-deep: #d62f74;
  --verde: #01ff8a;
  --txt: #f4f3f5;
  --muted: #97939c;
  --glass: #151517;
  --glass-bd: #2a2a2f;
  --f-display: "Bricolage Grotesque", system-ui, sans-serif;
  --f-body: "Space Grotesk", system-ui, sans-serif;
  --f-mono: "Space Mono", ui-monospace, monospace;
  --bg-html: #0d0d0f;
  --bg-body:
    radial-gradient(120% 80% at 50% -8%, rgba(255, 77, 151, .12), transparent 58%),
    radial-gradient(100% 70% at 0% 40%, rgba(255, 77, 151, .06), transparent 50%),
    #0d0d0f;
}
[data-theme="new"] h1 { color: var(--magenta); text-transform: none; letter-spacing: -1px; text-shadow: none; font-weight: 800; }
[data-theme="new"] h2 { color: var(--magenta); border-left: 0; padding-left: 0; text-transform: none; letter-spacing: -.5px; font-family: var(--f-display); font-size: 18px; }
[data-theme="new"] .brand-name { color: var(--magenta); text-shadow: none; letter-spacing: -2px; font-weight: 800; }
[data-theme="new"] .brand-name .thin { font-family: var(--f-mono); font-style: normal; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--magenta); }
[data-theme="new"] .brand-img { display: none; }
.brand-img-color { display: none; }
[data-theme="new"] .brand-img-color { display: block; width: min(280px, 72vw); height: auto; border-radius: 16px; margin: 0 auto 14px; box-shadow: 0 16px 50px rgba(255, 77, 151, .25); }
[data-theme="new"] .saldo-box .valor { text-shadow: none; }
[data-theme="new"] .saldo-box .label { font-family: var(--f-mono); letter-spacing: 2px; }
[data-theme="new"] button { background: var(--magenta); box-shadow: none; font-family: var(--f-body); font-weight: 800; border-radius: 10px; }
[data-theme="new"] button.ok { background: var(--verde); color: #06371f; box-shadow: none; }
[data-theme="new"] button.danger { background: #ff4d6d; box-shadow: none; }
[data-theme="new"] button.sec { background: transparent; color: var(--magenta); border: 1px solid var(--magenta); }
[data-theme="new"] button.ghost { background: transparent; }
[data-theme="new"] .card, [data-theme="new"] .saldo-box, [data-theme="new"] .confirma, [data-theme="new"] .prod-item, [data-theme="new"] .resumo-vendas, [data-theme="new"] .rv-card { border-color: var(--glass-bd); }
[data-theme="new"] .subnav .tab.ativa { background: var(--magenta); box-shadow: none; }
[data-theme="new"] .confirma .apelido-dest, [data-theme="new"] .card .apelido, [data-theme="new"] .cli-saldo, [data-theme="new"] .rv-card b { text-shadow: none; }

/* botão de troca de tema */
.theme-toggle {
  position: fixed; right: 12px; bottom: 12px; z-index: 50;
  width: auto; padding: 9px 14px; margin: 0; border-radius: 30px;
  font-family: var(--f-mono); font-size: 12px; font-weight: 700; letter-spacing: 1px;
  background: rgba(0,0,0,.55); color: var(--txt); border: 1px solid var(--glass-bd);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: none; cursor: pointer;
}
