:root {
  --bg: #121611;
  --bg-2: #1b2318;
  --bg-3: #242e1f;
  --ink: #f6f3ea;
  --muted: #a7b09d;
  --line: rgba(223, 245, 106, 0.16);
  --acid: #dff56a;
  --acid-dim: rgba(223, 245, 106, 0.12);
  --clay: #e7a27a;
  --good: #b6f7a4;
  --bad: #ff8d72;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --nav: 76px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Outfit, "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(223, 245, 106, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

#app { min-height: 100dvh; }

.login {
  min-height: 100dvh;
  display: grid;
  align-content: end;
  padding: calc(28px + var(--safe-t)) 22px calc(28px + var(--safe-b));
  gap: 22px;
}
.marca {
  display: flex;
  align-items: center;
  gap: 12px;
}
.marca b {
  font-family: Fraunces, Georgia, serif;
  font-size: 42px;
  letter-spacing: -0.04em;
  font-weight: 560;
}
.selo {
  width: 46px;
  height: 46px;
}
.selo svg { width: 46px; height: 46px; }
.login p.lead { margin: 0; max-width: 28ch; color: var(--muted); font-size: 16px; line-height: 1.45; }
.cartao {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 18px;
  box-shadow: var(--shadow);
}
label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
input {
  width: 100%;
  background: #10150f;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 14px;
  outline: none;
}
input:focus { border-color: var(--acid); }
.acoes { display: flex; gap: 10px; margin-top: 14px; }
.btn {
  border: 0;
  background: var(--acid);
  color: #1a220c;
  font-weight: 700;
  border-radius: 999px;
  padding: 14px 18px;
  min-height: 48px;
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.6; }
.erro { color: var(--bad); min-height: 1.2em; margin: 10px 0 0; font-size: 14px; }
.nome-oi { font-family: Fraunces, Georgia, serif; font-size: 28px; margin: 0 0 6px; }

.shell { min-height: 100dvh; padding-bottom: calc(var(--nav) + var(--safe-b)); }
.topo {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: calc(18px + var(--safe-t)) 18px 8px;
}
.topo .oi { color: var(--muted); font-size: 13px; margin: 0; }
.topo h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  font-size: 34px;
  letter-spacing: -0.04em;
  margin: 2px 0 0;
}
.vivo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--acid);
  font-size: 13px;
  font-weight: 600;
}
.ponto {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 0 rgba(223, 245, 106, 0.7);
  animation: pulso 1.8s infinite;
}
@keyframes pulso {
  70% { box-shadow: 0 0 0 8px rgba(223, 245, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(223, 245, 106, 0); }
}

.hero {
  margin: 8px 18px 14px;
  padding: 18px 18px 16px;
  border-radius: 28px;
  background:
    radial-gradient(400px 120px at 100% 0%, rgba(223, 245, 106, 0.2), transparent 50%),
    var(--bg-2);
  border: 1px solid var(--line);
}
.hero span { color: var(--muted); font-size: 13px; }
.hero strong {
  display: block;
  margin-top: 4px;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(40px, 12vw, 64px);
  font-weight: 680;
  letter-spacing: -0.045em;
  line-height: 0.95;
}
.hero em { font-style: normal; color: var(--muted); font-size: 13px; }

.grade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 18px;
}
.stat {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px;
  min-height: 92px;
}
.stat svg { width: 22px; height: 22px; }
.stat b { display: block; margin-top: 10px; font-size: 18px; letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-size: 12px; }

