html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  background: linear-gradient(135deg, #25418E 10%, #071848 70%);
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
}
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100vh;
  background: linear-gradient(180deg, #0A2558 10%, #000E28 100%);
  color: #fff;
  padding: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  background-color: #000E28;
  padding: 19px 18px 10px 20px;
}
.sidebar-header h1 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: bold;
}
.sidebar-header span {
  font-size: 0.95rem;
  color: #a5c6fe;
}
.sidebar-nav {
  margin-top: 30px;
  flex: 1;
}
.sidebar-nav ul {
  list-style: none;
  padding: 0 0 0 20px;
}
.sidebar-nav ul li {
  display: flex;
  align-items: center;
  font-size: 1.09rem;
  margin-bottom: 30px;
  gap: 16px;
  cursor: pointer;
  padding: 10px 6px;
  border-radius: 5px;
}
.sidebar-nav ul li:hover {
  background: rgba(255,255,255,0.08);
}
.sidebar-nav a {
  text-decoration: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.sidebar-nav .material-icons {
  font-size: 1.5em;
}
.navbar {
  position: fixed;
  top: 0;
  left: 250px;
  height: 91px;
  width: calc(100% - 250px);
  background: linear-gradient(90deg, #0A2558 10%, #000E28 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  z-index: 10;
  padding: 0 38px 0 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
.navbar-logo h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: bold;
}

/* ... código anterior ... */

.charts-content {
  margin-left: 250px;
  margin-top: 81px;
  padding: 20px;
  display: flex;
  flex-direction: row;
  gap: 20px;
  /* Alterado: Aumentei a largura e a altura para dar mais espaço aos gráficos */
  width: calc(100% - 290px); /* Ocupa a maior parte do espaço restante */
  height: 90vh; /* Usa a altura da viewport (tela) para o contêiner pai */
  flex-wrap: wrap;
  justify-content: flex-start;
}

.chart-container {
  background: rgba(255,255,255,0.05);
  padding: 10px 10px 0 10px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);

  /* Alterado: Define um tamanho base e flexibilidade para o contêiner */
  flex: 1 1 45%; /* Define a flex-grow, flex-shrink e flex-basis. 45% garante que dois cabem em uma linha com o gap de 20px. */
  min-width: 300px; /* Garante uma largura mínima, para não ficar muito pequeno */
  max-width: calc(50% - 10px); /* Limita para garantir no máximo 2 por linha */

  /* Removido: width: 80%; */
  /* Removido: height: 60%; */

  height: 400px; /* Altura fixa para os contêineres individuais */
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Impede que o conteúdo transborde */
}

.chart-container h2 {
  color: #fff;
  margin-bottom: 10px;
  text-align: center;
  font-size: 1.5rem;
}

.chart-container canvas {
  width: 100%;
  flex: 1;
  /* Garantindo que o canvas ocupe todo o espaço restante do contêiner */
  max-height: 100%;
}

/* Responsive styles */
@media (max-width: 768px) {
  
  .sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 15;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 20;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .hamburger {
    display: block;
    position: absolute;
    left: 20px;
  }

  .navbar {
    left: 0;
    width: 100%;
    justify-content: center;
  }

  .navbar-logo h1 {
    font-size: 1.9rem;
  }

  .navbar-logo h1::before {
    content: "Conserta Já";
  }

  .charts-content {
    margin-left: 0;
    margin-top: 91px;
    flex-direction: column;
    width: 100%;
    padding: 0;
    gap: 30px;
    overflow-y: auto;
  }

  .chart-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    min-height: 350px;
    height: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  .charts-content * {
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .charts-content img {
    max-width: 100%;
    height: auto;
  }

  .charts-content canvas {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 480px) {
  /* Additional mobile styles if needed */
}
