label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.form-card {
  margin-top: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.section-header h2 {
  margin-bottom: 6px;
}

.linhas-form {
  display: grid;
  gap: 16px;
}

.linha {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 1fr 1fr;
  gap: 14px;
  background: #0a0a0a;
  border: 1px solid #1f1f1f;
  border-radius: 22px;
  padding: 18px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 28px;
}

.btn-secondary,
.verDetalhesBtn {
  background: #111;
  color: white;
  border: 1px solid #282828;
}

.btn-secondary:hover,
.verDetalhesBtn:hover {
  box-shadow: none;
}

/* RESUMO */

#resumo {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}

#resumo h2 {
  display: none;
}

#resumo p {
  background: linear-gradient(180deg, #121212, #090909);
  border: 1px solid #222;
  border-radius: 18px;
  padding: 18px;
  font-weight: 900;
}

/* CARD DA APOSTA */

#lista > div {
  background: linear-gradient(180deg, #151515, #0b0b0b);
  border: 1px solid #222;
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.card-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
}

.card-topo h3 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 4px;
}

.mercado {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.acoes-topo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.filtros-historico {
  display: grid;
  grid-template-columns: 220px 220px 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.filtros-historico select,
.filtros-historico input {
  height: 52px;
  border-radius: 16px;
  border: 1px solid #232323;
  background: #0d0d0d;
  color: #fff;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  transition: 0.2s;
}

.filtros-historico select:focus,
.filtros-historico input:focus {
  outline: none;
  border-color: rgba(244, 207, 99, 0.5);
  box-shadow: 0 0 0 4px rgba(244, 207, 99, 0.08);
}

.filtros-historico input::placeholder {
  color: #777;
}

@media (max-width: 900px) {
  .filtros-historico {
    grid-template-columns: 1fr;
  }
}

.status {
  justify-self: center;
  padding: 7px 12px;
  font-size: 12px;
}

/* BOTÕES */

.editarApostaBtn {
  background: var(--gold);
  color: black;
}

.excluirApostaBtn {
  background: #160808;
  color: #ff4d4d;
  border: 1px solid rgba(255, 77, 77, 0.25);
}

.excluirApostaBtn:hover {
  box-shadow: 0 0 24px rgba(255, 77, 77, 0.15);
}

.editarApostaBtn,
.excluirApostaBtn,
.verDetalhesBtn {
  height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  margin: 0;
}

/* INFOS */

.infos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.info-box {
  background: #080808;
  border: 1px solid #202020;
  border-radius: 16px;
  padding: 12px 14px;
}

.info-box span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.info-box strong {
  font-size: 20px;
  font-weight: 900;
}

.azul {
  color: var(--gold);
}

.verde {
  color: var(--green);
}

.vermelho {
  color: var(--red);
}

/* LINHAS / DETALHES */

.linhas-container {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.detalhes-lucro {
  display: none;
  margin-top: 12px;
  background: #080808;
  border: 1px solid #202020;
  border-radius: 16px;
  padding: 16px;
}

.aposta-aberta .detalhes-lucro {
  display: grid;
  gap: 10px;
}

.detalhe-lucro-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #101010;
  border: 1px solid #242424;
  border-radius: 14px;
  padding: 14px;
}

.detalhe-lucro-item strong {
  font-size: 16px;
}

.detalhe-lucro-item span {
  font-weight: 900;
  color: var(--green);
}

.detalhe-lucro-item.total {
  border-color: rgba(244, 207, 99, 0.25);
  background: rgba(244, 207, 99, 0.06);
}

.linha-card {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  background: transparent;
}

.linha-card:hover {
  transform: none;
  box-shadow: none;
}

.linha-view {
  grid-template-columns: 1.4fr 0.7fr 1fr 1fr 1fr;
}

.linha-card {
  display: block;
  background: #080808;
  border: 1px solid #202020;
  border-radius: 16px;
  padding: 12px 16px;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}

.linha-card:hover {
  transform: translateY(-2px);
  border-color: rgba(244, 198, 61, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.linha-view {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 1fr 1fr 1fr;
  align-items: center;
  gap: 12px;
}

.linha-view span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.linha-view strong {
  font-size: 16px;
}

.linha-nome strong {
  font-size: 17px;
}

/* EDIÇÃO */

.aposta-edit {
  display: none;
  gap: 12px;
  grid-template-columns: 1.3fr 1fr 1fr;
  margin-top: 14px;
}

.modo-edicao .aposta-view {
  display: none;
}

.modo-edicao .aposta-edit {
  display: grid;
}

.linha-edit {
  display: none;
  grid-template-columns: 1.4fr 0.7fr 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.modo-edicao .linha-view {
  display: none;
}

.modo-edicao .linha-edit {
  display: grid;
}

.edit-retorno {
  background: #111 !important;
  color: var(--gold);
  font-weight: 800;
  cursor: not-allowed;
}

/* BADGES */

.resultado-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.resultado-badge.ganhou {
  background: rgba(0, 255, 120, 0.12);
  color: #00ff84;
}

.resultado-badge.perdeu {
  background: rgba(255, 0, 0, 0.12);
  color: #ff4d4d;
}

.resultado-badge.meio_perda,
.resultado-badge.meio_ganha {
  background: rgba(255, 200, 0, 0.12);
  color: #f4c63d;
}

.resultado-badge.devolvida,
.resultado-badge.cashout {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.resultado-badge.pendente {
  background: rgba(255, 255, 255, 0.06);
  color: #999;
}

#lista > div {
  padding: 16px 18px;
}

.card-topo {
  margin-bottom: 0;
}

.linhas-container {
  margin-top: 16px;
}

.card-topo h3 {
  font-size: 21px;
}

.mercado {
  font-size: 13px;
}

/* HISTÓRICO MAIS COMPACTO */

#lista > div {
  padding: 14px 16px;
  border-radius: 18px;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 32px;
  justify-content: space-between;
}

.dashboard-hero .logo {
  width: 220px;
  margin: 0;
}

.dashboard-hero h1 {
  margin: 0 0 10px;
}

@media (max-width: 700px) {
  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .dashboard-hero .logo {
    width: 200px;
  }
}

.card-topo {
  align-items: flex-start;
  gap: 14px;
}

.card-topo h3 {
  font-size: 22px;
  line-height: 1.1;
}

.mercado {
  font-size: 12px;
  line-height: 1.35;
}

.acoes-topo {
  gap: 8px;
}

.status {
  order: -1;
  height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
}

.verDetalhesBtn,
.editarApostaBtn,
.excluirApostaBtn {
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13px;
}

.linhas-container {
  margin-top: 10px;
  gap: 6px;
}

.linha-card {
  padding: 10px 14px;
  border-radius: 12px;
}

.linha-view {
  grid-template-columns: 1.2fr 0.6fr 0.9fr 0.9fr 0.8fr;
  gap: 10px;
}

.linha-view span {
  font-size: 9px;
  margin-bottom: 2px;
}

.linha-view strong {
  font-size: 14px;
}

.linha-nome strong {
  font-size: 16px;
}

.resultado-badge {
  padding: 6px 10px;
  font-size: 11px;
}

.iconBtn {
  width: 42px;
  height: 42px;

  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px;

  font-size: 18px;
}

.verDetalhesBtn {
  background: #111;
  color: white;
  border: 1px solid #222;
}

.editarApostaBtn {
  background: #111;
  color: var(--gold);
  border: 1px solid #222;
}

.excluirApostaBtn {
  background: #111;
  color: #ff4d4d;
  border: 1px solid #222;
}

.auth-loading {
  opacity: 0;
  pointer-events: none;
}

.auth-ready {
  opacity: 1;
  pointer-events: auto;
}

#resumo {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: linear-gradient(180deg, #131313, #0a0a0a);
  border: 1px solid #1f1f1f;
  border-radius: 24px;
  padding: 24px;

  display: flex;
  align-items: center;
  gap: 18px;

  min-height: 120px;
}

.stat-icon {
  width: 58px;
  height: 58px;

  flex-shrink: 0;

  border-radius: 50%;

  background: rgba(244, 207, 99, 0.08);
  border: 1px solid rgba(244, 207, 99, 0.16);

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 0 24px rgba(244, 207, 99, 0.12);
}

.stat-icon i {
  color: var(--gold);
  font-size: 22px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
}

.stat-card strong {
  font-size: 34px;
  font-weight: 900;
}

/* RESPONSIVO */

@media (max-width: 1100px) {
  .infos,
  #resumo {
    grid-template-columns: 1fr 1fr;
  }

  .linha-view {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 800px) {
  .card-topo {
    flex-direction: column;
    align-items: flex-start;
  }

  .acoes-topo {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .infos,
  #resumo {
    grid-template-columns: 1fr;
  }

  .linha-view,
  .linha-edit,
  .aposta-edit {
    grid-template-columns: 1fr;
  }

  #lista > div {
    padding: 18px;
  }
}

@media (max-width: 600px) {
  .page {
    padding: 16px;
  }

  .form-card {
    padding: 20px;
  }

  .grid-3,
  .linha {
    grid-template-columns: 1fr;
  }

  .section-header,
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  #adicionarLinha,
  .actions a,
  .actions button,
  .editarApostaBtn,
  .excluirApostaBtn,
  .verDetalhesBtn {
    width: 100%;
  }

  .acoes-topo {
    flex-direction: column;
    align-items: stretch;
  }

  .card-topo h3 {
    font-size: 22px;
  }

  .info-box strong {
    font-size: 18px;
  }

  .linha-card {
    padding: 14px;
  }

  .linha-view strong {
    font-size: 16px;
  }
}