.sec { padding: 18px 18px 0; }
.sec h2 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.linha-titulo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.linha-titulo h2 { margin: 0; }
.linha-titulo .btn { min-height: 40px; padding: 10px 14px; }
.nova { display: grid; gap: 8px; margin-bottom: 28px; }
.nova label { margin-top: 6px; }
.nova select, .arquivo input {
  width: 100%;
  background: #10150f;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.arquivo { display: grid; gap: 6px; margin-top: 8px; }
.arquivo span { color: var(--muted); font-size: 13px; }

.lista { display: grid; gap: 10px; }
.item, .pessoa {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 12px;
}
.item:active, .pessoa:active { transform: scale(0.99); }
.icone {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--acid-dim);
}
.icone svg { width: 22px; height: 22px; }
.item > div, .pessoa > div { min-width: 0; }
.item .quem, .pessoa .quem { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item small, .pessoa small { display: block; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dir { text-align: right; }
.dir b { display: block; font-variant-numeric: tabular-nums; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-3);
  color: var(--muted);
}
.tag.vivo { background: var(--acid-dim); color: var(--acid); }
.tag.ruim { color: var(--bad); }
.entrou { color: var(--good); }
.saiu { color: var(--bad); }
.saque { color: var(--clay); }

.aviso {
  margin: 14px 18px 0;
  padding: 14px;
  border-radius: 22px;
  border: 1px dashed var(--line);
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(223, 245, 106, 0.04);
}
.aviso p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.aviso b { color: var(--ink); }

.nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + var(--safe-b));
  height: 64px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(22, 28, 18, 0.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  backdrop-filter: blur(16px);
  z-index: 5;
}
.nav button {
  background: transparent;
  border: 0;
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 2px;
  font-size: 11px;
  min-width: 64px;
}
.nav button.ativa { color: var(--acid); }
.nav svg { width: 22px; height: 22px; }
.nav button.ativa svg { animation: balanca 0.6s ease; }
@keyframes balanca {
  0% { transform: translateY(3px) scale(0.9); }
  60% { transform: translateY(-2px) scale(1.05); }
  100% { transform: none; }
}
.moeda { transform-origin: 50% 50%; animation: gira 4.5s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.fuma { animation: sobe 1.8s ease-in-out infinite; }
@keyframes sobe {
  0%, 100% { transform: translateY(1px); opacity: 0.4; }
  50% { transform: translateY(-2px); opacity: 1; }
}

.vazio { color: var(--muted); padding: 8px 2px 18px; }
.pix {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px;
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}
.pix img {
  width: 180px;
  height: 180px;
  border-radius: 16px;
  background: #fff;
  justify-self: center;
}
.codigo {
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
  color: var(--muted);
  margin: 0;
  max-height: 4.4em;
  overflow: auto;
}
.pisca { transform-origin: 50% 50%; animation: pisca 1.6s ease-in-out infinite; }
@keyframes pisca {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
.detalhe { padding-bottom: 24px; }
.voltar {
  background: transparent;
  border: 0;
  color: var(--acid);
  padding: 0;
  margin-bottom: 8px;
}
.linha-tempo { display: grid; gap: 8px; }
.quando { color: var(--muted); font-size: 12px; }

@media (min-width: 960px) {
  body { display: block; }
  .shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    padding-bottom: 0;
    min-height: 100dvh;
  }
  .nav { grid-column: 1; grid-row: 1; }
  .miolo { grid-column: 2; grid-row: 1; min-width: 0; }
  .nav {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    bottom: auto;
    height: 100dvh;
    width: auto;
    border-radius: 0;
    border-left: 0;
    border-top: 0;
    border-bottom: 0;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    padding: 28px 14px;
  }
  .nav button { grid-template-columns: 22px 1fr; justify-items: start; align-items: center; width: 100%; font-size: 15px; padding: 10px; border-radius: 14px; }
  .nav button.ativa { background: var(--acid-dim); }
  .miolo { max-width: 1080px; }
  .grade { grid-template-columns: repeat(4, 1fr); }
  .login { align-content: center; justify-content: center; }
  .login .cartao, .login .marca, .login .lead { width: min(440px, 100%); }
}

@media (prefers-reduced-motion: reduce) {
  .ponto, .moeda, .fuma, .pisca, .nav button.ativa svg { animation: none; }
}
