body {
  background: #111;
  color: white;
  font-family: sans-serif;
  margin: 0;
  padding: 20px;
}

.kpi-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  padding: 1rem;
}

.kpi-card {
  background-color: #1e1e1e;
  border-radius: 10px;
  padding: 1rem 2rem;
  color: white;
  min-width: 180px;
  text-align: center;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

.kpi-label {
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: bold;
}

.grid-container {
  display: grid;
  gap: 20px;
  padding: 1rem;
  grid-template-columns: 1fr; /* padrão mobile: 1 por linha */
  place-items: center; /* centraliza todos os filhos horizontalmente */
}
.chart-wrapper {
  background-color: #1e1e1e;
  border-radius: 10px;
  padding: 2rem 1rem 1rem 1rem;
  width: 100%;
  max-width: 780px;
  height: 380px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 1024px) {
  .grid-container {
    grid-template-columns: repeat(2, 1fr); /* 2 por linha acima de 1024px */
    justify-content: center;
    grid-template-columns: repeat(2, 1fr);
  }
}
/* XGA - 1024x768 */
@media (max-width: 1024px) {
  .chart-wrapper {
    max-width: 350px;
    height: 160px;
  }
}

/* WXGA - 1366x768 */
@media (min-width: 1025px) and (max-width: 1440px) {
  .chart-wrapper {
    max-width: 400px;
    height: 200px;
  }
}

/* HD+ - 1600x900 */
@media (min-width: 1441px) and (max-width: 1700px) {
  .chart-wrapper {
    max-width: 500px;
    height: 250px;
  }
}

/* FHD - 1920x1080 */
@media (min-width: 1701px) and (max-width: 2047px) {
  .chart-wrapper {
    max-width: 600px;
    height: 300px;
  }
}

/* 2K / QHD - 2048x1080 / 2560x1440 */
@media (min-width: 2048px) and (max-width: 3199px) {
  .chart-wrapper {
    max-width: 900px;
    height: 380px;
  }
}

/* QHD+ - 3200x1800 */
@media (min-width: 3200px) and (max-width: 3839px) {
  .chart-wrapper {
    max-width: 1200px;
    height: 550px;
  }
}

/* 4K - 3840x2160 */
@media (min-width: 3840px) and (max-width: 5119px) {
  .chart-wrapper {
    max-width: 1400px;
    height: 650px;
  }
}

/* 5K - 5120x2880 */
@media (min-width: 5120px) and (max-width: 7679px) {
  .chart-wrapper {
    max-width: 1800px;
    height: 800px;
  }
}

/* 8K - 7680x4320 */
@media (min-width: 7680px) {
  .chart-wrapper {
    max-width: 2500px;
    height: 1000px;
  }
}
.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.last-updated {
  font-size: 0.9rem;
  color: #ccc;
  text-align: center;
  margin-top: 10px;
}
.last-updated-kpi {
  font-size: 0.9rem;
  color: #ccc;
  text-align: center;
  margin-top: 0px;
}
.chart-center {
  display: flex;
  justify-content: center;
  width: 100%;
}
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Caixa do código */
.code-box {
  background: #1e1e1e;
  padding: 3rem 4rem;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Título */
.code-box h2 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

/* Input */
#codeInput {
  padding: 1rem;
  font-size: 2rem;
  border-radius: 8px;
  border: none;
  outline: none;
  width: 100%;
  max-width: 300px;
  text-align: center;
  background-color: #333;
  color: white;
}

/* Erro */
.error {
  color: #ff6b6b;
  font-size: 1.2rem;
  margin-top: 1rem;
}
