.team-management { padding: 44px 44px 24px 24px; }
.team-management .task-tabs { gap: 40px; }
.team-management__notice { display: flex; align-items: center; height: 36px; margin-bottom: 16px; padding: 0 16px; border-radius: 4px; background: var(--df-color-notice-bg); color: var(--df-color-warning); font-size: 12px; }
.team-management__notice::before { content: "!"; display: inline-flex; align-items: center; justify-content: center; width: 12px; height: 12px; margin-right: 8px; border-radius: 50%; background: var(--df-color-warning); color: var(--df-color-notice-text); font-size: 10px; font-weight: 700; }
.team-management__notice a { margin-left: 4px; color: var(--df-color-text-on-card); text-decoration: none; }
.team-management__split-layout { height: 400px; }
.team-management__left-panel { width: 280px; flex-shrink: 0; padding: 20px; border-radius: 8px; background: var(--df-color-surface-panel-2); }
.team-management__left-panel .toolbar { margin-bottom: 16px; }
.team-management__left-panel .team-action { height: auto; padding: 0; border: 0; background: transparent; color: var(--df-color-link, var(--df-color-text-strong)); }
.team-management__left-panel > .task-empty, .team-management__left-panel > .local-items:empty { display: none; }
.team-project-card { display: flex; align-items: flex-start; gap: 12px; width: 100%; height: 86px; padding: 16px 12px; border: 1px solid var(--df-color-project-card-border); border-radius: 8px; background: var(--df-color-project-card-bg); text-align: left; transition: background-color .2s, border-color .2s; }
.team-project-card__icon { display: flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; background: var(--df-color-project-icon); color: var(--df-color-text); font-size: 14px; font-weight: 500; }
.team-project-card__text { display: flex; flex-direction: column; gap: 2px; color: var(--df-color-text-secondary); font-size: 12px; line-height: 16px; }
.team-project-card__text strong { color: var(--df-color-text); font-size: 14px; line-height: 20px; }
.team-project-card__more { margin-left: auto; color: var(--df-color-text-on-dark-weak); letter-spacing: 2px; }
.team-management__right-panel { flex: 1; margin-left: 20px; padding: 20px; overflow: hidden; border-radius: 8px; background: var(--df-color-surface-panel-2); }
.team-project-heading { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; font-size: 16px; }
.team-project-meta { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; color: var(--df-color-text-meta-weak); font-size: 12px; }
.team-project-meta span { padding-left: 8px; border-left: 1px solid var(--df-color-fill-dim); }
.team-members-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.team-invite { height: 32px; padding: 0 16px; border: 0; border-radius: 4px; background: var(--df-color-team-invite); color: var(--df-color-text-on-card); }
.team-action, .team-invite { display: inline-flex; align-items: center; gap: 4px; }
.team-action .df-icon, .team-invite .df-icon { width: 12px; height: 12px; fill: currentColor; }
.team-members-toolbar .refresh .df-icon { width: 14px; height: 14px; fill: currentColor; }
.team-members-toolbar .task-search { margin-left: auto; }
.team-members-toolbar input { width: 240px; font-size: 12px; }
.team-members-toolbar .refresh { position: static; width: 32px; height: 32px; border: 1px solid var(--df-color-border); border-radius: 4px; background: transparent; color: var(--df-color-text-body); }
.team-members-table { border-collapse: separate; border-spacing: 0; width: 100%; }
.team-members-table th { height: 40px; padding: 0 16px; border-bottom: 1px solid var(--df-color-surface-active); background: var(--df-color-surface-raised); color: var(--df-color-text-on-dark-soft); text-align: left; font-size: 12px; font-weight: 500; }
.team-members-table th:nth-child(2) { width: 65%; }
.team-members-table td { height: 60px; border-bottom: 1px solid var(--df-color-surface-active); background: var(--df-color-surface-media); color: var(--df-color-text-on-dark-strong); text-align: center; }
.team-members-table tbody tr:hover td { background: var(--df-color-row-hover); }
.team-project-card { transition: background-color .2s; }
.team-project-card:hover { background-color: var(--df-color-project-hover); }
.team-project-card.is-active { border-color: var(--df-color-project-active-border); background-color: var(--df-color-project-active-bg); }
.team-members-table td img { width: 24px; height: 24px; margin-right: 8px; vertical-align: middle; }
/* 默认 absolute 留给深色兜底；浅色/主流程用下方 .team-management .team-disclaimer 流式尾随白卡 */

.team-management .task-tabs { margin-bottom: 12px; }
.team-project-card__text { min-width: 0; white-space: nowrap; }
.team-members-toolbar { margin-bottom: 22px; }
.team-members-toolbar .refresh { margin-left: 0; }
.team-members-table th:nth-child(1) { width: 40%; }
.team-members-table th:nth-child(2) { width: 40%; }
.team-members-table th:nth-child(3) { width: 20%; }

