/* ============================
   Dashboard
   ============================ */

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

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

.dash__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

.dash__subtitle {
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 22.5px;
  color: #999;
  margin: 0;
}

/* --- Action buttons --- */
.dash__actions {
  display: flex;
  gap: 12px;
}

.dash__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 21px;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.2s ease, opacity 0.15s ease;
}

.dash__btn svg {
  flex-shrink: 0;
}

.dash__btn--outline {
  background: #fff;
  border: 1.5px solid #f7f3ef;
  color: #634216;
}

.dash__btn--outline:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.dash__btn--primary {
  background: linear-gradient(165deg, #e07b20 0%, #d4922a 100%);
  border: none;
  color: #fff;
  box-shadow: 0 4px 12px rgba(200, 106, 0, 0.2);
}

.dash__btn--primary:hover {
  opacity: 0.92;
}

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

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

.dash__stat {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 21px;
  background: #fff;
  border: 1px solid #f2e5d3;
  border-radius: 16px;
}

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

.dash__stat-icon--green { background: rgba(74, 122, 69, 0.08); }
.dash__stat-icon--amber { background: rgba(212, 132, 42, 0.08); }
.dash__stat-icon--orange { background: rgba(200, 106, 0, 0.08); }
.dash__stat-icon--teal { background: rgba(42, 155, 155, 0.08); }

.dash__stat-text {
  display: flex;
  flex-direction: column;
}

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

.dash__stat-label {
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #a78d7c;
  margin-top: 2px;
}

/* ============================
   Middle Row (Cards)
   ============================ */

.dash__middle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.dash__card {
  background: #fff;
  border: 1px solid #f2e5d3;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 20px 25px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash__card--full {
  grid-column: 1 / -1;
}

.dash__card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.dash__card-title-icon {
  flex-shrink: 0;
}

.dash__card-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 13px;
  line-height: 19.5px;
  color: #e07b20;
  text-decoration: none;
}

.dash__card-link:hover {
  text-decoration: underline;
}

.dash__card-link svg {
  flex-shrink: 0;
}

/* ============================
   Derniers Duels
   ============================ */

.dash__duels {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash__duel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background: #f7f3ef;
  border-radius: 10px;
}

.dash__duel-dot {
  width: 10px;
  height: 10px;
  border-radius: 5px;
  flex-shrink: 0;
}

.dash__duel-dot--gray { background: #999; }
.dash__duel-dot--green { background: #28a745; }

.dash__duel-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash__duel-name {
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 14px;
  line-height: 21px;
  color: #7b3a10;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash__duel-meta {
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 18px;
  color: #999;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash__duel-badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 11px;
  line-height: 16.5px;
}

.dash__duel-badge--planned {
  background: rgba(153, 153, 153, 0.12);
  color: #999;
}

.dash__duel-score {
  flex-shrink: 0;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 16px;
  line-height: 24px;
  color: #e07b20;
}

/* ============================
   Classement
   ============================ */

.dash__ranking {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash__rank {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  background: #f7f3ef;
  border-radius: 10px;
}

.dash__rank-pos {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
  background: #a78d7c;
}

.dash__rank-pos--1 { background: linear-gradient(135deg, #dd983c 0%, #f5a623 100%); }
.dash__rank-pos--2 { background: linear-gradient(135deg, #a78d7c 0%, #c4a882 100%); }

.dash__rank-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}

.dash__rank-avatar--brown {
  background: linear-gradient(135deg, #a78d7c 0%, #c4a882 100%);
}

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

.dash__rank-name {
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 14px;
  line-height: 21px;
  color: #7b3a10;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash__rank-meta {
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  font-size: 11px;
  line-height: 16.5px;
  color: #999;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dash__rank-icon {
  width: 14px;
  height: 14px;
}

.dash__rank-score {
  flex-shrink: 0;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 18px;
  line-height: 24px;
  color: #D4922A;
}

/* ============================
   Performance par opération
   ============================ */

.dash__perf {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash__perf-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash__perf-label {
  width: 120px;
  flex-shrink: 0;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 21px;
}

.dash__perf-bar {
  flex: 1;
  height: 12px;
  background: #f7f3ef;
  border-radius: 999px;
  overflow: hidden;
}

.dash__perf-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}

.dash__perf-value {
  width: 40px;
  flex-shrink: 0;
  text-align: right;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 15px;
  line-height: 22.5px;
  color: #7b3a10;
}

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

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

  .dash__middle {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dash__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .dash__stats {
    grid-template-columns: 1fr;
  }

  .dash__actions {
    width: 100%;
  }

  .dash__btn {
    flex: 1;
    justify-content: center;
  }

  .dash__perf-label {
    width: 90px;
    font-size: 12px;
  }
}
