/* 成员与权限：待处理、离职交接、岗位字典、角色卡片、操作记录 */

/* 待处理：一条就够，有事才出现 */
.todo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); font-size: 14px; }
.todo-bar strong { margin-right: 2px; color: var(--label-2); font-weight: 600; }
.todo-chip { min-height: 26px; padding: 2px 10px; border-radius: 999px; background: var(--orange-soft); color: var(--orange); font-size: 13px; font-weight: 500; }
.todo-chip:hover { filter: brightness(.96); }
.todo-chip[aria-pressed="true"] { background: var(--orange); color: var(--surface); font-weight: 600; }

/* 成员表：角色下拉带颜色，右边的 … 对齐 */
table.member-table .select.status.cell-status { max-width: 128px; text-overflow: ellipsis; }
.member-actions .more-btn { vertical-align: middle; }
.member-groups .side-panel-head { margin-bottom: 4px; }

/* 单独设置权限：成员表上的小标记，弹层里单独设置过的行高亮 */
.perm-mark { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--orange-soft); color: var(--orange); font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.perm-mark:hover { filter: brightness(.96); }
.perm-row.custom { background: var(--orange-soft); }
.perm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 15px; }
.perm-state { flex: none; color: var(--label-3); font-size: 12px; white-space: nowrap; }
.perm-row.custom .perm-state { color: var(--orange); font-weight: 600; }

/* 离职交接 */
.handover-n { color: var(--label); font-weight: 600; font-variant-numeric: tabular-nums; }
.handover-n.muted { font-weight: 400; }
.handover-list .row-label.muted { color: var(--label-3); }
.warn-foot { color: var(--orange); font-weight: 500; }

/* 岗位：短列表，不用铺满整屏 */
.positions-section { max-width: 760px; }
.position-row { gap: 10px; }
.position-row .position-name { flex: 1; min-width: 80px; margin-left: 0; font-weight: 500; }
.position-row .position-line { flex: none; width: 124px; }
.position-count { flex: none; width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.grip-space { flex: none; width: 10px; margin-right: 8px; }
.position-row form, .position-row .btn { flex: none; }
.position-row .more-btn { flex: none; }

/* 角色：先说清适合谁，下面才是细的权限 */
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.role-card { padding: 12px 14px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); }
.role-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.role-card p { margin: 0; color: var(--label-2); font-size: 14px; line-height: 1.45; }
.role-hint { min-height: 1.4em; }
.perm-table th .more-btn { width: 24px; height: 24px; margin-top: 2px; }

/* 操作记录 */
.audit-line { font-size: 14px; overflow-wrap: anywhere; }
.audit-line strong { font-weight: 600; }
.audit-actor { color: var(--label-2); }
.audit-list .list-side { white-space: nowrap; }
.audit-pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding-top: 12px; }

@media (max-width: 760px) {
  /* 页头：四个分段占一整行，添加按钮排到下一行，不然会叠在一起 */
  .head-tools:has(.members-tabs) { flex-wrap: wrap; }
  .members-tabs { flex: 1 1 100%; min-width: 0; }
  .head-tools:has(.members-tabs) > .btn { flex: 1; }
  /* 分组：手机上横着滑，不把成员表挤到一屏以外 */
  .member-groups.side-panel { display: flex; align-items: center; gap: 6px; padding: 6px; overflow-x: auto; scrollbar-width: none; }
  .member-groups.side-panel::-webkit-scrollbar { display: none; }
  .member-groups .tree-row { flex: none; padding-left: 0; }
  .member-groups .tree-label { min-height: 36px; padding: 3px 10px; gap: 6px; }
  .member-groups .tree-count { margin-left: 0; }
  .member-groups .tree-track, .member-groups .tree-empty { display: none; }
  .member-groups .new-group { flex: none; width: 160px; padding: 0; }
  .todo-chip { min-height: 36px; font-size: 14px; }
  .position-row { gap: 6px; }
  .position-row .position-name { min-width: 0; font-size: 16px; }
  .position-row .position-line { width: 92px; }
  .position-count { width: auto; white-space: nowrap; }
  .position-row .grip-static, .grip-space { margin-right: 2px; }
  .section-title:has(.new-role) { flex-wrap: wrap; }
  .new-role { flex: 1 1 100%; margin-left: 0; }
  .new-role .input { flex: 1; width: auto; min-height: 38px; font-size: 16px; }
  .perm-table th .more-btn { width: 32px; height: 32px; }
  .audit-list .list-row { align-items: flex-start; }
}

/* 账号和“还没登录”放一行，长账号也不折行，行高保持整齐 */
td.member-name { min-width: 236px; }
.member-id > .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 手机：成员表不横滑。每个人一块：第一行姓名和“…”，下面两列放岗位、角色、手机号、绑定，都还能直接改 */
@media (max-width: 760px) {
  table.member-table, table.member-table tbody { display: block; width: 100%; min-width: 0; }
  table.member-table thead { display: block; }
  table.member-table thead tr { display: flex; align-items: center; box-shadow: inset 0 -1px 0 var(--sep); }
  table.member-table thead th { position: static; flex: none; border: 0; box-shadow: none; background: none; }
  table.member-table thead th:not(.check):not(:nth-child(2)) { display: none; }
  table.member-table tbody tr {
    display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) 44px; align-items: center; column-gap: 8px; row-gap: 2px;
    padding: 8px 0; box-shadow: inset 0 -1px 0 var(--sep);
  }
  table.member-table td { display: block; min-width: 0 !important; padding: 0; border: 0; box-shadow: none; background: none; }
  table.member-table td.check { grid-column: 1; grid-row: 1; padding-left: 14px; }
  table.member-table td.member-name { grid-column: 2 / 4; grid-row: 1; padding-left: 0 !important; }
  table.member-table td.member-actions { grid-column: 4; grid-row: 1; position: static; }
  /* 岗位、角色一行；手机号、绑定一行；按分组看时分组单独一行 */
  table.member-table tbody td:nth-child(3) { grid-column: 2; grid-row: 2; }
  table.member-table tbody td:nth-child(4) { grid-column: 3 / 5; grid-row: 2; }
  table.member-table tbody td:nth-last-child(3) { grid-column: 2; grid-row: 3; }
  table.member-table tbody td:nth-last-child(2) { grid-column: 3 / 5; grid-row: 3; }
  table.member-table tbody td:nth-child(5):nth-last-child(4) { grid-column: 2 / 5; grid-row: 4; }
  table.member-table tbody td .select.cell { width: 100%; max-width: 100%; }
  table.member-table .inline-edit { margin-left: 0; font-size: 16px; }
  table.member-table td.nowrap { white-space: normal; }
  table.member-table .grip { display: none; }
  .member-who { min-width: 0; }
}