/* ---------- 团队成员与角色权限（P-07） ---------- */
.team-members-table select.team-role-select,
.team-role-select {
  /* 线上 .team-management__role-select{width:100px} */
  width: 100px;
  padding: 4px 8px;
  border: 1px solid var(--df-color-border);
  border-radius: var(--df-radius-md);
  background: transparent;
  color: var(--df-color-text);
  font: inherit;
  font-size: var(--df-font-size-xs);
}
.team-member-empty { color: var(--df-color-text-faint); text-align: center; }
.team-management__notice { color: var(--df-color-warning-text); }
.team-member-empty .df-empty--table { width: 100%; }
.team-member-empty .df-empty--table img { display: inline-block; width: 24px; height: 24px; margin: 0; }

/* 邀请/移除弹窗使用 styles/components.css 的 .df-dialog（见 team.html） */
.team-dialog__permissions {
  margin: 0;
  color: var(--df-color-text-faint);
  font-size: var(--df-font-size-xs);
  line-height: var(--df-line-height-base);
}


/* 团队页页签：线上 is-active 16px/600/#fff，未选中 14px/400/#e5e6eb；下划线较通用 .task-tabs 高 7px，这里补偿 */
.team-management .task-tabs { margin-bottom: 19px; }
.team-management .task-tabs button { padding-bottom: 1px; }

.team-management .task-tabs button[aria-pressed="true"] { color: var(--df-color-text-strong); font-size: 16px; font-weight: 600; }
.team-management .task-tabs button { color: var(--df-color-text-body); font-size: 14px; font-weight: 400; }

/* 用户管理控件：统一表面、对比度与操作尺寸。 */
.team-management #users .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--df-space-3); margin-bottom: var(--df-space-4); }
.team-management #users .team-action { height: 32px; background: var(--df-color-primary); border-color: var(--df-color-primary); color: var(--df-color-primary-text); }
.team-management #users .team-action:hover { background: var(--df-color-primary-active); border-color: var(--df-color-primary-active); }
.team-management #users .toolbar > button:disabled { height: 32px; padding: 0 12px; border: 1px solid var(--df-color-border-subtle); border-radius: var(--df-radius-md); background: var(--df-color-surface-raised); color: var(--df-color-text-faint); font: inherit; font-size: var(--df-font-size-sm); cursor: not-allowed; }
.team-management #users input[type="search"] { height: 32px; max-width: 100%; padding: 0 12px; border: 1px solid var(--df-color-control-edge); border-radius: var(--df-radius-md); background: var(--df-color-surface-input); color: var(--df-color-text-strong); }
.team-management__user-icon { background: var(--df-color-surface-active); color: var(--df-color-text-strong); }
.team-management__notice a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.team-management #users .task-table { overflow-x: auto; }
.team-management #users table { width: 100%; min-width: 680px; table-layout: fixed; border-collapse: collapse; }
.team-management #users th, .team-management #users td { padding: 12px 16px; text-align: left; vertical-align: middle; }
.team-management #users th:nth-child(2),
.team-management #users td:nth-child(2) { width: 28%; }
.team-management #users tbody tr:hover { background: var(--df-color-row-hover); }
.team-management #users .team-selection,
.team-management #users td.team-selection {
  width: 40px;
  max-width: 40px;
  padding-left: 16px;
  padding-right: 8px;
  text-align: center;
  vertical-align: middle;
}
.team-management #users .team-selection input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--df-color-primary);
}
.team-management #users .team-management__user-name { white-space: nowrap; }
.team-management #users .team-management__user-id { color: var(--df-color-text-faint); }
.team-management #users .task-empty { padding: 32px 0; }

.team-role-help { display:inline-flex; vertical-align:middle; align-items:center; justify-content:center; width:18px; height:18px; padding:0; border:0; background:transparent; color:var(--df-color-text-secondary); cursor:pointer; }
.team-role-help .df-icon { width:14px; height:14px; fill:currentColor; }
.team-role-tip { position:fixed; z-index:200; box-sizing:border-box; width:320px; max-width:calc(100vw - 16px); padding:12px; border:1px solid var(--df-color-border-subtle); border-radius:var(--df-radius-md); background:var(--df-color-surface-raised); color:var(--df-color-text); box-shadow:var(--df-shadow-popover); font-size:12px; line-height:18px; }
.team-role-tip[hidden] { display:none; }
.team-role-tip p { margin:0 0 8px; }
.team-role-tip > button { display:block; margin-left:auto; }

