.rep-perf {
  max-width: 1400px;
  margin: 0 auto;
  color: var(--foreground);
}

#trygc-sales-route-surface {
  position: fixed;
  top: var(--sales-top, 64px);
  left: var(--sales-left, 260px);
  width: var(--sales-width, calc(100vw - 260px));
  height: var(--sales-height, calc(100vh - 64px));
  z-index: 45;
  overflow: auto;
  padding: 22px;
  background: var(--background);
}

.rep-perf--standalone {
  min-height: 100vh;
  max-width: none;
  padding: 28px;
  background: var(--background);
}

.rep-perf--standalone > .rep-perf__header,
.rep-perf--standalone > .rep-perf__grid,
.rep-perf--standalone > .rep-perf__panel {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.rep-perf--standalone > .rep-perf__analytics {
  margin-top: 14px;
}

.rep-perf * {
  box-sizing: border-box;
}

.rep-perf__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.rep-perf__eyebrow {
  color: var(--gc-orange);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.rep-perf__title {
  font-size: 24px;
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: 0;
  margin: 0;
}

.rep-perf__sub {
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.5;
  margin: 7px 0 0;
  max-width: 760px;
}

.rep-perf__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rep-perf__filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
}

.rep-perf__filter {
  display: grid;
  gap: 5px;
}

.rep-perf__filter span {
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 850;
  text-transform: uppercase;
}

.rep-perf__select,
.rep-perf__button,
.rep-perf__input {
  min-height: 34px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.rep-perf__button {
  cursor: pointer;
}

.rep-perf__link-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.rep-perf__input {
  width: 138px;
}

.rep-perf__button:hover {
  border-color: color-mix(in oklab, var(--gc-orange) 55%, var(--border));
}

.rep-perf__grid {
  display: grid;
  gap: 14px;
}

.rep-perf__kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 18px;
}

.rep-perf__analysis-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.rep-perf__insights {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.rep-perf__kpis--targets {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rep-perf__card,
.rep-perf__panel {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
}

.rep-perf__card {
  padding: 16px;
}

.rep-perf__card--green {
  border-color: #a7f3d0;
  background: color-mix(in oklab, #d1fae5 48%, var(--card));
}

.rep-perf__card--orange {
  border-color: #fed7aa;
  background: color-mix(in oklab, #ffedd5 48%, var(--card));
}

.rep-perf__card--blue {
  border-color: #bae6fd;
  background: color-mix(in oklab, #e0f2fe 48%, var(--card));
}

.rep-perf__card--red {
  border-color: #fecaca;
  background: color-mix(in oklab, #fee2e2 48%, var(--card));
}

.rep-perf__card-label,
.rep-perf__panel-label {
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0;
}

.rep-perf__card-value {
  font-size: 24px;
  line-height: 1.15;
  font-weight: 850;
  margin: 8px 0 2px;
  font-variant-numeric: tabular-nums;
}

.rep-perf__card-sub {
  color: var(--muted-foreground);
  font-size: 11px;
  margin: 0;
}

.rep-perf__main {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  align-items: start;
}

.rep-perf__panel {
  overflow: hidden;
}

.rep-perf__panel-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.rep-perf__panel-title {
  font-size: 17px;
  line-height: 1.2;
  font-weight: 850;
  margin: 4px 0 0;
}

.rep-perf__table-wrap {
  overflow-x: auto;
}

.rep-perf__table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

.rep-perf__table th {
  color: var(--muted-foreground);
  background: color-mix(in oklab, var(--muted) 45%, transparent);
  padding: 11px 14px;
  text-align: left;
  font-size: 10px;
  letter-spacing: .9px;
  text-transform: uppercase;
  white-space: nowrap;
}

.rep-perf__table td {
  padding: 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

.rep-perf__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rep-perf__rep {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.rep-perf__avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  background: linear-gradient(135deg, #6b21a8, #f97316);
  flex: 0 0 auto;
}

.rep-perf__rep-name {
  margin: 0;
  font-weight: 800;
}

.rep-perf__rep-meta {
  margin: 2px 0 0;
  color: var(--muted-foreground);
  font-size: 11px;
}

.rep-perf__rank {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 850;
}

.rep-perf__badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 850;
  border: 1px solid transparent;
  white-space: nowrap;
}

.rep-perf__badge--gold {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.rep-perf__badge--green {
  color: #047857;
  background: #d1fae5;
  border-color: #a7f3d0;
}

.rep-perf__badge--orange {
  color: #c2410c;
  background: #ffedd5;
  border-color: #fed7aa;
}

.rep-perf__badge--blue {
  color: #075985;
  background: #e0f2fe;
  border-color: #bae6fd;
}

.rep-perf__badge--red {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fecaca;
}

.rep-perf__progress {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in oklab, var(--muted) 65%, transparent);
  margin-top: 7px;
}

.rep-perf__progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gc-orange), #16a34a);
}

.rep-perf__side {
  display: grid;
  gap: 14px;
}

.rep-perf__list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.rep-perf__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: color-mix(in oklab, var(--background) 72%, var(--card));
}

.rep-perf__item-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.rep-perf__item-sub {
  margin: 3px 0 0;
  color: var(--muted-foreground);
  font-size: 11px;
}

.rep-perf__item-value {
  text-align: right;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.rep-perf__bars {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.rep-perf__bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 72px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.rep-perf__bar-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in oklab, var(--muted) 65%, transparent);
}

.rep-perf__bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gc-orange);
}

.rep-perf__analytics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.rep-perf__metric-large {
  display: grid;
  gap: 4px;
  padding: 22px;
  min-height: 174px;
  align-content: center;
}

.rep-perf__metric-large strong {
  font-size: 46px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.rep-perf__metric-large span {
  color: var(--foreground);
  font-size: 14px;
  font-weight: 800;
}

.rep-perf__metric-large p {
  color: var(--muted-foreground);
  font-size: 12px;
  margin: 0;
}

.rep-perf__locked {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  padding: 28px;
  max-width: 680px;
}

.rep-perf__money-input,
.rep-perf__note-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.rep-perf__money-input {
  max-width: 140px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rep-perf__note-input {
  min-width: 190px;
}

.rep-perf__table--targets {
  min-width: 980px;
}

.rep-perf__empty {
  padding: 36px 18px;
  color: var(--muted-foreground);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 1180px) {
  #trygc-sales-route-surface {
    left: var(--sales-left, 0);
    width: var(--sales-width, 100vw);
  }

  .rep-perf__kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rep-perf__filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rep-perf__analysis-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rep-perf__insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rep-perf__kpis--targets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rep-perf__main {
    grid-template-columns: 1fr;
  }

  .rep-perf__analytics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  #trygc-sales-route-surface {
    top: var(--sales-top, 0);
    left: 0;
    width: 100vw;
    padding: 14px;
  }

  .rep-perf__header {
    display: block;
  }

  .rep-perf__controls {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .rep-perf__filter-bar {
    grid-template-columns: 1fr;
  }

  .rep-perf__kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rep-perf__analysis-strip {
    grid-template-columns: 1fr;
  }

  .rep-perf__insights {
    grid-template-columns: 1fr;
  }

  .rep-perf__kpis--targets {
    grid-template-columns: 1fr;
  }

  .rep-perf__bar-row {
    grid-template-columns: 1fr;
  }
}

/* ── ADMIN SALES TEAM TAB ─────────────────────────────────── */
.st-admin { padding: 16px 0; }

.st-hdr { margin-bottom: 24px; }

.st-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--foreground);
  letter-spacing: -.02em;
  line-height: 1.2;
}

.st-sub {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

.st-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 680px) { .st-cols { grid-template-columns: 1fr; } }

.st-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.st-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.st-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted-foreground);
}

