
/* =========================================================
   DoctorIam Overall Performance
   ========================================================= */

.performance-dashboard {
  display: grid;
  gap: 24px;
}

.performance-loading,
.performance-error,
.performance-empty {
  padding: 28px;
  border: 1px solid #dbe4ec;
  border-radius: 16px;
  background: #fff;
  color: #536273;
}

.performance-error {
  border-color: #efc8c8;
  background: #fff8f8;
  color: #9a2f2f;
}

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

.performance-stat {
  min-height: 128px;
  padding: 20px;
  border: 1px solid #dbe4ec;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 8px 24px rgba(7, 52, 101, .06);
}

.performance-stat span {
  display: block;
  margin-bottom: 10px;
  color: #6c7886;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.performance-stat strong {
  display: block;
  color: #073465;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1;
}

.performance-stat small {
  display: block;
  margin-top: 10px;
  color: #788493;
  font-size: 12px;
}

.performance-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr);
  gap: 20px;
  align-items: stretch;
}

.performance-panel {
  padding: 22px;
  border: 1px solid #dbe4ec;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(7, 52, 101, .06);
}

.performance-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.performance-panel-heading h2,
.performance-panel-heading h3 {
  margin: 0;
  color: #073465;
}

.performance-panel-heading p {
  margin: 5px 0 0;
  color: #718092;
  font-size: 13px;
}

.performance-range {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.performance-range button {
  border: 1px solid #d2dce6;
  border-radius: 999px;
  background: #fff;
  color: #526476;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.performance-range button.active {
  border-color: #073465;
  background: #073465;
  color: #fff;
}

.performance-chart {
  position: relative;
  min-height: 280px;
  padding: 16px 4px 2px;
}

.performance-chart svg {
  display: block;
  width: 100%;
  height: 260px;
  overflow: visible;
}

.performance-chart-empty {
  display: grid;
  place-items: center;
  min-height: 250px;
  color: #7a8795;
  text-align: center;
}

.performance-donut-panel {
  display: flex;
  flex-direction: column;
}

.performance-donut-wrap {
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 245px;
}

.performance-donut {
  --accuracy: 0;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(
      #2d9a66 0 calc(var(--accuracy) * 1%),
      #d75b5b calc(var(--accuracy) * 1%) 100%
    );
  position: relative;
  box-shadow: 0 10px 30px rgba(7, 52, 101, .10);
}

.performance-donut::before {
  content: "";
  position: absolute;
  width: 138px;
  height: 138px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px #eef2f6;
}

.performance-donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.performance-donut-center strong {
  display: block;
  color: #073465;
  font-size: 34px;
  line-height: 1;
}

.performance-donut-center span {
  display: block;
  margin-top: 8px;
  color: #778493;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .09em;
}

.performance-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 10px;
}

.performance-legend-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f9fb;
  font-size: 13px;
}

.performance-legend-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #647283;
}

.performance-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.performance-dot.correct { background: #2d9a66; }
.performance-dot.incorrect { background: #d75b5b; }
.performance-dot.gold { background: #ba8b32; }
.performance-dot.blue { background: #2f6da5; }

.performance-activity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
}

.performance-completion {
  margin-top: 18px;
}

.performance-completion-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #536273;
  font-size: 14px;
}

.performance-progress {
  height: 12px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf2;
}

.performance-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #073465, #ba8b32);
}

.performance-activity-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.performance-mini-stat {
  padding: 15px;
  border-radius: 13px;
  background: #f7f9fb;
}

.performance-mini-stat span {
  display: block;
  color: #718092;
  font-size: 12px;
  font-weight: 700;
}

.performance-mini-stat strong {
  display: block;
  margin-top: 5px;
  color: #073465;
  font-size: 22px;
}

.performance-breakdowns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.performance-breakdown-list {
  display: grid;
  gap: 14px;
}

.performance-breakdown-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.1fr) minmax(120px, 2fr) auto;
  gap: 12px;
  align-items: center;
}

.performance-breakdown-name {
  color: #33485c;
  font-size: 13px;
  font-weight: 800;
}

.performance-breakdown-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf2;
}

.performance-breakdown-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2f6da5;
}

.performance-breakdown-score {
  min-width: 82px;
  text-align: right;
  color: #073465;
  font-size: 13px;
  font-weight: 800;
}

.performance-basis {
  margin: -8px 0 0;
  color: #83909d;
  font-size: 12px;
}

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

  .performance-main-grid,
  .performance-activity-grid,
  .performance-breakdowns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .performance-snapshot {
    grid-template-columns: 1fr;
  }

  .performance-panel {
    padding: 17px;
  }

  .performance-panel-heading {
    display: block;
  }

  .performance-range {
    margin-top: 12px;
  }

  .performance-breakdown-row {
    grid-template-columns: 1fr auto;
  }

  .performance-breakdown-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}


/* =========================================================
   Performance Chart V2 controls
   ========================================================= */

.performance-chart-heading {
  margin-bottom: 14px;
}

.performance-chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: flex-end;
  padding: 13px 14px;
  margin-bottom: 8px;
  border: 1px solid #e0e7ee;
  border-radius: 13px;
  background: #f8fafc;
}

.performance-control-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.performance-control-label {
  margin-right: 2px;
  color: #718092;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.performance-segmented {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.performance-segmented button,
.performance-chart-controls .performance-range button {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #d2dce6;
  border-radius: 999px;
  background: #fff;
  color: #526476;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background .15s ease,
    color .15s ease,
    border-color .15s ease,
    transform .15s ease;
}

.performance-segmented button:hover,
.performance-chart-controls .performance-range button:hover {
  border-color: #8ea6bd;
  transform: translateY(-1px);
}

.performance-segmented button.active,
.performance-chart-controls .performance-range button.active {
  border-color: #073465;
  background: #073465;
  color: #fff;
}

.performance-custom-days {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #637385;
  font-size: 11px;
  font-weight: 700;
}

.performance-custom-days input {
  width: 64px;
  height: 30px;
  padding: 4px 7px;
  border: 1px solid #d2dce6;
  border-radius: 8px;
  background: #fff;
  color: #073465;
  font: inherit;
  font-weight: 800;
  text-align: center;
  outline: none;
}

.performance-custom-days input:focus {
  border-color: #2f6da5;
  box-shadow: 0 0 0 3px rgba(47, 109, 165, .12);
}

@media (max-width: 700px) {
  .performance-chart-controls {
    display: grid;
  }

  .performance-control-group {
    align-items: flex-start;
  }
}
