/* Team management: compact directories, aligned settings, explicit role scope. */
#usersPanel>.list-header{padding:19px 24px 12px;flex-direction:row;align-items:center}
.team-tabs{display:flex;gap:6px;padding:0 24px 15px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.team-tabs button{display:inline-flex;align-items:center;gap:8px;background:transparent;border-color:transparent;color:#637189;padding:10px 15px;box-shadow:none}
.team-tabs button.active{background:#edf2ff;border-color:#dbe5ff;color:#315ad9}
.team-tabs svg,.team-heading-icon svg,.team-row-icon svg{width:19px;height:19px;flex:none}
.team-section{padding:22px 24px 24px}
.team-list-tools{display:flex;gap:16px;align-items:center;padding:20px 24px 16px}
.team-section>.team-list-tools{padding:0 0 16px}
.team-list-tools>div:first-child{flex:1;min-width:0}
.team-list-tools h3{display:flex;align-items:center;gap:8px;font-size:14px}
.team-list-tools p,.team-section-heading p,.team-login-setting p{font-size:12px;line-height:1.7;color:#718096;margin-top:5px}
.team-count{padding:2px 7px;min-width:25px;text-align:center;border-radius:5px;background:#f0f3f8;color:#68778e;font-size:11px;font-weight:500}
.team-search{display:block;width:240px;flex-shrink:0}
.team-search input{height:38px;background:#f9fbfe;font-size:12px}
.team-admin-help{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#f4f7ff;border:1px solid #e5ebfb;border-radius:8px;padding:9px 13px;margin:0 0 12px;color:#536b90;font-size:12px;line-height:1.7}
.team-admin-help .text-button{font-size:12px}
.team-leader-rule{padding:13px 15px;border:1px solid #dce8e2;border-radius:8px;background:#f5faf7;margin:0 0 12px;font-size:12px;line-height:1.8;color:#315d49}
.team-leader-rule p{margin-top:3px}.team-leader-rule small{display:block;margin-top:4px;font-size:11px}
.team-member{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(170px,1fr) auto;gap:20px;align-items:center;padding:14px 24px;border-bottom:1px solid var(--line);font-size:13px}
.team-member:last-child{border-bottom:0}
.team-member:hover{background:#fafcff}
.team-member strong{font-size:13px;font-weight:600;overflow-wrap:anywhere}
.team-member small{display:block;font-size:11px;margin-top:5px;line-height:1.6;overflow-wrap:anywhere}
.team-member .secondary{font-size:12px;padding:8px 12px}
.team-pill{display:inline-flex;align-items:center;flex:none;gap:5px;padding:4px 8px;border-radius:5px;background:#f0f3f7;color:#627188;font-size:11px;line-height:1.4;white-space:nowrap}
.team-admin-pill{background:#edf0ff;color:#5c56b5}
.team-configured{background:#ebf6f1;color:#227354}
.department-row{grid-template-columns:minmax(0,1.5fr) minmax(170px,1fr) auto;padding:12px 10px;min-height:65px}
.team-department-name{display:flex;gap:12px;align-items:center;min-width:0}
.team-department-name>div{min-width:0}
.team-row-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:8px;background:#f1f5fc;color:#6c88b8;flex-shrink:0}
.team-department-id{margin-top:3px;max-width:100%;color:#8b96a6;font-size:10px}
.team-department-id summary{cursor:pointer;width:fit-content}
.team-department-id code{display:block;margin-top:5px;color:#657893;overflow-wrap:anywhere;word-break:break-all;font-size:10px}
.team-department-access{display:flex;align-items:center;gap:12px}
.team-department-access small{margin:0}
.team-no-match{text-align:center;padding:30px;color:var(--muted);font-size:13px}
#usersPanel .user-form{margin:0 24px 16px;padding:18px;border:1px solid #e1e8f4;border-radius:9px;background:#f8faff}
.team-section-heading{display:flex;align-items:center;gap:12px;margin-bottom:20px}
.team-section-heading>div:nth-child(2){flex:1;min-width:0}
.team-section-heading h3{font-size:16px}
.team-heading-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:10px;background:#edf2ff;color:#3b63d9;flex-shrink:0}
.team-config-form{display:grid;grid-template-columns:1fr;gap:16px;max-width:1100px}
.team-config-card{border:1px solid #e3e9f2;border-radius:9px;padding:18px 20px}
.team-config-card h4{font-size:13px;font-weight:600;margin-bottom:16px;display:flex;align-items:center;gap:7px}
.team-config-card h4>span{font-size:10px;letter-spacing:.5px;color:#7186ae;background:#f0f4fc;border-radius:4px;padding:3px 5px}
.team-config-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:22px;align-items:start}
.team-config-fields label{display:flex;flex-direction:column;gap:8px;align-self:start;font-size:12px}
.team-config-fields input{height:40px;flex:none;font-size:12px}
.team-config-fields small{font-size:11px;font-weight:400;line-height:1.6;overflow-wrap:anywhere}
.team-field{min-width:0;display:grid;gap:8px}
.team-inline-field{display:flex;align-items:center;gap:8px;min-width:0}
.team-inline-field input{flex:1;min-width:0}
.team-inline-field button{flex-shrink:0;font-size:11px;padding:10px;height:40px}
.team-login-setting{display:flex;align-items:center;justify-content:space-between;gap:18px;border:1px solid #e3e9f2;background:#f9fbfe;padding:15px 20px;border-radius:9px}
.team-login-setting strong{font-size:13px}
.team-switch{position:relative;display:block;width:38px;height:22px;flex:none;cursor:pointer}
.team-switch input{position:absolute;inset:0;margin:0;width:38px;height:22px;opacity:0;cursor:pointer;z-index:1}
.team-switch>span:not(.sr-only){display:block;width:38px;height:22px;border-radius:20px;background:#bdc7d7;transition:background .15s}
.team-switch>span:not(.sr-only)::before{content:'';position:absolute;left:3px;top:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #15283a25;transition:transform .15s}
.team-switch input:checked+span{background:#3863df}
.team-switch input:checked+span::before{transform:translateX(16px)}
.team-switch input:focus-visible+span{outline:3px solid #a6baff;outline-offset:3px}
.team-switch input:disabled+span{opacity:.5}
.team-config-footer{padding:2px 0 0}
.team-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:0}
.team-toolbar button{font-size:12px}
#feishuStatus{margin-top:12px;font-size:12px;line-height:1.7;overflow-wrap:anywhere}
.team-setup-guide{max-width:1100px;border-top:1px solid var(--line);margin-top:22px;padding-top:17px;color:#67788e;font-size:12px;line-height:1.85}
.team-setup-guide summary{cursor:pointer;font-weight:600;color:#42566f}
.team-setup-guide summary span{font-weight:400;color:#8a97a9;font-size:11px;margin-left:8px}
.team-setup-guide[open] summary span{display:none}
.team-setup-guide ol{padding-left:20px;margin:12px 0}
.team-setup-guide li{margin:7px 0}
.team-setup-guide code{overflow-wrap:anywhere;color:#59719c}
.team-setup-guide p{margin-top:10px;font-size:11px}
.team-grant-dialog{width:min(800px,95vw)}
.team-grant-dialog form{display:flex;flex-direction:column;max-height:90vh}
.team-grant-dialog .dialog-header{padding:18px 24px;flex:none}
.team-grant-dialog .dialog-header h2{margin:0;font-size:16px}
.team-grant-dialog .dialog-footer{padding:15px 24px;flex:none}
.team-grant-dialog .action-body{padding:20px 24px;overflow:auto;min-height:0;display:flex;flex-direction:column;gap:15px;overscroll-behavior:contain}
#grantDescription{font-size:12px;line-height:1.7}
#inheritLabel{padding:12px 14px;background:#f4f7ff;border:1px solid #e4ebfa;border-radius:8px;color:#45618d;font-size:12px}
.team-grant-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.team-grant-fields label{font-size:12px}
.team-grant-fields select{height:40px}
.team-role-help{font-size:12px;line-height:1.8;color:#6a7d98}
.team-role-help .text-button{padding:0 4px;font-size:12px}
.permission-grid{display:grid;gap:18px}
.team-permission-group{border:0;padding:0;margin:0;min-width:0}
.team-permission-group legend{font-size:12px;font-weight:600;margin-bottom:10px;color:#445a78}
.team-permission-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.permission-choice{display:flex;align-items:center;gap:8px;border:1px solid #e5eaf2;border-radius:7px;padding:10px;font-size:12px;line-height:1.6;cursor:pointer;font-weight:400}
.permission-choice:has(input:checked){background:#f0f5ff;border-color:#aac0ed;color:#305aaf}
.permission-choice:has(input:disabled){cursor:default;opacity:.7}
.permission-choice input{width:15px;height:15px;flex-shrink:0;accent-color:#3863df;margin:0}
.feishu-login{width:100%;margin:15px 0}
#accessPending{padding:32px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:1100px){.team-config-fields{grid-template-columns:1fr;gap:16px}.team-list-tools{flex-wrap:wrap}.team-search{width:220px}.team-permission-choices{grid-template-columns:1fr 1fr}}
@media(max-width:640px){
 #usersPanel>.list-header{padding:16px 14px 12px}#usersPanel>.list-header .muted{display:none}
 .team-tabs{padding:0 10px 12px;gap:2px}.team-tabs button{padding:9px 8px;font-size:12px;gap:5px}.team-tabs svg{width:16px;height:16px}
 .team-section{padding:16px 14px}.team-list-tools{padding:16px 14px;gap:12px}.team-list-tools>div:first-child{flex-basis:100%}.team-search{flex:1;min-width:0;width:auto}
 .team-admin-help{display:block;padding:10px 12px}.team-admin-help .text-button{display:block;padding-left:0;margin-top:5px}
 .team-member,.department-row{grid-template-columns:minmax(0,1fr) auto;padding:12px 14px;gap:8px 12px}.department-row{padding:12px 0}
 .team-member>div:first-child{grid-column:1/-1}.team-department-access{gap:8px}.team-member>button{grid-column:2}
 #usersPanel .user-form{grid-template-columns:1fr;margin:0 14px 14px;padding:14px}
 .team-section-heading{flex-wrap:wrap;gap:10px}.team-section-heading p{font-size:11px}.team-section-heading>.team-pill{margin-left:52px}
 .team-config-card{padding:14px}.team-config-fields{gap:16px}.team-inline-field{flex-wrap:wrap}.team-inline-field input{flex-basis:100%}.team-inline-field button{height:34px;padding:7px 10px}
 .team-login-setting{padding:13px 14px}.team-toolbar{gap:8px}.team-toolbar button{padding:10px;font-size:11px}
 .team-grant-dialog .dialog-header,.team-grant-dialog .dialog-footer{padding:15px 16px}.team-grant-dialog .action-body{padding:16px}
 .team-grant-fields{grid-template-columns:1fr;gap:12px}.team-permission-choices{grid-template-columns:1fr 1fr;gap:6px}.permission-choice{font-size:11px;padding:9px 7px}
}
