:root {
  --team-bg: #070708;
  --team-surface: #0f1012;
  --team-surface-strong: #15171a;
  --team-line: rgba(255, 255, 255, 0.1);
  --team-line-strong: rgba(255, 255, 255, 0.17);
  --team-text: #f4f5f5;
  --team-muted: #92979f;
  --team-green: #38d990;
  --team-green-soft: rgba(56, 217, 144, 0.12);
  --team-amber: #f5c451;
  --team-red: #ff7272;
  --team-blue: #72a7ff;
  --team-overview-height: clamp(340px, calc(100dvh - 500px), 680px);
}

body.team-modal-open {
  overflow: hidden;
}

body.team-modal-open .nav-user-area {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.team-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: none;
  align-items: stretch;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.team-modal.show {
  display: flex;
}

.team-shell {
  position: relative;
  width: min(1920px, calc(100vw - 96px));
  height: 100dvh;
  overflow: hidden;
  background: var(--team-bg);
  border-left: 1px solid var(--team-line);
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.42);
  color: var(--team-text);
}

.team-collapse-btn {
  position: fixed;
  right: min(1920px, calc(100vw - 96px));
  top: 50%;
  z-index: 3;
  width: 40px;
  height: 88px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border: 1px solid rgba(56, 217, 144, 0.45);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background: #0d1110;
  color: var(--team-green);
  cursor: pointer;
}

.team-collapse-btn:hover {
  background: #14231d;
  color: #fff;
}

.team-collapse-btn .ui-icon,
.team-icon-btn .ui-icon {
  width: 20px;
  height: 20px;
}

.team-header {
  position: relative;
  z-index: 2;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 28px;
  background: #09090b;
  border-bottom: 1px solid var(--team-line);
}

.team-heading {
  min-width: 0;
}

.team-title {
  margin: 0;
  color: var(--team-text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
}

.team-subtitle {
  margin-top: 4px;
  color: var(--team-muted);
  font-size: 13px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.team-header-actions,
.team-row-actions,
.team-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-scroll-area {
  height: calc(100dvh - 72px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #4b4f55 transparent;
}

.team-scroll-area::-webkit-scrollbar,
.team-table-wrap::-webkit-scrollbar,
.team-tabs::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.team-scroll-area::-webkit-scrollbar-thumb,
.team-table-wrap::-webkit-scrollbar-thumb,
.team-tabs::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  background: #4b4f55;
  background-clip: padding-box;
}

.team-empty,
.team-dashboard {
  width: 100%;
  padding: 24px 28px 44px;
}

.team-dashboard {
  min-height: 100%;
}

.team-empty {
  max-width: 920px;
  margin: 0 auto;
}

.team-empty-main {
  padding: 28px 0;
  border-bottom: 1px solid var(--team-line);
}

.team-empty-main p,
.team-member-summary p {
  margin: 8px 0 20px;
  color: var(--team-muted);
  font-size: 14px;
  line-height: 1.7;
}

.team-empty-title,
.team-section-title {
  color: var(--team-text);
  font-size: 16px;
  font-weight: 700;
}

.team-invites {
  margin-top: 28px;
}

.team-invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--team-line);
}

.team-invite-row strong,
.team-invite-row span {
  display: block;
}

.team-invite-row span {
  margin-top: 4px;
  color: var(--team-muted);
  font-size: 12px;
}

.team-icon-btn,
.team-text-btn,
.team-action-btn,
.team-primary-btn,
.team-danger-btn,
.team-table-btn,
.team-row-actions button,
.team-tab {
  min-height: 36px;
  border: 1px solid var(--team-line-strong);
  border-radius: 6px;
  background: #121316;
  color: #d8dbde;
  padding: 0 13px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0;
  cursor: pointer;
  white-space: nowrap;
}

.team-icon-btn {
  width: 38px;
  height: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
}

.team-text-btn:hover,
.team-action-btn:hover,
.team-table-btn:hover,
.team-row-actions button:hover,
.team-tab:hover {
  border-color: rgba(56, 217, 144, 0.4);
  color: #fff;
  background: #18201d;
}

.team-icon-btn:focus-visible,
.team-text-btn:focus-visible,
.team-action-btn:focus-visible,
.team-primary-btn:focus-visible,
.team-danger-btn:focus-visible,
.team-table-btn:focus-visible,
.team-row-actions button:focus-visible,
.team-tab:focus-visible {
  outline: 2px solid rgba(114, 167, 255, 0.72);
  outline-offset: 2px;
}

.team-action-btn,
.team-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 650;
}

.team-primary-btn {
  border-color: rgba(56, 217, 144, 0.55);
  background: #1a9d69;
  color: #fff;
}

.team-primary-btn:hover {
  background: #21b879;
}

.team-danger-btn {
  border-color: rgba(255, 114, 114, 0.35);
  color: #ffaaaa;
  background: rgba(255, 114, 114, 0.08);
}

