.team-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 32%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: #0f172a;
}

.team-shell {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.team-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.team-hero__eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  color: #2563eb;
  text-transform: uppercase;
}

.team-hero__title {
  margin: 8px 0 0;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 900;
  color: #0f172a;
}

.team-hero__desc {
  margin: 10px 0 0;
  font-size: 14px;
  color: #64748b;
}

.team-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.team-btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  background: #0f172a;
  color: white;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .16);
}

.team-btn:hover {
  transform: translateY(-1px);
}

.team-btn--ghost {
  background: white;
  color: #0f172a;
  border: 1px solid #dbe4f0;
  box-shadow: none;
}

.team-filter-card,
.team-table-card,
.team-user-card {
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(15,23,42,.08);
}

.team-filter-card {
  padding: 16px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
}

.team-field {
  display: grid;
  gap: 7px;
}

.team-field label {
  font-size: 12px;
  color: #64748b;
  font-weight: 800;
}

.team-input,
.team-select {
  min-width: 180px;
  height: 42px;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: white;
  padding: 0 12px;
  outline: none;
  font-size: 14px;
}

.team-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.team-kpi {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(15,23,42,.06);
}

.team-kpi span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.team-kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  font-weight: 900;
  color: #0f172a;
}

.team-table-card {
  overflow: hidden;
}

.team-table-head {
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.team-table-title {
  font-size: 18px;
  font-weight: 900;
}

.team-table-sub {
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
}

.team-table-wrap {
  overflow-x: auto;
}

.team-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
}

.team-table th,
.team-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #edf2f7;
  font-size: 13px;
  white-space: nowrap;
}

.team-table th {
  color: #64748b;
  background: #f8fafc;
  font-weight: 900;
}

.team-table td {
  color: #1e293b;
  font-weight: 650;
}

.team-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.team-user-name {
  font-weight: 900;
  color: #0f172a;
}

.team-user-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.team-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  background: #eff6ff;
  color: #1d4ed8;
}

.team-badge--admin {
  background: #fef3c7;
  color: #92400e;
}

.team-number {
  font-variant-numeric: tabular-nums;
}

.team-empty {
  padding: 42px;
  text-align: center;
  color: #64748b;
}

.team-user-card {
  margin-top: 18px;
  padding: 18px;
}

.team-create-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

@media (max-width: 1100px) {
  .team-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .team-shell {
    width: min(100% - 24px, 1440px);
  }

  .team-hero {
    display: block;
  }

  .team-actions {
    margin-top: 16px;
  }

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

  .team-create-grid {
    grid-template-columns: 1fr;
  }
}

/* contribution ranking patch */
.team-rule-card {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(30, 64, 175, .92));
  color: white;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
}

.team-rule-card__title {
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 10px;
}

.team-rule-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.team-rule-list span {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.18);
  font-size: 12px;
  font-weight: 800;
}

.team-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 950;
}

.team-rank--gold {
  background: linear-gradient(135deg, #f59e0b, #facc15);
  color: #451a03;
}

.team-rank--silver {
  background: linear-gradient(135deg, #cbd5e1, #f8fafc);
  color: #0f172a;
}

.team-rank--bronze {
  background: linear-gradient(135deg, #b45309, #f59e0b);
  color: white;
}

.team-score {
  font-size: 18px;
  color: #0f172a;
  font-weight: 950;
}

.team-level {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #ecfeff;
  color: #0e7490;
  font-size: 12px;
  font-weight: 900;
}

.team-kpi--strong {
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  color: white;
}

.team-kpi--strong span,
.team-kpi--strong strong {
  color: white;
}

.team-kpi__name {
  font-size: 22px !important;
  line-height: 1.25;
}

.team-btn--small {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
}

.team-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.team-btn--danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  box-shadow: none;
}

.team-btn--danger:hover {
  background: #fecaca;
}

.team-link-number {
  border: 0;
  background: transparent;
  color: #1d4ed8;
  font-weight: 950;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}

.team-link-number:hover {
  background: #eff6ff;
}

.team-detail-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
}

.team-detail-modal {
  width: min(980px, 100%);
  max-height: 86vh;
  overflow: hidden;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .28);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
}

.team-detail-head {
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.team-detail-title {
  font-size: 18px;
  font-weight: 950;
  color: #0f172a;
}

.team-detail-sub {
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
}

.team-detail-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}

.team-detail-list {
  overflow: auto;
  padding: 12px;
}

.team-detail-item {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid #edf2f7;
  border-radius: 16px;
  margin-bottom: 10px;
  background: #f8fafc;
}

.team-detail-company {
  font-weight: 950;
  color: #0f172a;
  line-height: 1.35;
}

.team-detail-meta,
.team-detail-contact,
.team-detail-note {
  font-size: 12px;
  color: #64748b;
  line-height: 1.8;
}

@media (max-width: 860px) {
  .team-detail-item {
    grid-template-columns: 1fr;
  }
}
