:root {
  --verde-jsc: #8cc63f;
  --vermelho-jsc: #e30613;
  --fundo: #f5f5f5;
  --texto: #1a1a1a;
  --branco: #ffffff;
  --sombra: 0 8px 24px rgba(0, 0, 0, 0.08);
  --raio: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--verde-jsc);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.topbar {
  background: var(--branco);
  border-bottom: 4px solid var(--verde-jsc);
  box-shadow: var(--sombra);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1rem;
}
.brand span:first-child {
  color: var(--verde-jsc);
}
.brand span:last-child {
  color: var(--vermelho-jsc);
  font-size: 0.78rem;
}

.clover {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--verde-jsc) 60%, var(--vermelho-jsc) 60%);
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.nav-links a {
  font-weight: 600;
  color: var(--texto);
}
.nav-links a:hover {
  color: var(--verde-jsc);
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  flex: 1 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Página de login centrada (horizontal e vertical) */
.wrap.wrap-login-centro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 5rem);
  max-width: none;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
}

.wrap.wrap-login-centro h1 {
  text-align: center;
  align-self: center;
  width: min(22rem, calc(100vw - 2rem));
  max-width: 100%;
  box-sizing: border-box;
}

.wrap.wrap-login-centro .flash {
  align-self: center;
  width: min(22rem, calc(100vw - 2rem));
  max-width: 100%;
  box-sizing: border-box;
}

.wrap.wrap-login-centro .panel-login {
  align-self: center;
  width: min(22rem, calc(100vw - 2rem));
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 0;
}

.wrap.wrap-login-centro .panel-login input[type="text"],
.wrap.wrap-login-centro .panel-login input[type="password"] {
  max-width: none;
  width: 100%;
}

.wrap.wrap-login-centro .panel-login select {
  max-width: none;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--branco);
  cursor: pointer;
}

.wrap.wrap-login-centro .login-credito {
  text-align: center;
  align-self: center;
  width: min(22rem, calc(100vw - 2rem));
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 1.5rem;
  margin-bottom: 0;
  font-size: 0.88rem;
  color: #777;
}

.wrap.wrap-login-centro .login-credito-sep {
  opacity: 0.55;
}

.wrap.wrap-login-centro .login-credito .versao-app {
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #666;
}

h1 {
  font-size: 1.35rem;
  margin: 0 0 1rem;
  font-weight: 700;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
}

.card-jogo {
  background: var(--branco);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.12s;
  text-align: center;
}
.card-jogo:hover {
  border-color: var(--verde-jsc);
  transform: translateY(-2px);
}

.card-jogo .logo {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fafafa, #eee);
  padding: 0.5rem;
}
.card-jogo .logo img {
  max-width: 100%;
  max-height: 100px;
  object-fit: contain;
}

.card-jogo .body {
  padding: 0.85rem 0.75rem 1rem;
}
.card-jogo h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--texto);
}
.badge-stock {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(140, 198, 63, 0.18);
  color: #3d5c14;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
}
.btn-verde {
  background: var(--verde-jsc);
  color: #fff;
}
.btn-verde:hover {
  filter: brightness(1.05);
}
.btn-vermelho {
  background: var(--vermelho-jsc);
  color: #fff;
}
.btn-vermelho:hover {
  filter: brightness(1.05);
}
.btn-ghost {
  background: #e8e8e8;
  color: var(--texto);
}

.panel {
  background: var(--branco);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  max-width: 420px;
  padding: 0.55rem 0.65rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.form-row {
  margin-bottom: 1rem;
}

.flash {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 600;
}
.flash-ok {
  background: rgba(140, 198, 63, 0.25);
  color: #2d4a0a;
}
.flash-erro {
  background: rgba(227, 6, 19, 0.12);
  color: #a1040d;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.data th,
table.data td {
  text-align: left;
  padding: 0.5rem 0.45rem;
  border-bottom: 1px solid #e5e5e5;
}
table.data th {
  background: #fafafa;
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-backdrop.aberto {
  display: flex;
}

.modal {
  background: var(--branco);
  border-radius: var(--raio);
  max-width: min(100vw - 1.5rem, 26rem);
  width: 100%;
  padding: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  border-top: 5px solid var(--verde-jsc);
}

.modal h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.pay-btn {
  min-height: 88px;
  font-size: 1rem;
  flex-direction: column;
  border-radius: var(--raio);
}
.pay-btn svg {
  width: 36px;
  height: 36px;
}

.admin-bar {
  flex-shrink: 0;
  background: linear-gradient(90deg, #3a0a0d, var(--vermelho-jsc));
  color: #fff;
  padding: 0.45rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 520px) {
  .pay-grid {
    grid-template-columns: 1fr;
  }
}

.valor-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.valor-chip {
  min-height: 48px;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 10px;
  border: 2px solid var(--verde-jsc);
  background: rgba(140, 198, 63, 0.12);
  color: #2d5016;
  cursor: pointer;
  font-family: inherit;
}
.valor-chip:hover {
  background: rgba(140, 198, 63, 0.28);
}
.valor-chip-outro {
  grid-column: 1 / -1;
  border-color: #888;
  background: #eee;
  color: var(--texto);
}
.valor-chip-outro:hover {
  background: #e0e0e0;
}

.valor-display {
  width: 100%;
  box-sizing: border-box;
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.65rem 0.85rem;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 3px solid var(--verde-jsc);
  border-radius: 12px;
  background: linear-gradient(180deg, #fafafa, #f0f0f0);
  color: var(--texto);
  font-variant-numeric: tabular-nums;
}

.teclado-web {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-top: 0.75rem;
  touch-action: manipulation;
  user-select: none;
}

.teclado-web .tecla {
  min-height: 3.25rem;
  font-size: 1.35rem;
  font-weight: 800;
  font-family: inherit;
  border: 2px solid #c8c8c8;
  border-radius: 10px;
  background: var(--branco);
  color: var(--texto);
  cursor: pointer;
  box-shadow: 0 2px 0 #ddd;
}

.teclado-web .tecla:active {
  transform: translateY(1px);
  box-shadow: none;
}

.teclado-web .tecla-virgula {
  font-size: 1.5rem;
  font-weight: 900;
  border-color: var(--verde-jsc);
  color: #2d5016;
}

.teclado-web .tecla-apagar {
  font-size: 1.2rem;
  border-color: #999;
}

.teclado-web .tecla-larga {
  grid-column: 1 / -1;
  min-height: 2.85rem;
  font-size: 1rem;
  font-weight: 700;
  border-color: var(--vermelho-jsc);
  color: var(--vermelho-jsc);
  background: rgba(227, 6, 19, 0.06);
}
