/* TBI Statistieken. Look based on the former Graphina templates (tabs #F4FCFE / #CBF0F6, cards #F8F8F8, Poppins). */
.tbi-stats {
  --tbi-tab: #f4fcfe;
  --tbi-tab-active: #cbf0f6;
  --tbi-card: #f8f8f8;
  --tbi-text: #4c4a4a;
  font-family: "Poppins", sans-serif;
  color: var(--tbi-text);
  width: 100%;
}

.tbi-stats__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 0;
}

.tbi-stats__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tbi-stats button.tbi-stats__tab,
.tbi-stats button.tbi-stats__toggle {
  appearance: none;
  box-shadow: none;
  text-decoration: none;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  line-height: 1.4;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
}

/* Tabs: style of the former ESG template (18898). */
.tbi-stats button.tbi-stats__tab {
  background: #f8f8f8;
  border: 2px solid #f8f8f8;
  color: #4c4a4a;
  padding: 7px 30px;
}

.tbi-stats button.tbi-stats__tab[aria-selected="false"]:hover {
  background: #fff;
  border-color: #e10d1a;
  color: #e10d1a;
}

.tbi-stats button.tbi-stats__tab[aria-selected="false"]:focus:not(:hover) {
  background: #f8f8f8;
  border-color: #f8f8f8;
  color: #4c4a4a;
}

.tbi-stats button.tbi-stats__tab[aria-selected="true"],
.tbi-stats button.tbi-stats__tab[aria-selected="true"]:hover,
.tbi-stats button.tbi-stats__tab[aria-selected="true"]:focus {
  background: #e10d1a;
  border-color: #e10d1a;
  color: #fff;
}

.tbi-stats button.tbi-stats__toggle,
.tbi-stats button.tbi-stats__toggle:hover,
.tbi-stats button.tbi-stats__toggle:focus {
  background: #e10d1a;
  border: 0;
  color: #fff;
  letter-spacing: 0.5px;
  min-height: 50px;
  padding: 0 30px;
  user-select: none;
}

.tbi-stats button.tbi-stats__toggle:hover {
  background: #c00b16;
}

.tbi-stats__tab:focus-visible,
.tbi-stats__toggle:focus-visible,
.tbi-stats__scroll:focus-visible {
  outline: 2px solid #015fff;
  outline-offset: 2px;
}

.tbi-stats__panel {
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 20px;
}

.tbi-stats__panel[hidden] {
  display: none;
}

.tbi-stats__card {
  background: var(--tbi-card);
  border-radius: 10px;
  padding: 20px;
}

.tbi-stats__chart {
  position: relative;
  height: 450px;
}

.tbi-stats__info {
  margin-top: 20px;
  padding: 16px 20px;
  border-left: 4px solid #83c3a4;
  background: #fff;
  font-size: 14px;
  line-height: 1.6;
}

.tbi-stats__info p {
  margin: 0 0 8px;
}

.tbi-stats__info p:last-child {
  margin-bottom: 0;
}

/* Tables are hidden until "Toon cijfers" is clicked. */
.tbi-stats__table {
  display: none;
  order: -1; /* numbers appear above the chart */
  margin-bottom: 20px;
}

.tbi-stats.is-open .tbi-stats__table {
  display: block;
}

.tbi-stats__scroll {
  overflow-x: auto;
  background: var(--tbi-card);
  border-radius: 10px;
  padding: 10px;
}

.tbi-stats table {
  width: 100%;
  border-top: 0;
  border-collapse: collapse;
  border: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.tbi-stats th,
.tbi-stats td {
  border: 0;
  border-bottom: 1px solid #e6e6e6;
  padding: 10px 8px;
  text-align: center;
  white-space: nowrap;
  background: transparent;
  color: var(--tbi-text);
}

.tbi-stats thead th {
  font-weight: 400;
  text-transform: uppercase;
}

.tbi-stats tbody th {
  font-weight: 600;
}

.tbi-stats tr:last-child th,
.tbi-stats tr:last-child td {
  border-bottom: 0;
}

.tbi-stats .is-total {
  font-weight: 700;
}

.tbi-stats--esg thead th {
  white-space: normal;
}

.tbi-stats__nodata,
.tbi-stats__updated {
  font-size: 13px;
  margin: 8px 0 0;
}

.tbi-stats__updated {
  text-align: right;
  opacity: 0.7;
}

.tbi-stats .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 767px) {
  .tbi-stats__bar {
    flex-direction: column;
    align-items: stretch;
  }

  .tbi-stats__tabs {
    flex-direction: column;
  }

  .tbi-stats__tab {
    text-align: left;
    padding: 7px 16px;
  }

  .tbi-stats__toggle {
    order: 2;
    align-self: center;
  }

  .tbi-stats__panel,
  .tbi-stats__card {
    padding: 12px;
  }

  .tbi-stats__chart {
    height: 320px;
  }
}