.team-quota-strip {
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(110px, 0.55fr) minmax(0, 3fr);
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
  padding: 11px 16px;
  border: 1px solid var(--team-line);
  border-radius: 6px;
  background: #0b0c0e;
}

.team-quota-title span,
.team-quota-title small {
  display: block;
}

.team-quota-title span {
  color: #dfe2e3;
  font-size: 12px;
  font-weight: 680;
}

.team-quota-title small {
  margin-top: 3px;
  color: var(--team-muted);
  font-size: 10px;
}

.team-quota-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
}

.team-quota-item {
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid var(--team-line);
}

.team-quota-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.team-quota-item-head span {
  color: var(--team-muted);
  font-size: 11px;
}

.team-quota-item-head b {
  overflow: hidden;
  color: #dfe2e3;
  font-size: 12px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-quota-item > .team-quota-value {
  display: none;
}

.team-quota-item > .team-progress {
  height: 3px;
  margin-top: 7px;
}

.team-member-view {
  max-width: 720px;
  padding-top: 32px;
}

.team-member-summary h3 {
  margin: 0;
  font-size: 18px;
}

.team-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.team-metric {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--team-line);
  border-radius: 6px;
  background: var(--team-surface);
  transition: border-color 140ms ease, background-color 140ms ease;
}

.team-metric:hover {
  border-color: rgba(255, 255, 255, 0.17);
  background: #121417;
}

.team-metric-primary {
  border-color: rgba(56, 217, 144, 0.22);
  background: #0d1512;
}

.team-metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.team-metric-label .ui-icon {
  width: 17px;
  height: 17px;
  color: #6f767e;
}

.team-metric span,
.team-metric small {
  display: block;
  color: var(--team-muted);
  font-size: 12px;
}

.team-metric strong {
  display: block;
  margin: 9px 0 6px;
  color: #b7f7d9;
  font-size: 28px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.team-metric:not(.team-metric-primary) strong {
  color: #e6e8e9;
  font-size: 25px;
}

.team-owner-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--team-line);
  border-bottom: 1px solid var(--team-line);
}

.team-owner-tools-copy {
  min-width: 0;
}

.team-owner-tools-copy strong,
.team-owner-tools-copy span {
  display: block;
}

.team-owner-tools-copy strong {
  color: #e8eaeb;
  font-size: 13px;
}

.team-owner-tools-copy span {
  margin-top: 3px;
  color: var(--team-muted);
  font-size: 11px;
}

.team-invite-inline {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(160px, 220px) auto;
  gap: 10px;
  width: max-content;
  max-width: 100%;
}

.team-input,
.team-member-edit input {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--team-line-strong);
  border-radius: 6px;
  background: #0b0c0e;
  color: var(--team-text);
  padding: 0 11px;
  outline: none;
  letter-spacing: 0;
}

.team-input:focus,
.team-member-edit input:focus {
  border-color: rgba(56, 217, 144, 0.65);
  box-shadow: 0 0 0 3px rgba(56, 217, 144, 0.1);
}

.team-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 22px 0 20px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--team-line);
  background: var(--team-bg);
  overflow-x: auto;
  overflow-y: hidden;
}

.team-tab {
  position: relative;
  min-height: 38px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--team-muted);
}

.team-tab::after {
  content: '';
  position: absolute;
  right: 50%;
  bottom: -11px;
  left: 50%;
  height: 2px;
  border-radius: 1px;
  background: var(--team-green);
  transition: right 160ms ease, left 160ms ease;
}

.team-tab:hover {
  border-color: transparent;
  background: transparent;
}

.team-tab.active {
  border-color: transparent;
  background: transparent;
  color: #aaf0cf;
}

.team-tab.active::after {
  right: 0;
  left: 0;
}

.team-tab-panel {
  min-height: 320px;
}

.team-tab-panel:not([hidden]) {
  animation: team-panel-enter 170ms ease-out both;
}

.team-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(380px, 1fr);
  gap: 24px;
  min-height: var(--team-overview-height);
}

.team-overview-section {
  min-width: 0;
  height: var(--team-overview-height);
  display: flex;
  flex-direction: column;
}

.team-overview-section + .team-overview-section {
  padding-left: 24px;
  border-left: 1px solid var(--team-line);
}

.team-section-head {
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.team-section-head h3 {
  margin: 0;
  color: var(--team-text);
  font-size: 16px;
  font-weight: 680;
  letter-spacing: 0;
}

.team-section-head span,
.team-unit {
  display: block;
  margin-top: 5px;
  color: var(--team-muted);
  font-size: 12px;
}

.team-chart {
  flex: 1;
  height: auto;
  min-height: 0;
  min-width: 0;
  padding: 24px 16px 12px;
  border: 1px solid var(--team-line);
  border-radius: 6px;
  background: var(--team-surface);
  overflow: hidden;
}

.team-chart-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(30, minmax(5px, 1fr));
  align-items: end;
  gap: 5px;
  border-bottom: 1px solid var(--team-line-strong);
}

