html, body {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and old Edge */
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f9f9f9;
  color: #333;
}

body::-webkit-scrollbar {
  display: none;
}

.top-bar {
  background: #ffffff;
  padding: clamp(10px, 2vw, 20px); /* ✅ fluid padding */
  border-bottom: 1px solid #ddd;
  text-align: center;
}

.top-bar h1 {
  margin: 0 0 clamp(8px, 2vw, 15px) 0; 
  font-size: clamp(1.2rem, 3vw, 1.8rem); /* ✅ fluid font size */
  font-weight: bold;
  color: #222;
}

/* ✅ Constrain metrics to same max-width as tables */
.metrics-row {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: clamp(10px, 2vw, 20px); /* ✅ fluid gap */
  max-width: 1000px;   /* same as tables-grid */
  margin: 0 auto;      /* center horizontally */
}

/* ✅ On small screens, stack vertically */
@media (max-width: 700px) {
  .metrics-row {
    flex-direction: column;
    align-items: center;
    gap: 0px
  }
}

.metric {
  text-align: center;
  min-width: 120px;
}

.metric h2 {
  font-size: clamp(0.8rem, 2vw, 1rem); /* ✅ fluid scaling */
  font-weight: 500;
  color: #666;
  margin-bottom: 5px;
}

.metric p {
  font-size: clamp(1rem, 3vw, 1.5rem); /* ✅ fluid scaling */
  font-weight: bold;
  color: #222;
}

.tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 2vw, 20px); /* ✅ fluid gap */
  padding: clamp(10px, 2vw, 20px); /* ✅ fluid padding */
  max-width: 1000px;      
  margin: 0 auto;         
}

.table-card {
  background: #ffffff;
  border-radius: clamp(4px, 1vw, 8px); /* ✅ fluid rounding */
  padding: clamp(10px, 2vw, 15px);     /* ✅ fluid padding */
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.table-card h3 {
  margin-bottom: clamp(6px, 1vw, 10px); 
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: #444;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th, td {
  text-align: left;
  padding: clamp(6px, 1vw, 8px); /* ✅ fluid padding */
  border-bottom: 1px solid #eee;
  line-height: 1.2;
  height: 2em; 
  vertical-align: middle;
}

th {
  font-weight: 600;
  color: #555;
}

/* ✅ Fix first column width */
th:first-child,
td:first-child {
  width: 240px;  
  white-space: nowrap; 
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bottom section: same max-width, centered, full-width cards */
.bottom-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 clamp(10px, 2vw, 20px) clamp(10px, 2vw, 20px); 
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(12px, 2vw, 20px);
  vertical-align: middle;
}

#wide th:nth-child(1),
#wide td:nth-child(1) {
  width: 30%;
}

#wide th:nth-child(2),
#wide td:nth-child(2) {
  width: 35;
}

#wide th:nth-child(3),
#wide td:nth-child(3),
#wide th:nth-child(4),
#wide td:nth-child(4),
#wide th:nth-child(5),
#wide td:nth-child(5) {
  width: 10%;
}

.truncate {
  white-space: nowrap;         /* keep it on one line */
  overflow: hidden;            /* hide overflow text */
  text-overflow: ellipsis;     /* add "..." */
}

.chart-wrap {
  width: 100%;
  height: clamp(280px, 40vw, 400px); /* scales nicely */
  min-height: 280px;                 /* ensures it's not tiny */
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Responsive: stack tables in 1 column on small screens */
@media (max-width: 900px) {
  .tables-grid {
    grid-template-columns: 1fr;
    justify-items: center; 
  }

  .bottom-section {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  table {
    width: 330px;
  }

  .table-card {
    width: 330px;
  }

  #wide th:nth-child(n+3),
  #wide td:nth-child(n+3) {
    display: none;
  }

  #wide th:nth-child(1),
  #wide td:nth-child(1) {
    width: 50%;
  }

  #wide th:nth-child(2),
  #wide td:nth-child(2) {
    width: 50%;
  }
}


