.team-page {
  --team-border: #33383e;
  --team-divider: #2a2f34;
  --team-muted: #b3bdc9;
  --team-inset: clamp(10px, 1.35vw, 24px);
  min-width: 0;
}

.team-page .page-heading {
  align-items: center;
  margin-bottom: 15px;
}

.team-page .page-heading h1 {
  margin: 0;
  font-size: clamp(25px, 2vw, 32px);
  font-weight: 600;
  letter-spacing: -.025em;
}

.team-page .heading-actions { gap: clamp(8px, 1.2vw, 20px); }
.team-page .heading-actions .btn {
  min-height: clamp(38px, 2.8vw, 48px);
  padding-inline: clamp(11px, 1.15vw, 20px);
  font-size: clamp(13px, 1vw, 16px);
  border-radius: 9px;
}
.team-page .heading-actions .btn-primary { background: #1689fa; border-color: #2a92fb; }
.team-page .heading-actions .btn-primary:hover { background: #3299ff; }

.team-tabs {
  display: flex;
  align-items: stretch;
  margin-bottom: clamp(22px, 2.1vw, 36px);
  border-bottom: 1px solid var(--team-border);
}
.team-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 -1px;
  padding: 10px clamp(13px, 1.2vw, 21px) 13px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--team-muted);
  font-size: clamp(14px, 1vw, 17px);
  font-weight: 500;
}
.team-tab:hover { color: #eff3f8; }
.team-tab[aria-selected=true] { color: #f5f7fb; border-bottom-color: var(--blue); }
.team-tab-count {
  min-width: 25px;
  padding: 2px 8px;
  border-radius: 99px;
  background: #30363e;
  color: #e5eaf0;
  font-size: .85em;
  font-weight: 600;
  line-height: 1.38;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.team-tab[aria-selected=true] .team-tab-count { background: #204e77; color: white; }
.team-tab:focus-visible { outline-offset: -3px; }
.team-page [role=tabpanel][hidden] { display: none; }

.team-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 16.5%) minmax(147px, 17.5%);
  gap: clamp(8px, 1vw, 18px);
  margin-bottom: clamp(18px, 1.7vw, 30px);
}
.team-filters input, .team-filters select {
  min-height: clamp(38px, 3vw, 50px);
  border: 1px solid var(--team-border);
  border-radius: 8px;
  background: #191c1f;
  font-size: clamp(13px, .98vw, 16px);
}
.team-filters .search-wrap > .icon {
  top: 50%;
  left: 13px;
  color: #a9b6c5;
  transform: translateY(-50%);
}
.team-filters .search-wrap input { padding-left: 38px; }

.team-invitations-description {
  margin: 0 0 clamp(18px, 1.6vw, 27px);
  color: var(--team-muted);
  font-size: clamp(13px, 1vw, 16px);
}

.team-page .team-table-panel, .team-page .team-invitations-table-panel {
  border: 1px solid var(--team-border);
  border-radius: 10px;
  background: #1c1e21;
}
.team-page .data-table-wrap { overflow: visible; }
.team-page .data-table { table-layout: fixed; }
.team-page .data-table th {
  height: clamp(42px, 3.4vw, 56px);
  padding: 10px var(--team-inset);
  border-color: var(--team-border);
  background: #202327;
  color: #b9c3cf;
  font-size: clamp(10px, .78vw, 13px);
  font-weight: 600;
  letter-spacing: .055em;
  white-space: normal;
}
.team-page .data-table td {
  height: clamp(52px, 4.15vw, 70px);
  min-width: 0;
  padding: 8px var(--team-inset);
  border-color: var(--team-divider);
  color: #cbd3dd;
  font-size: clamp(12px, .96vw, 16px);
  white-space: normal;
  overflow-wrap: anywhere;
}
.team-page .users-table th:nth-child(1) { width: 18.5%; }
.team-page .users-table th:nth-child(2) { width: 13.6%; }
.team-page .users-table th:nth-child(3) { width: 14%; }
.team-page .users-table th:nth-child(4) { width: 12.5%; }
.team-page .users-table th:nth-child(5) { width: 14.2%; }
.team-page .users-table th:nth-child(6) { width: 13.2%; }
.team-page .users-table th:nth-child(7) { width: 14%; text-align: right; }
.team-page .user-cell { min-width: 0; gap: clamp(7px, 1vw, 18px); }
.team-page .user-cell .avatar {
  flex: none;
  width: clamp(29px, 2.6vw, 43px);
  height: clamp(29px, 2.6vw, 43px);
  border: 0;
  border-radius: 9px;
  background: #2b323b;
  color: #eff3f8;
  font-size: clamp(12px, .9vw, 15px);
}
.team-page .user-cell-name {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  max-width: none;
  color: #f2f4f7;
  font-weight: 600;
}
.team-page .user-display-name, .team-page .users-table td.user-login-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team-page .user-self { flex: none; margin: 0; color: var(--team-muted); font-size: .8em; }
.team-page .badge {
  max-width: 100%;
  padding: 4px 9px;
  font-size: clamp(11px, .9vw, 15px);
  border-radius: 6px;
  line-height: 1.35;
  white-space: normal;
}
.team-page .badge-gray { background: #282c30; border-color: #373d43; color: #d0d8e2; }
.team-page .badge-blue { background: #1c3040; border-color: #244d6b; color: #80caff; }
.team-page .badge-green { background: #1c302b; border-color: #284b40; color: #7ce4bc; }
.team-page .dot { width: 8px; height: 8px; }

.team-geo-access, .team-geo-item, .team-invitation-status { display: inline-flex; align-items: center; }
.team-geo-access, .team-invitation-status { flex-wrap: wrap; max-width: 100%; gap: 5px 9px; }
.team-geo-item { gap: 7px; max-width: 100%; }
.team-geo-flag { font-size: 1.15em; line-height: 1.1; }
.team-geo-item .icon { width: 1.15em; height: 1.15em; color: var(--team-muted); }
.team-page .user-row-actions { justify-content: flex-end; gap: clamp(3px, .3vw, 6px); }
.team-page .users-table .actions-cell { padding-inline:clamp(4px,.65vw,10px); }
.team-page .user-row-actions .btn {
  min-width: 0;
  width: clamp(30px, 2.55vw, 44px);
  min-height: 0;
  height: clamp(30px, 2.55vw, 44px);
  padding: 5px;
  border-radius: 8px;
}
.team-page .user-row-actions .btn:disabled { color: #80858a; border-color: #45484c; background: transparent; }
.team-page .action-label { display: none; }

.team-page .invitations-table th:nth-child(1) { width: 21.5%; }
.team-page .invitations-table th:nth-child(2) { width: 19.5%; }
.team-page .invitations-table th:nth-child(3) { width: 20.5%; }
.team-page .invitations-table th:nth-child(4) { width: 18%; }
.team-page .invitations-table th:nth-child(5) { width: 20.5%; }
.team-page .invitations-table td { height: clamp(50px, 4vw, 67px); }
.team-page .table-footer { align-items: baseline; padding: 13px var(--team-inset); color: var(--team-muted); font-size: clamp(11px, .95vw, 15px); }
.team-page .table-footer > span:last-child { display: inline; white-space: nowrap; }

@media (min-width: 821px) and (max-width: 1250px) {
  .team-page { --team-inset: clamp(4px, .65vw, 9px); }
  .team-page .user-cell { gap: 6px; }
  .team-page .badge { padding: 3px 6px; }
  .team-page .user-row-actions { gap: 4px; }
}
@media (min-width: 821px) and (max-width: 990px) {
  .team-page { --team-inset: 4px; }
  .team-page .data-table th { letter-spacing: 0; }
  .team-page .users-table th:nth-child(7) { width: 17%; }
  .team-page .users-table th:nth-child(1) { width: 17%; }
  .team-page .users-table th:nth-child(2) { width: 12.1%; }
  .team-page .user-row-actions .btn { width: 26px; height: 30px; }
  .team-page .user-cell .avatar { width: 23px; height: 27px; }
  .team-page .user-cell { gap: 4px; }
  .team-page .user-row-actions { gap: 3px; }
  .team-page .badge { gap: 4px; padding: 3px 4px; }
  .team-page .dot { width: 6px; height: 6px; }
}

@media (max-width: 820px) {
  .team-page .heading-actions { flex-wrap: nowrap; }
  .team-page .page-heading h1 { font-size: clamp(21px, 5vw, 24px); }
  .team-page .heading-actions .btn { min-width: 38px; padding: 8px; }
  .team-page .heading-actions .btn-primary .button-label { display: inline; }
  .team-tabs { margin-bottom: 17px; }
  .team-tab { padding: 8px 12px 10px; gap: 7px; }
  .team-filters { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 14px; }
  .team-filters .field.wide { grid-column: 1/-1; }

  .team-page .responsive-table tbody { display: block; padding: 0; }
  .team-page .responsive-table tbody tr:not(.empty-row) {
    margin: 0;
    padding: 11px 12px;
    border: 0;
    border-bottom: 1px solid var(--team-divider);
    border-radius: 0;
    background: transparent;
  }
  .team-page .responsive-table tbody tr:last-child { border-bottom: 0; }
  .team-page .responsive-table td { height: auto; padding: 0; font-size: 12px; }
  .team-page .responsive-table .empty-row { padding: 0; }
  .team-page .users-table tbody tr:not(.empty-row) {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(103px, .9fr);
    grid-template-areas: "name name actions" "role status geo";
    gap: 9px 5px;
    align-items: center;
  }
  .team-page .users-table .user-role-cell { grid-area: role; }
  .team-page .users-table .user-status-cell { grid-area: status; }
  .team-page .users-table .user-geo-cell { grid-area: geo; }
  .team-page .users-table .actions-cell { grid-area: actions; padding: 0; border: 0; }
  .team-page .user-cell { align-items: center; }
  .team-page .user-cell .avatar { width: 28px; height: 28px; }
  .team-page .user-row-actions .btn { flex: none; width: 32px; height: 32px; }
  .team-page .users-table .badge { padding: 3px 6px; font-size: 11px; }

  .team-page .invitations-table tbody tr:not(.empty-row) {
    grid-template-columns: repeat(2,minmax(0,1fr));
    grid-template-areas: "role status" "geo geo" "created expires";
    align-items: start;
    gap: 9px 12px;
  }
  .team-page .invitations-table td:nth-child(1) { grid-area: role; }
  .team-page .invitations-table td:nth-child(2) { grid-area: geo; }
  .team-page .invitations-table td:nth-child(3) { grid-area: status; }
  .team-page .invitations-table .invitation-created-cell { display: block; grid-area: created; }
  .team-page .invitations-table .invitation-expires-cell { grid-area: expires; }
  .team-page .table-footer { flex-wrap: nowrap; padding: 11px 12px; }
}

@media (min-width: 540px) and (max-width: 820px) {
  .team-page .heading-actions .btn .button-label { display: inline; }
}
@media (max-width: 350px) {
  .team-page .heading-actions .btn-primary .button-label { display: none; }
}

.team-page .team-filters[data-managers-only] { grid-template-columns:minmax(0,1fr) minmax(130px,18%); }
.team-page .user-row-actions [data-transfer-user] { color:#99d1ff; }
.transfer-duration { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.transfer-duration[hidden], .transfer-result[hidden] { display:none; }
.transfer-summary { padding:12px 14px; border:1px solid var(--line); border-radius:8px; background:#20262c; }
.transfer-summary p { margin:0; line-height:1.45; }
.transfer-summary p:not(:first-child):not(:empty) { margin-top:5px; }
.transfer-history-head { display:flex; align-items:center; justify-content:space-between; }
.transfer-history-head h3 { margin:0; font-size:14px; font-weight:600; }
.transfer-history ul { padding:0; margin:0; list-style:none; }
.transfer-history li { padding:9px 0; border-top:1px solid var(--line); overflow-wrap:anywhere; line-height:1.5; }
.transfer-history small, .transfer-record-status { color:var(--muted); font-size:12px; }
.transfer-result { margin:0; padding:10px 12px; border-left:3px solid #64cab1; color:#c3ebde; background:#22342e; }
@media (max-width:820px) {
  .team-page .team-filters[data-managers-only] { grid-template-columns:minmax(0,1fr); }
  .team-page .user-row-actions [data-transfer-user] { width:29px; }
  .transfer-duration { gap:10px; }
}
