/* Presentation only: preserves form IDs, authority and existing action handlers. */
#directory-app .people-filters{align-items:end;gap:10px;display:flex;flex-wrap:wrap}
.people-filters label{display:grid;gap:5px;font-size:12px;font-weight:700;min-width:130px;flex:1}
.people-filters label:first-child{flex:2;min-width:240px}
.people-filters input,.people-filters select{width:100%;min-width:0!important;font:inherit}
#directory-app .person-list-table{min-width:850px}
#directory-app .person-list-table td{padding:8px 9px}
#directory-app .person-summary strong{font-size:14px;line-height:1.4}
#directory-app .person-summary small{font-size:12px;line-height:1.4}
#directory-app .person-incomplete{color:#966318}
#directory-app .person-list-table th:nth-child(1){width:23%!important}
#directory-app .person-list-table th:nth-child(2){width:6%!important}
#directory-app .person-list-table th:nth-child(3){width:8%!important}
#directory-app .person-list-table th:nth-child(4){width:15%!important}
#directory-app .person-list-table th:nth-child(5){width:12%!important}
#directory-app .person-list-table th:nth-child(6){width:15%!important}
#directory-app .person-list-table th:nth-child(7){width:21%!important}
#directory-app .person-list-table td:last-child{white-space:normal}
#directory-app>header>div{margin-left:0!important;flex:1;text-align:left}
#directory-app .person-list-table td:last-child>button{display:inline-block;margin:2px}
.person-security{display:inline-block;margin:2px;vertical-align:middle;position:relative}
.person-security>summary{cursor:pointer;font-size:12px;color:#536e82;padding:6px;list-style:none}
.person-security>summary::after{content:' ▾'}
.person-security[open] .password-reset{display:block}
#user-form{padding:0;display:flex;flex-direction:column;overflow:hidden;max-height:90vh}
#user-form .modal-head{padding:20px 24px 12px;margin:0;flex-shrink:0}
.user-form-scroll{overflow:auto;padding:0 24px 16px;min-height:0}
.user-section-title{grid-column:1/-1;margin:16px 0 0;padding-top:12px;border-top:1px solid #dbe8f2;font-size:14px;color:#174965}
.user-section-title:first-child{border:0;margin-top:0;padding-top:0}
#user-form .user-form-footer{margin:0;padding:12px 24px;border-top:1px solid #dbe8f2;background:#fafdff;flex-shrink:0}
#user-form #close-modal{color:#536e82!important;background:#edf2f5!important}
@media(max-width:650px){.people-filters label{min-width:calc(50% - 10px)}.people-filters label:first-child{min-width:100%!important}#user-form .modal-head,.user-form-scroll,#user-form .user-form-footer{padding-left:16px;padding-right:16px}}
#user-form[aria-busy="true"] .fields label:has(input:disabled)::after,#user-form[aria-busy="true"] .fields label:has(select:disabled)::after{content:none}
/* Retain every original field/action; compact only the existing narrow reflow. */
@media screen{
  #directory-app .person-list-table.oa-table-stacked tbody{gap:10px}
  #directory-app .person-list-table.oa-table-stacked tbody tr{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 12px;padding:10px;border-radius:10px}
  #directory-app .person-list-table.oa-table-stacked tbody td:first-child,
  #directory-app .person-list-table.oa-table-stacked tbody td:nth-child(6),
  #directory-app .person-list-table.oa-table-stacked tbody td:last-child{grid-column:1/-1}
  #directory-app .person-list-table.oa-table-stacked td[data-oa-column]::before{margin-bottom:3px}
  #directory-app .person-list-table.oa-table-stacked tbody td:last-child{border-top:1px solid #d9e6ed!important;padding-top:8px!important}
}

/* Department-first maintenance. Legacy columns remain accessible on demand. */
#directory-app:not(.show-legacy-columns):not(.staff-roster-view) .person-list-table th:nth-child(2),
#directory-app:not(.show-legacy-columns):not(.staff-roster-view) .person-list-table th:nth-child(3),
#directory-app:not(.show-legacy-columns):not(.staff-roster-view) .person-list-table td:nth-child(2),
#directory-app:not(.show-legacy-columns):not(.staff-roster-view) .person-list-table td:nth-child(3){display:none!important}
.person-legacy{grid-column:1/-1;border:1px solid #dbe8f2;padding:10px;border-radius:8px}
.person-legacy summary{font-weight:700;cursor:pointer}.person-legacy p,.person-assign-note{font-size:12px;color:#536e82}
.person-assign-note{grid-column:1/-1;margin:4px 0}
#person-edit-preview td{white-space:normal;overflow-wrap:anywhere}#person-edit-preview table{min-width:0;width:100%}
#person-preview-notes{font-size:12px;line-height:1.7;color:#536e82}
#directory-app .person-list-table{min-width:650px}
@media(max-width:650px){#person-edit-preview th,#person-edit-preview td{padding:7px 5px;font-size:12px}.person-legacy .fields{grid-template-columns:1fr}}

.person-legacy-toggle{display:flex;align-items:center;gap:6px;font-size:12px;color:#536e82;margin:8px 0}.person-legacy-toggle input{width:18px;height:18px;margin:0}

#user-form .user-form-footer #person-back-edit.hidden{display:none!important}

/* Two visible buckets and two-line identity; no truncation of real names. */
.people-category-buttons{display:flex;gap:8px;margin:12px 0 4px}.people-category-buttons button{min-width:100px}.people-category-buttons button[aria-pressed="true"]{--oa-drop-tint:128,190,220!important;--oa-drop-ink:#174965!important;outline:2px solid #80b2cd;outline-offset:1px}.people-category-note{font-size:12px;color:#536e82;margin:6px 0 10px}.people-type-legacy{display:none!important}
#directory-app .person-list-table:not(.oa-table-stacked) tbody td{padding:4px 9px!important;line-height:1.3!important;vertical-align:middle}
#directory-app .person-name-line,#directory-app .person-code-line{display:flex;align-items:baseline;flex-wrap:wrap;gap:3px 8px;line-height:1.3}
#directory-app .person-name-line strong{font-size:14px;line-height:1.3;margin:0}
#directory-app .person-title{font-size:12px;color:#536e82;line-height:1.3}
#directory-app .person-code-line small{display:inline-block!important;font-size:11px;line-height:1.3;margin:0}
#directory-app .person-list-table:not(.oa-table-stacked) td:last-child>button{padding:4px 8px!important;min-height:28px!important;margin:1px!important;font-size:12px!important}
#directory-app .person-security{margin:0 2px!important}#directory-app .person-security>summary{padding:3px 5px;font-size:11px}
#directory-app .person-list-table.oa-table-stacked tbody tr{gap:4px 10px;padding:8px}

.department-duty-policy .person-list-table tr>:nth-child(2),.department-duty-policy .person-list-table tr>:nth-child(3){display:none!important}
.department-duty-policy #legacy-personnel{display:none!important}
#duty-permissions label{display:flex;align-items:center;gap:8px}#duty-permissions input{width:18px;height:18px}

.department-duty-policy [hidden]{display:none!important}

.person-change-impact{background:#eff7fc;border:1px solid #c7dce9;border-radius:12px;padding:12px;margin:12px 0}.person-change-impact p{margin:6px 0}.person-incomplete{white-space:normal}

/* HR employee roster: one field per column, separate from account administration. */
#directory-app.staff-roster-view .person-list-table{min-width:1080px;table-layout:auto}
#directory-app.staff-roster-view .person-list-table:not(.oa-table-stacked) tr>th,
#directory-app.staff-roster-view .person-list-table:not(.oa-table-stacked) tr>td{display:table-cell!important;width:auto!important;text-align:left;vertical-align:middle;white-space:nowrap;padding:9px 12px!important}
#directory-app.staff-roster-view .person-list-table:not(.oa-table-stacked) th:nth-child(2){min-width:215px}
#directory-app.staff-roster-view .person-list-table:not(.oa-table-stacked) td:nth-child(2){white-space:normal;min-width:215px;max-width:300px}
#directory-app.staff-roster-view .staff-alternate-name{display:block;font-size:12px;color:#64788b;margin-top:3px;font-weight:400}
#directory-app.staff-roster-view .person-list-table tbody tr:nth-child(even){background:#f7f9fc}
#people-migration-summary{font-size:13px;color:#536e82;margin:12px 0}
#people-migration-summary>summary{cursor:pointer}
#people-migration-summary table{min-width:0!important;width:100%;margin-top:10px}

.staff-directory-layout{display:grid;grid-template-columns:245px minmax(0,1fr);gap:10px;align-items:start}
#staff-department-tree{border:1px solid #c8d4df;background:#f6f8fb;padding:10px;position:sticky;top:5px;font-size:13px}
.department-tree-tools{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #d5dfe8;margin:8px 0;padding-bottom:7px}
.department-tree-tools label,.department-tree-items label{display:flex;align-items:center;gap:6px}
.department-tree-items{max-height:540px;overflow:auto}
.department-tree-items label{padding:6px 3px;margin:0;border-bottom:1px solid #e4eaf0;cursor:pointer}
.department-tree-items label:has(input:checked){background:#e6f0fa}
.department-tree-items span{flex:1;overflow-wrap:anywhere}
.department-tree-items input,.department-tree-tools input{width:16px;height:16px;flex-shrink:0}
.department-tree-items small{font-variant-numeric:tabular-nums;color:#526d80}
#directory-app:not(.staff-roster-view) .staff-directory-layout{display:block}
#directory-app.staff-roster-view .people-filters label[hidden]{display:none!important}
@media(max-width:700px){.staff-directory-layout{grid-template-columns:1fr}#staff-department-tree{position:static}.department-tree-items{max-height:180px}}

.department-tree-items details{border-bottom:1px solid #cbd7e3}
.department-tree-items summary{display:flex;align-items:center;gap:5px;padding:7px 2px;cursor:pointer;font-weight:600}
.department-tree-items summary::before{content:'▸';font-size:10px}.department-tree-items details[open]>summary::before{content:'▾'}
.department-tree-children{padding-left:18px}.department-tree-items summary input{width:16px;height:16px}

/* Keep the legacy grid as a horizontally scrollable table beside the tree. */
#directory-app.staff-roster-view .staff-directory-layout>.table-wrap{min-width:0;overflow:auto;max-width:100%}
#directory-app.staff-roster-view .person-list-table{display:table!important;min-width:1080px!important;width:1080px!important;table-layout:auto!important}
#directory-app.staff-roster-view .person-list-table thead{display:table-header-group!important}
#directory-app.staff-roster-view .person-list-table tbody{display:table-row-group!important}
#directory-app.staff-roster-view .person-list-table tr{display:table-row!important;padding:0!important}
#directory-app.staff-roster-view .person-list-table tr>th,
#directory-app.staff-roster-view .person-list-table tr>td{display:table-cell!important;white-space:nowrap!important;word-break:normal!important;overflow-wrap:normal!important;width:auto!important;min-width:0!important;max-width:none!important;padding:8px 10px!important;border-radius:0!important}
#directory-app.staff-roster-view .person-list-table td::before{display:none!important}
#directory-app.staff-roster-view .person-list-table td:nth-child(2){min-width:210px!important}

@media(min-width:701px){
 #directory-app.staff-roster-view .staff-directory-layout>.table-wrap{height:560px;min-height:360px;max-height:calc(100dvh - 120px);overflow:auto}
 #directory-app.staff-roster-view .department-tree-items{height:480px;max-height:calc(100dvh - 200px);min-height:280px;overflow:auto}
}

/* Full legacy employee columns retain literal identifiers and horizontal scrolling. */
#directory-app.staff-roster-view .person-list-table{width:max-content!important;min-width:1080px!important}
#directory-app.staff-roster-view .person-list-table td,#directory-app.staff-roster-view .person-list-table th{min-width:105px;max-width:420px}

/* Freeze employee identity columns and field headings within the roster scroller. */
@media screen {
 #directory-app.staff-roster-view .person-list-table{border-collapse:separate!important;border-spacing:0;--staff-code-width:130px;--staff-name-width:230px}
 #directory-app.staff-roster-view .person-list-table thead th{position:sticky!important;top:0;z-index:4;background:#edf3f8!important}
 #directory-app.staff-roster-view .person-list-table tr>:nth-child(1),
 #directory-app.staff-roster-view .person-list-table tr>:nth-child(2){position:sticky!important;box-sizing:border-box;z-index:2;background:#fff!important}
 #directory-app.staff-roster-view .person-list-table tr>:nth-child(1){left:0;overflow:hidden;text-overflow:ellipsis;width:var(--staff-code-width)!important;min-width:var(--staff-code-width)!important;max-width:var(--staff-code-width)!important}
 #directory-app.staff-roster-view .person-list-table tr>:nth-child(2){left:var(--staff-code-width);width:var(--staff-name-width)!important;min-width:var(--staff-name-width)!important;max-width:var(--staff-name-width)!important;overflow:hidden;text-overflow:ellipsis;box-shadow:3px 0 0 #d3dee7}
 #directory-app.staff-roster-view .person-list-table tbody tr:nth-child(even)>:nth-child(-n+2){background:#f7f9fc!important}
 #directory-app.staff-roster-view .person-list-table thead tr>:nth-child(-n+2){z-index:6;background:#edf3f8!important}
}
@media screen and (max-width:700px){
 #directory-app.staff-roster-view .person-list-table{--staff-code-width:90px;--staff-name-width:120px}
 #directory-app.staff-roster-view .staff-directory-layout>.table-wrap{max-height:65dvh;overflow:auto}
}

#directory-app .staff-source-checkbox{width:16px;height:16px;opacity:1;accent-color:#397ba5;vertical-align:middle;cursor:default}

/* Preserve mixed rendering across DOM replacement or shared decoration. */
#directory-app .staff-source-checkbox[data-source-state="mixed"]{appearance:none;-webkit-appearance:none;box-sizing:border-box;border:1px solid #8295a4;border-radius:2px;padding:3px;background:#63798b;background-clip:content-box}

/* Keep unknown distinct from an unchecked flag under shared disabled controls. */
#directory-app input.staff-source-checkbox[data-source-state="mixed"]:disabled{appearance:none!important;-webkit-appearance:none!important;padding:0!important;border:1px solid #8295a4!important;border-radius:2px!important;background:linear-gradient(#536b7e,#536b7e) center/8px 2px no-repeat #edf4f7!important;background-clip:border-box!important;box-shadow:none!important;opacity:1!important}

/* Dense employee worksheet, close to the legacy HR 9pt/12px grid.
   Scoped to screen staff roster; original report/print layouts are untouched. */
@media screen {
 #directory-app.staff-roster-view .person-list-table{font-size:12px!important;line-height:1.25!important;font-variant-numeric:tabular-nums}
 #directory-app.staff-roster-view .person-list-table:not(.oa-table-stacked) tr>th,
 #directory-app.staff-roster-view .person-list-table:not(.oa-table-stacked) tr>td{font-size:12px!important;line-height:1.25!important;padding:3px 6px!important;vertical-align:middle!important}
 #directory-app.staff-roster-view .person-list-table thead th{font-weight:600;height:25px}
 #directory-app.staff-roster-view .staff-alternate-name{display:inline;font-size:11px;line-height:1.25;margin:0 0 0 5px}
 #directory-app.staff-roster-view .staff-alternate-name::before{content:'/ ';color:#81909c}
 #directory-app.staff-roster-view .person-list-table a.edit{display:inline-flex;align-items:center;font-size:12px!important;line-height:1.2!important;min-height:22px!important;padding:2px 5px!important;margin:0 2px!important;border-radius:4px}
 #directory-app.staff-roster-view .staff-source-checkbox{width:14px;height:14px;min-height:0!important;margin:0;vertical-align:middle}
 #directory-app.staff-roster-view #staff-department-tree{font-size:12px;padding:7px}
 #directory-app.staff-roster-view .department-tree-items label{padding:3px 2px;line-height:1.25;min-height:23px}
 #directory-app.staff-roster-view .department-tree-items summary{padding:4px 2px;line-height:1.25}
 #directory-app.staff-roster-view .department-tree-items input{width:14px;height:14px;min-height:0!important}
 #directory-app.staff-roster-view .department-tree-tools{margin:5px 0;padding-bottom:5px}
 #directory-app.staff-roster-view .people-filters{gap:6px}
 #directory-app.staff-roster-view .people-filters label{gap:3px}
 #directory-app.staff-roster-view #people-count{font-size:12px;margin:6px 0}
}
@media screen and (min-width:701px){
 #directory-app.staff-roster-view .staff-directory-layout{grid-template-columns:220px minmax(0,1fr)}
 #directory-app.staff-roster-view .person-list-table{--staff-code-width:110px;--staff-name-width:190px}
}
@media screen and (max-width:700px){
 #directory-app.staff-roster-view .person-list-table a.edit{min-height:28px!important}
 #directory-app.staff-roster-view .person-list-table:not(.oa-table-stacked) tbody tr>td{padding-top:4px!important;padding-bottom:4px!important}
 #directory-app.staff-roster-view .department-tree-items label,#directory-app.staff-roster-view .department-tree-items summary{min-height:28px}
}

/* Keep the worksheet above the fold; secondary routes remain one disclosure away. */
#directory-app .directory-tools{align-self:center;min-width:0}
#directory-app .directory-tools>summary{cursor:pointer;padding:6px 8px;font-size:12px;color:#36566c;list-style-position:inside}
#directory-app .directory-tools[open]{flex-basis:100%;width:100%}
#directory-app .directory-tools nav{display:flex;flex-wrap:wrap;gap:5px;padding:7px 0}
#directory-app .directory-tools nav a{font-size:12px!important;min-height:28px!important;padding:4px 8px!important}
@media screen and (min-width:761px){
 #directory-app.staff-roster-view>.panel{padding:10px}
 #directory-app.staff-roster-view .panel-head{gap:6px;margin-bottom:7px}
 #directory-app.staff-roster-view .panel-head h2{font-size:16px}
 #directory-app.staff-roster-view .panel-head>a,#directory-app.staff-roster-view .panel-head>button{font-size:12px!important;min-height:28px!important;padding:4px 8px!important}
}
/* Desktop HR data density: 9pt grid with compact surrounding controls. */
@media screen and (min-width:761px){
 #directory-app.staff-roster-view .people-filters input,
 #directory-app.staff-roster-view .people-filters select,
 #directory-app.staff-roster-view .people-filters button,
 #directory-app.staff-roster-view .people-category-buttons button{font-size:12px!important;min-height:26px!important;height:26px;padding:3px 7px!important}
 #directory-app.staff-roster-view .people-category-buttons{margin:6px 0 3px;gap:5px}
 #directory-app.staff-roster-view .people-category-note{margin:3px 0 5px;font-size:11px}
 #directory-app.staff-roster-view .person-list-table:not(.oa-table-stacked) tr>td{padding:2px 5px!important;height:24px}
 #directory-app.staff-roster-view .person-list-table:not(.oa-table-stacked) td:last-child>button,
 #directory-app.staff-roster-view .person-list-table a.edit{font-size:12px!important;min-height:20px!important;padding:1px 4px!important;margin:0 1px!important}
 #directory-app.staff-roster-view .department-tree-items label,
 #directory-app.staff-roster-view .department-tree-items summary{min-height:22px;padding-top:2px;padding-bottom:2px}
 #directory-app.staff-roster-view .staff-directory-layout{grid-template-columns:205px minmax(0,1fr);gap:7px}
}

/* Bounded employee viewport. Fixed row/column geometry keeps frozen cells stable. */
@media screen {
 #directory-app.staff-roster-view .person-list-table.staff-virtual-grid{table-layout:fixed!important;width:var(--staff-grid-width)!important;min-width:var(--staff-grid-width)!important}
 #directory-app.staff-roster-view .person-list-table.staff-virtual-grid tbody tr:not(.staff-window-spacer){height:28px!important}
 #directory-app.staff-roster-view .person-list-table.staff-virtual-grid tr>td,
 #directory-app.staff-roster-view .person-list-table.staff-virtual-grid tr>th{box-sizing:border-box!important;width:120px!important;min-width:120px!important;max-width:120px!important;height:28px!important;padding:2px 5px!important;overflow:hidden!important;text-overflow:ellipsis}
 #directory-app.staff-roster-view .person-list-table.staff-virtual-grid tr>:nth-child(1){width:110px!important;min-width:110px!important;max-width:110px!important}
 #directory-app.staff-roster-view .person-list-table.staff-virtual-grid tr>:nth-child(2){left:110px!important;width:190px!important;min-width:190px!important;max-width:190px!important}
 #directory-app.staff-roster-view .person-list-table.staff-virtual-grid tr>:last-child{width:480px!important;min-width:480px!important;max-width:480px!important}
 #directory-app.staff-roster-view .person-list-table.staff-virtual-grid td:last-child button,
 #directory-app.staff-roster-view .person-list-table.staff-virtual-grid td:last-child a{box-sizing:border-box;height:22px!important;min-height:20px!important;max-height:22px!important;line-height:18px!important;padding:0 4px!important}
 #directory-app.staff-roster-view .person-list-table.staff-virtual-grid tr.staff-window-spacer{height:auto!important;pointer-events:none}
 #directory-app.staff-roster-view .person-list-table.staff-virtual-grid tr.staff-window-spacer>td{position:static!important;padding:0!important;border:0!important;box-shadow:none!important;min-height:0!important;line-height:0!important;font-size:0!important;background:transparent!important}
}

#directory-app .staff-page-buttons{display:flex;flex-wrap:wrap;gap:4px;align-items:center}
#directory-app .staff-page-buttons[hidden]{display:none}
#directory-app .staff-page-buttons button{min-width:30px;min-height:28px;padding:3px 7px;font-size:12px}
#directory-app .staff-page-buttons button[aria-current="page"]{background:#365e83;color:white;border-color:#365e83;opacity:1;font-weight:700}