.team-chart-point {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.team-chart-bar {
  width: min(18px, 75%);
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--team-green);
  box-shadow: 0 0 12px rgba(56, 217, 144, 0.22);
  transform-origin: bottom;
  animation: team-bar-enter 320ms ease-out both;
}

.team-chart-point:hover .team-chart-bar {
  background: #82ecc0;
}

.team-chart-point span,
.team-chart-value {
  width: 100%;
  min-height: 14px;
  overflow: hidden;
  color: var(--team-muted);
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  white-space: nowrap;
}

.team-chart-value {
  color: #c4c8ca;
}

.team-chart-point span {
  overflow: visible;
}

.team-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--team-line);
  border-radius: 6px;
  background: var(--team-surface);
  scrollbar-width: thin;
  scrollbar-color: #4b4f55 transparent;
}

.team-data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  color: #d9dcde;
  font-size: 13px;
}

.team-data-table th,
.team-data-table td {
  min-width: 100px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--team-line);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.team-data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--team-surface-strong);
  color: var(--team-muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.team-data-table tr:last-child td {
  border-bottom: 0;
}

.team-data-table tbody tr:not(.team-edit-row):hover {
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 2px 0 0 rgba(56, 217, 144, 0.52);
}

.team-data-table td:first-child,
.team-data-table th:first-child {
  min-width: 170px;
}

.team-data-table strong,
.team-data-table small {
  display: block;
}

.team-data-table strong {
  color: var(--team-text);
  font-weight: 640;
}

.team-data-table small {
  margin-top: 4px;
  color: var(--team-muted);
  font-size: 11px;
}

.team-member-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-member-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  background: #1b1e22;
  color: #dfe3e5;
  font-size: 12px;
  font-weight: 720;
}

.team-member-copy {
  min-width: 0;
}

.team-member-copy strong,
.team-member-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-number {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.team-accent {
  color: #aaf0cf;
  font-weight: 680;
}

.team-positive {
  color: var(--team-green);
}

.team-negative {
  color: #f0a1a1;
}

.team-cell-muted {
  color: #a6abb0;
  font-size: 12px;
  white-space: nowrap;
}

.team-task-id {
  color: #aeb4ba;
  font-family: inherit;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.team-actions-col {
  width: 84px;
  min-width: 84px !important;
  text-align: right !important;
}

.team-table-btn,
.team-danger-btn {
  min-height: 32px;
  padding: 0 10px;
}

.team-data-table tbody tr .team-table-btn {
  opacity: 0.68;
  transition: opacity 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.team-data-table tbody tr:hover .team-table-btn,
.team-data-table tbody tr:focus-within .team-table-btn {
  opacity: 1;
}

.team-ranking {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.team-ranking-table {
  table-layout: fixed;
}

.team-ranking .team-data-table th,
.team-ranking .team-data-table td {
  min-width: 0;
  padding: 11px 10px;
}

.team-ranking .team-data-table td:first-child,
.team-ranking .team-data-table th:first-child {
  min-width: 44px;
}

.team-ranking-table tbody tr {
  height: 62px;
}

.team-rank-col {
  width: 48px;
  text-align: center !important;
}

.team-rank-number {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--team-line-strong);
  border-radius: 5px;
  background: #17191c;
  color: #aeb3b8;
  font-size: 11px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.team-rank-1 .team-rank-number {
  border-color: rgba(56, 217, 144, 0.42);
  background: rgba(56, 217, 144, 0.12);
  color: #b8f7dc;
}

.team-rank-2 .team-rank-number {
  border-color: rgba(114, 167, 255, 0.3);
  color: #b8d2ff;
}

.team-rank-3 .team-rank-number {
  border-color: rgba(245, 196, 81, 0.28);
  color: #f4d98c;
}

.team-rank-consume-col {
  width: 76px;
}

.team-rank-share-col {
  width: 92px;
}

.team-rank-quota-col {
  width: 106px;
}

.team-share-value {
  color: #d0d4d7;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.team-share-track {
  height: 3px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 2px;
  background: #2b2e32;
}

.team-share-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--team-blue);
}

.team-ranking-note {
  flex: 1;
  min-height: 64px;
  display: grid;
  place-items: center;
  padding: 16px;
  border-top: 1px solid var(--team-line);
  color: #747a81;
  font-size: 11px;
  text-align: center;
}

.team-quota-value {
  color: #d7dadd;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.team-quota-unlimited {
  color: var(--team-muted);
  font-size: 12px;
}

.team-progress {
  width: 100%;
  min-width: 80px;
  height: 4px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 2px;
  background: #292c30;
}

.team-progress span {
  display: block;
  height: 100%;
  background: var(--team-green);
  transition: width 300ms ease-out, background-color 160ms ease;
}

.team-progress.is-warning span {
  background: var(--team-amber);
}

.team-progress.is-danger span {
  background: var(--team-red);
}

.team-role,
.team-type,
.team-status,
.team-module {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--team-line);
  border-radius: 4px;
  color: #d7dadd;
  font-size: 11px;
  white-space: nowrap;
}

.team-status::before {
  content: '';
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: currentColor;
}
