:root{--identity-green:#158269;--identity-ink:#143d35;--identity-muted:#6b827b;--identity-line:#d6e7df}
.identity-shell{margin:0;background:#f1f7f4;color:var(--identity-ink);font:14px/1.65 system-ui,"Microsoft YaHei",sans-serif}
.identity-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 28px;background:white;border-bottom:1px solid var(--identity-line)}
.identity-header h1{font-size:21px;margin:0}.identity-header p{color:var(--identity-muted);margin:3px 0 0}
.identity-shell main{max-width:1200px;margin:24px auto;padding:0 20px}.identity-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.identity-card{padding:24px;background:#fff;border:1px solid var(--identity-line);border-radius:16px;margin-bottom:20px}
.identity-card h2{font-size:17px;margin:0 0 16px}.identity-shell label{display:block;margin:10px 0}.identity-shell input:not([type=checkbox]),.identity-shell select{box-sizing:border-box;width:100%;padding:10px 12px;border:1px solid var(--identity-line);border-radius:9px;font:inherit;background:white;color:inherit}
.identity-shell input:focus-visible,.identity-shell select:focus-visible,.identity-shell button:focus-visible{outline:3px solid #75bda5;outline-offset:2px}
.identity-shell button,.identity-shell .identity-button{display:inline-block;background:var(--identity-green);color:#fff;border:0;border-radius:9px;padding:10px 15px;font:inherit;cursor:pointer;text-decoration:none}
.identity-shell button.secondary{background:#eef6f1;color:var(--identity-ink);border:1px solid var(--identity-line)}
.identity-shell button:disabled{opacity:.55;cursor:wait}.identity-shell a{color:var(--identity-green)}
.identity-note{color:var(--identity-muted);font-size:13px}.identity-notice{border-radius:10px;background:#e5f4eb;padding:12px;margin-bottom:16px}.identity-notice.error{background:#fff0e9;color:#924620}
.identity-table-wrap{overflow-x:auto}.identity-shell table{border-collapse:collapse;width:100%}.identity-shell th,.identity-shell td{text-align:left;padding:12px 10px;border-bottom:1px solid var(--identity-line);vertical-align:top}
.identity-permissions{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.identity-permissions fieldset{border:1px solid var(--identity-line);border-radius:10px}.identity-permissions label{font-size:13px;margin:5px}.identity-dialog{width:min(950px,90vw);max-height:85vh;overflow:auto;border:1px solid var(--identity-line);border-radius:16px;color:var(--identity-ink);padding:24px}.identity-dialog::backdrop{background:#0e302966}
.identity-center{min-height:90vh;display:grid;place-items:center}.identity-loading{width:min(380px,calc(100vw - 70px));text-align:center;background:white;border:1px solid var(--identity-line);border-radius:24px;padding:36px 26px;box-shadow:0 20px 60px #1d775211}
.identity-ring{margin:0 auto 24px;width:62px;height:62px;border:5px solid #d9eee4;border-top-color:var(--identity-green);border-radius:50%;animation:identity-turn 1.2s linear infinite;position:relative}.identity-ring::after{content:"";position:absolute;inset:-14px;border-radius:50%;border:1px solid #b0dcc9;animation:identity-breathe 2s ease-in-out infinite}
.identity-success .identity-ring{animation:none;border-color:var(--identity-green)}.identity-success .identity-ring::after{content:"✓";animation:none;inset:0;border:0;font-size:36px;line-height:62px;color:var(--identity-green)}
@keyframes identity-turn{to{transform:rotate(360deg)}}@keyframes identity-breathe{50%{opacity:.25;transform:scale(1.08)}}
@media(max-width:750px){.identity-grid,.identity-permissions{grid-template-columns:1fr}.identity-header{padding:16px;align-items:flex-start}.identity-card{padding:18px}.identity-shell main{padding:0 12px}}
@media(prefers-reduced-motion:reduce){.identity-ring,.identity-ring::after{animation:none}}
.identity-shell main:has(.employee-layout){max-width:1440px}
.employee-layout{display:grid;grid-template-columns:250px minmax(0,1fr);gap:18px;align-items:start}
.employee-organization{padding:18px;position:sticky;top:18px}.employee-results{padding:0;overflow:hidden}
.employee-toolbar{display:flex;gap:12px;align-items:center;padding:18px;border-bottom:1px solid var(--identity-line);background:#fbfdfc}
.employee-toolbar input{flex:1;min-width:120px}.employee-toolbar select{max-width:180px}.employee-toolbar button{white-space:nowrap}
.employee-person{display:flex;gap:10px;align-items:center;min-width:130px}.employee-avatar{display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:#e6f3ed;color:#158269;flex:none;font-weight:700}
.employee-results td{vertical-align:middle;padding:16px 14px}.employee-results th{background:#f6faf8}.employee-results small{display:block;color:var(--identity-muted);margin-top:4px}
.employee-badge{display:inline-block;font-size:12px;padding:3px 8px;border-radius:6px;white-space:nowrap}.employee-badge.authorized{background:#e5f4eb;color:#176e53}.employee-badge.pending{background:#fff4df;color:#876025}.employee-badge.disabled{background:#fff0e9;color:#a14429}.employee-badge.neutral{background:#f1f5f3;color:#526b60}
.employee-organization #departmentTree{margin-top:16px;max-height:60vh;overflow:auto}.identity-shell button.department-item{display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;background:none;color:var(--identity-ink);border-radius:7px;padding:9px 12px;text-align:left;margin:3px 0;font-size:13px}.identity-shell button.department-item.selected{background:#e5f4eb;color:#176e53}.department-item small{border-radius:10px;background:#edf5f0;padding:1px 7px;font-size:11px}
.employee-settings summary{cursor:pointer;font-weight:600}.employee-settings[open]>summary{margin-bottom:18px}.employee-results #employeeCount{padding:0 18px}.employee-empty{text-align:center;padding:40px!important}
@media(max-width:850px){.employee-layout{grid-template-columns:1fr}.employee-organization{position:static}.employee-toolbar{flex-wrap:wrap}.employee-results table{min-width:760px}.employee-organization #departmentTree{max-height:240px}}

.identity-embedded .identity-header{display:none}.identity-shell.identity-embedded{background:transparent}.identity-shell.identity-embedded main{max-width:none;margin:0;padding:0}

.identity-shell [hidden]{display:none!important}.role-toolbar{display:flex;align-items:center;gap:12px;margin-bottom:20px}.role-toolbar input{max-width:360px}.identity-shell .role-permissions{display:block}.permission-toolbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:12px;background:#f4f9f6;border:1px solid var(--identity-line);border-radius:10px 10px 0 0}.permission-toolbar label{display:flex;align-items:center;gap:6px;margin:0}.permission-tree{border:1px solid var(--identity-line);border-top:0;border-radius:0 0 10px 10px;padding:12px;max-height:48vh;overflow:auto}.permission-module{margin:4px 0}.permission-module summary{cursor:pointer;padding:7px;border-radius:6px}.permission-module summary:hover{background:#eef6f1}.permission-module summary input{margin-right:8px}.permission-children{margin-left:32px;border-left:1px solid var(--identity-line);padding:0 14px}.permission-children>div{display:flex;gap:24px}.identity-shell input[type=checkbox]{accent-color:var(--identity-green)}.identity-dialog:has(.role-permissions){width:min(680px,90vw)}.identity-dialog .identity-permissions{display:block}@media(max-width:600px){.role-toolbar{flex-wrap:wrap}.role-toolbar input{max-width:none}.permission-toolbar{gap:8px}.identity-dialog{padding:16px}}

.identity-dialog{box-sizing:border-box;max-height:90vh}.identity-dialog .permission-tree{max-height:36vh}

.identity-dialog[open]{display:flex;flex-direction:column;height:min(850px,90vh);overflow:hidden}.identity-dialog h2{flex:none;margin:0 0 12px}.identity-dialog #editorForm{display:flex;flex-direction:column;flex:1;min-height:0}.identity-dialog #editorFields{flex:none;max-height:35vh;overflow:auto}.identity-dialog #permissions{display:flex;flex-direction:column;flex:1;min-height:0;margin-top:10px}.identity-dialog #permissions:empty{flex:0}.identity-dialog .permission-toolbar{flex:none}.identity-dialog .permission-tree{flex:1;min-height:0;max-height:none}.identity-dialog #editorForm>p:last-child{flex:none;margin:12px 0 0;padding-top:12px;border-top:1px solid var(--identity-line)}.identity-dialog #editorError:empty{display:none}

.catalog-notes{padding-left:22px;line-height:1.9;color:var(--identity-muted);margin:12px 0 24px}.route-path{overflow-wrap:anywhere}.role-assignment label{display:flex;align-items:center;gap:10px;border:1px solid var(--identity-line);border-radius:9px;padding:10px}.role-assignment small{color:var(--identity-muted)}.identity-dialog:has(.role-assignment){height:auto;max-height:85vh}.identity-dialog:has(.role-assignment) #editorFields{max-height:55vh}

.department-controls{display:flex;gap:6px;margin-top:10px}.department-controls button{font-size:11px;padding:6px 8px}.department-row{display:flex;align-items:center;min-width:0}.identity-shell button.department-toggle{padding:0;width:23px;min-width:23px;height:30px;background:transparent;color:#426753;font-size:16px}.department-toggle:focus-visible{outline:2px solid #18815f}.department-spacer{width:23px;flex-shrink:0}.department-row .department-item{min-width:0;flex:1}.department-row .department-item>span{overflow-wrap:anywhere}

.permission-menu-parent>.permission-children{padding-left:14px}.permission-menu-parent .permission-submenu{margin:6px 0;border-left:1px solid #dce8e0}.permission-submenu>summary{font-size:12px}.permission-menu-note{font-size:11px;line-height:1.7;color:#6a8073;margin:5px 0 10px;max-width:100%}

/* Keep role and route tables readable instead of compressing labels vertically. */
#roleManagement .identity-table-wrap>table{min-width:760px}
#accessCatalog .identity-table-wrap>table{min-width:960px}
.identity-table-wrap th,.identity-table-wrap button{white-space:nowrap}
#roleManagement td:first-child{min-width:130px}
#roleManagement td:nth-child(n+3){white-space:nowrap}