/* 面板随成员内容自然撑开，避免固定400px裁断末行。 */
.team-management__split-layout { height: auto; min-height: 400px; align-items: stretch; }
.team-management__right-panel { min-width: 0; padding-bottom: 24px; overflow: visible; }
/* 尾随用户管理/审计日志白卡，落在页面灰底上 */
.team-management .team-disclaimer {
  position: static;
  margin: 16px 0 0;
  color: var(--df-color-text-soft);
  font-size: 12px;
  font-weight: 400;
  line-height: normal;
  text-align: center;
}
.team-management__right-panel { overflow-x: auto; }

/* 列标题与操作控件共用左对齐，避免表头靠左、内容居中的断裂。 */
.team-members-table { table-layout: fixed; }
.team-members-table th, .team-members-table td { text-align: left; vertical-align: middle; }
.team-members-table th:nth-child(1) { width: 48%; }
.team-members-table th:nth-child(2) { width: 34%; }
.team-members-table th:nth-child(3) { width: 18%; }
.team-members-table .team-management__user-text { align-items: flex-start; text-align: left; }

.audit-log__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.audit-log__filter-form { display: flex; flex-wrap: wrap; gap: 12px; }
.audit-log__date-range { display: flex; align-items: center; box-sizing: border-box; width: 240px; height: 32px; padding: 0 8px; border: 1px solid var(--df-color-border); border-radius: var(--df-radius-md); background: var(--df-color-surface-input); color: var(--df-color-text-secondary); }
html[data-theme] body .audit-log__date-range:focus-within { border-color: var(--df-color-focus-ring); }
.audit-log__date-range > .df-icon { flex: none; width: 14px; height: 14px; margin-right: 6px; }
.audit-log__date-range > span { flex: none; padding: 0 6px; }
.audit-log__date-range .df-input { min-width: 0; width: 100%; height: 30px; padding: 0; border: 0; background: transparent; font-size: var(--df-font-size-xs); }
.audit-log__date-range .df-input::-webkit-calendar-picker-indicator { width: 0; padding: 0; opacity: 0; }
.audit-log__operation-type { width: 160px; height: 32px; font-size: var(--df-font-size-xs); }
.audit-log__refresh { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; padding: 0; border: 1px solid var(--df-color-border); border-radius: var(--df-radius-md); background: transparent; color: var(--df-color-text-body); }
.audit-log__refresh .df-icon { width: 14px; height: 14px; }
.audit-log__table { margin-top: 20px; overflow-x: auto; }
.audit-log__table table { width: 100%; min-width: 640px; table-layout: fixed; border-collapse: collapse; }
.audit-log__table th { height: 40px; padding: 0 16px; border-bottom: 1px solid var(--df-color-surface-active); background: var(--df-color-surface-raised); color: var(--df-color-text-on-dark-soft); text-align: left; font-size: var(--df-font-size-xs); font-weight: 500; }
.audit-log__table td { height: 48px; padding: 0 16px; border-bottom: 1px solid var(--df-color-surface-active); color: var(--df-color-text-on-dark-strong); font-size: var(--df-font-size-xs); }
.audit-log__table tbody tr:hover td { background: var(--df-color-row-hover); }
.audit-log__user-info { display: flex; align-items: center; gap: 10px; }
.audit-log__user-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--df-color-project-icon); color: var(--df-color-on-media); font-size: var(--df-font-size-xs); font-weight: 500; }
.audit-log__user-text { display: flex; flex-direction: column; min-width: 0; }
.audit-log__user-name, .audit-log__user-id { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-log__user-id { color: var(--df-color-text-on-dark-weak); font-size: var(--df-font-size-xs); }
.audit-log__empty { height: 60px; color: var(--df-color-text-on-dark-weak); text-align: center; font-size: 13px; vertical-align: middle; }
.audit-log__empty .df-empty--table { width: 100%; }
.audit-log__pagination { margin-top: 16px; justify-content: flex-end; }
.team-management #users .task-table table { table-layout: fixed; }
#assign-points-batch { height: 32px; padding: 0 12px; border: 1px solid var(--df-color-border); border-radius: var(--df-radius-md); background: var(--df-color-surface-raised); color: var(--df-color-text); font-size: var(--df-font-size-sm); }
#assign-points-batch:disabled { color: var(--df-color-text-faint); cursor: not-allowed; }
.assign-points-dialog { width: min(640px, calc(100vw - 32px)); }
.assign-points-dialog__alert { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 24px; padding: 8px 12px; border-radius: var(--df-radius-md); background: color-mix(in srgb, var(--df-color-warning) 10%, transparent); color: var(--df-color-warning-text); font-size: 12px; line-height: 20px; }
.assign-points-dialog__alert p { margin: 0; }
.assign-points-dialog__label { margin: 0 0 12px; font-size: 14px; }
.assign-points-dialog__user-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.assign-points-dialog__user-card { display: flex; align-items: center; gap: 8px; min-width: 0; height: 58px; padding: 8px 12px; border-radius: 8px; background: var(--df-color-surface-raised); box-sizing: border-box; }
.assign-points-dialog__user-card .team-management__user-info { min-width: 0; }
.assign-points-dialog__user-card .team-management__user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign-points-dialog__points-card { padding: 16px; border-radius: 8px; background: var(--df-color-surface-raised); }
.assign-points-dialog__points-input-row { display: flex; align-items: center; margin-bottom: 12px; }
.assign-points-dialog__points-input-label { flex: none; width: 92px; font-size: 12px; }
.assign-points-dialog__points-input-row .df-input { width: 200px; height: 32px; }
.assign-points-dialog__balance-row { display: flex; align-items: center; color: var(--df-color-text-muted); font-size: 12px; }
.assign-points-dialog__balance-row strong { color: var(--df-color-text); }
.assign-points-dialog__error { margin: 12px 0 0; color: var(--df-color-danger); font-size: 12px; }

@media (max-width: 760px) {
  .assign-points-dialog__user-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-log__toolbar { align-items: flex-start; }
  .audit-log__filter-form { gap: 8px; }
  .audit-log__date-range { width: 220px; }
  .audit-log__operation-type { width: 140px; }
}
.invite-member-dialog { width: min(792px, calc(100vw - 32px)); }
.invite-member-dialog__project-card { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding: 12px 16px; border-radius: 8px; background: var(--df-color-surface-raised); }
.invite-member-dialog__project-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 8px; background: var(--df-color-project-icon); color: var(--df-color-on-media); font-size: 14px; }
.invite-member-dialog__project-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.invite-member-dialog__project-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.invite-member-dialog__project-id { color: var(--df-color-text-faint); font-size: 12px; }
.invite-member-dialog__user-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px; min-height: 100px; max-height: 360px; overflow-y: auto; padding-bottom: 4px; }
.invite-member-dialog__user-card { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 16px; overflow: hidden; border: 1px solid var(--df-color-border-subtle); border-radius: 8px; background: var(--df-color-surface-raised); color: var(--df-color-text); text-align: left; }
.invite-member-dialog__user-card:hover:not(.is-disabled) { border-color: var(--df-color-primary); background: var(--df-color-select-hover); }
.invite-member-dialog__user-card.is-selected { border-color: var(--df-color-primary-bright); background: var(--df-color-primary-soft); }
.invite-member-dialog__user-card.is-disabled { opacity: .35; cursor: not-allowed; }
.invite-member-dialog__user-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--df-color-project-icon); color: var(--df-color-on-media); font-size: 14px; }
.invite-member-dialog__user-info { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.invite-member-dialog__user-name, .invite-member-dialog__user-id { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-member-dialog__user-name { font-size: 12px; font-weight: 500; line-height: 16px; }
.invite-member-dialog__user-id { color: var(--df-color-text-muted); font-size: 12px; line-height: 16px; }
.invite-member-dialog__check-icon { position: absolute; top: 0; right: 0; width: 32px; height: 32px; color: var(--df-color-primary-text); }
.invite-member-dialog__check-icon::before { content: ''; position: absolute; top: 0; right: 0; border-top: 32px solid var(--df-color-primary-bright); border-left: 32px solid transparent; }
.invite-member-dialog__check-icon .df-icon { position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; }
.invite-member-dialog__empty { display: flex; grid-column: 1 / -1; align-items: center; justify-content: center; min-height: 100px; color: var(--df-color-text-muted); }
@media (max-width: 760px) { .invite-member-dialog__user-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#team-dialog.create-user-dialog { width: min(520px, calc(100vw - 32px)); }
#team-dialog .df-btn--primary { border-color: transparent; background: var(--df-color-primary-fill); color: var(--df-color-primary-text); }
#team-dialog .df-btn--primary:hover { background: var(--df-color-primary-fill-hover); }
.create-user-dialog .dialog-form { display: flex; flex-direction: column; gap: 16px; }
.create-user-dialog .df-field { gap: 8px; color: var(--df-color-text); font-size: 14px; }
.create-user-dialog .df-input { height: 32px; }
.create-user-dialog__alert { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 8px 12px; border-radius: var(--df-radius-md); background: color-mix(in srgb, var(--df-color-warning) 10%, transparent); color: var(--df-color-warning-text); font-size: 12px; line-height: 18px; }
.create-user-dialog__alert[hidden] { display: none; }
.create-user-dialog__alert .df-icon { flex: none; }