.st-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
}
.st-chip--orange {
  background: rgba(249,115,22,.15);
  color: #f97316;
}

.st-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.st-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
}

.st-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6b21a8, #f97316);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.st-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-meta {
  font-size: 11px;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-actions { display: flex; gap: 6px; flex-shrink: 0; }

.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity .15s, background .15s;
  width: 100%;
  margin-top: 8px;
  box-sizing: border-box;
}

.st-btn--primary {
  background: #f97316;
  color: #fff;
  border-color: #f97316;
}
.st-btn--primary:hover { opacity: .88; }

.st-btn--ghost {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
  padding: 4px 8px;
  font-size: 11px;
  width: auto;
  margin-top: 0;
}
.st-btn--ghost:hover { background: var(--muted); }

.st-btn--danger {
  background: transparent;
  color: #ef4444;
  border-color: #ef4444;
  padding: 4px 8px;
  font-size: 11px;
  width: auto;
  margin-top: 0;
}
.st-btn--danger:hover { background: rgba(239,68,68,.1); }

.st-inp, .st-sel {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  color: var(--foreground);
  font-size: 13px;
  margin-top: 8px;
  box-sizing: border-box;
}
.st-inp:focus, .st-sel:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 2px rgba(249,115,22,.2);
}

.st-hint {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-bottom: 2px;
}

.st-empty {
  font-size: 13px;
  color: var(--muted-foreground);
  text-align: center;
  padding: 20px 0;
}

.st-remap-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.st-remap-row:last-child { border-bottom: none; }
.st-remap-row .st-info   { flex: 0 0 160px; min-width: 0; }
.st-remap-row .st-sel    { margin-top: 0; flex: 1; }

.st-arrow { font-size: 14px; color: var(--muted-foreground); flex-shrink: 0; }
