/* ============================
   Performances Page
   ============================ */

.perf {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ============================
   Header
   ============================ */

.perf__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.perf__title {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 28px;
  line-height: 30px;
  color: #7b3a10;
  margin: 0;
}

.perf__subtitle {
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  font-size: 15px;
  color: #a78d7c;
  margin: 0;
}

/* ============================
   Tabs
   ============================ */

.perf__tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.perf__tab {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 20px;
  background: transparent;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #a78d7c;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.perf__tab:hover {
  background: rgba(212, 146, 42, 0.08);
}

.perf__tab--active {
  background: linear-gradient(166deg, #e07b20 0%, #d4922a 100%);
  color: #fff;
}

.perf__tab--active:hover {
  background: linear-gradient(166deg, #e07b20 0%, #d4922a 100%);
}

/* ============================
   Stats Row
   ============================ */

.perf__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.perf__stat {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: #fff;
  border: 1px solid #f0e6d8;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(123, 58, 16, 0.06);
}

.perf__stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.perf__stat-icon--orange { background: rgba(224, 123, 32, 0.1); }
.perf__stat-icon--brown  { background: rgba(120, 83, 34, 0.1); }
.perf__stat-icon--green  { background: rgba(140, 163, 84, 0.1); }
.perf__stat-icon--teal   { background: rgba(27, 175, 181, 0.1); }

.perf__stat-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.perf__stat-label {
  font-family: 'Nunito', sans-serif;
  font-weight: 500;
  font-size: 12px;
  color: #a78d7c;
}

.perf__stat-value {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 24px;
  line-height: 28px;
  color: #7b3a10;
}

.perf__stat-trend {
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 12px;
}

.perf__stat-trend--up   { color: #28a745; }
.perf__stat-trend--down { color: #e74c3c; }

/* ============================
   Cards (shared)
   ============================ */

.perf__card {
  background: #fff;
  border: 1px solid #f0e6d8;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(123, 58, 16, 0.06);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.perf__card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 16px;
  color: #7b3a10;
  margin: 0;
}

/* ============================
   Middle Row
   ============================ */

.perf__middle {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
}

/* ============================
   Line Chart
   ============================ */

.perf__linechart {
  display: flex;
  gap: 8px;
}

.perf__linechart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #c5b8a8;
  text-align: right;
  min-width: 28px;
  padding: 0 0 22px;
}

.perf__linechart-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.perf__linechart-svg {
  width: 100%;
  height: 200px;
}

.perf__linechart-x {
  display: flex;
  justify-content: space-between;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #c5b8a8;
  padding-top: 6px;
}

/* Legend */
.perf__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.perf__legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #7b3a10;
}

.perf__legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================
   Donut Chart
   ============================ */

.perf__donut-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.perf__donut-svg {
  width: 160px;
  height: 160px;
}

.perf__donut-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.perf__donut-legend .perf__legend-item strong {
  margin-left: 2px;
}

/* ============================
   Bottom Row
   ============================ */

.perf__bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ============================
   Bar Chart
   ============================ */

.perf__barchart {
  display: flex;
  gap: 8px;
  flex: 1;
}

.perf__barchart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #c5b8a8;
  text-align: right;
  min-width: 20px;
  padding: 0 0 22px;
}

.perf__barchart-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  height: 180px;
  border-bottom: 1px solid #f0e6d8;
  padding-bottom: 0;
}

.perf__bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}

.perf__bar {
  width: 100%;
  max-width: 48px;
  border-radius: 6px 6px 0 0;
  min-height: 4px;
}

.perf__bar-label {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: #c5b8a8;
  white-space: nowrap;
}

/* ============================
   Ranking (Top 5)
   ============================ */

.perf__ranking {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.perf__rank {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.perf__rank + .perf__rank {
  border-top: 1px solid #f7f3ef;
}

.perf__rank-pos {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f7f3ef;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 12px;
  color: #a78d7c;
  flex-shrink: 0;
}

.perf__rank-pos--1 { background: linear-gradient(135deg, #e07b20, #d4922a); color: #fff; }
.perf__rank-pos--2 { background: linear-gradient(135deg, #785322, #a0793f); color: #fff; }

.perf__rank-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}

.perf__rank-info {
  flex: 1;
  min-width: 0;
}

.perf__rank-name {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #7b3a10;
  margin: 0;
}

.perf__rank-meta {
  font-family: 'Nunito', sans-serif;
  font-weight: 500;
  font-size: 12px;
  color: #a78d7c;
  margin: 0;
}

.perf__rank-score {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 18px;
  color: #e07b20;
  flex-shrink: 0;
}

/* ============================
   Responsive
   ============================ */

@media (max-width: 1200px) {
  .perf__stats  { grid-template-columns: repeat(2, 1fr); }
  .perf__middle { grid-template-columns: 1fr; }
  .perf__bottom { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .perf__stats { grid-template-columns: 1fr; }
  .perf__tabs { flex-wrap: wrap; }
}
