/* Stats page theme wrapper */
.stats-page .stats-toolbar,
.stats-page .stats-section{
  width: min(1200px, 92%);
  margin: 0 auto 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 12px 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}

.stats-page .stats-toolbar{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items:center;
  justify-content: space-between;
}


.stats-page label{ color: rgba(255,255,255,.85); font-weight: bold; }
.stats-page select{
  background: rgba(0,0,0,.25);
  color: white;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  padding: 8px 10px;
}

/* If your stats engine renders tables with class "data-table" */
.data-table{
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
}
.data-table th{
  background: rgba(214,0,0,.22);
  color: white;
  text-align:left;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.data-table td{
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
}
.data-table tr:hover td{
  background: rgba(255,255,255,.06);
}

/* Header spacing consistency */
.stats-page header{
  padding: 26px 0 10px;
}

/* Stats toolbar container */
.stats-toolbar{
  width: 100%;
  margin: 14px 0 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}

/* Stats root spacing */
#stats-root{
  margin-top: 8px;
}

.stats-toolbar{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  margin: 14px 0 18px;
}

.stats-toolbar .group{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.stats-toolbar label{
  color: rgba(255,255,255,.82);
  font-weight: 700;
}

.stats-toolbar select{
  background: rgba(0,0,0,.25);
  color: #fff;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 8px 10px;
}
/* =====================
   Stats highlight tiles
   ===================== */

.tiles{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 14px 0 18px;
}

.tile{
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 12px 26px rgba(0,0,0,.35);
}

.tile-label{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: rgba(255,255,255,.65);
  margin-bottom: 6px;
}

.tile-value{
  font-size: 18px;
  font-weight: 700;
  color: #fff;

}
/* subtle inline brand text */
.muted-inline{
  color: rgba(255,255,255,.62);
  font-weight: 600;
  font-size: 12px;
}

/* smoother stats background (overrides the strong radial artifact) */
body.stats-page{
  background: #0f0f12; /* clean solid to avoid gradient banding on long pages */
}

/* comfortable bottom padding */
body.stats-page main.container{
  padding-bottom: 70px;
}
/* sortable headers */

th.sortable{
  cursor: pointer;
  user-select: none;
}

th.sortable:hover{
  background: rgba(255,255,255,.05);
}

.th-label{
  margin-right: 6px;
}

.sort-indicator{
  display:inline-flex;
  align-items:center;
  margin-left:8px;
  opacity:.65;
}

.sort-indicator svg{
  width:16px;
  height:16px;
}

th.is-sort .sort-indicator{
  opacity:1;
}
th.sortable:hover .sort-indicator{
  opacity:1;
}
td:first-child{
  font-weight:600;
  color: rgba(255,255,255,.8);
}
.stats-page table td:first-child {
  font-weight: 600;
  color: rgba(255,255,255,.75);
}
.stats-page table td:first-child{
  position: relative;
  padding-left: 10px;
}

.stats-page table td:first-child::before{
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 4px;
  border-radius: 2px;
  background: #888;
}
.team-chip{
  position: relative;
  padding-left: 10px;
  display: inline-block;
  font-weight: 600;
  color: rgba(255,255,255,.75);
}

.team-chip::before{
  content:"";
  position:absolute;
  left:0;
  top: 20%;
  height: 60%;
  width: 4px;
  border-radius: 2px;
  background: #888;
}

.team-chip[data-team="bmw"]::before { background:#0066B1; }
.team-chip[data-team="mazda"]::before { background:#FFD400; }
.team-chip[data-team="toyota"]::before { background:#979aaa; }
.team-chip[data-team="pontiac"]::before { background:#C1121F; }
.team-chip[data-team="volkswagen"]::before { background:#00BFFF; }
.team-chip[data-team="alfa romeo"]::before { background:#A00000; }
