/* Shared layout fixes keep controls within their own grid cells at every size. */
html[data-design=enterprise] :is(.management-filters,#employee-filter .employee-primary-filter,#employee-filter .employee-extra-fields,#report-filter,#transaction-filter,#payroll-daily-filter){display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:16px;align-items:start}
html[data-design=enterprise] :is(.management-filters,#employee-filter,#report-filter,#transaction-filter,#payroll-daily-filter) label{display:flex;flex-direction:column;gap:7px;min-width:0!important;width:auto;max-width:100%;margin:0;font-weight:600;line-height:1.4}
html[data-design=enterprise] :is(.management-filters,#employee-filter,#report-filter,#transaction-filter,#payroll-daily-filter) :is(input,select,.employee-multi-picker){box-sizing:border-box;min-width:0!important;width:100%;max-width:100%}
html[data-design=enterprise] :is(.management-filters,#employee-filter,#report-filter,#transaction-filter,#payroll-daily-filter) input[hidden],html[data-design=enterprise] select[hidden]{display:none!important}
.employee-multi-picker{position:relative;border:1px solid var(--line,#ccd8e5);border-radius:7px;background:var(--surface,#fff);padding:10px;color:var(--ink,#193961);font-weight:400;min-width:0}
.employee-multi-picker summary{cursor:pointer;list-style:none;font-size:12px;white-space:normal;overflow-wrap:anywhere}
.employee-multi-picker[open] .picker-body{position:absolute;top:100%;left:0;min-width:min(300px,80vw);width:100%;max-width:80vw;background:var(--surface,#fff);box-shadow:0 10px 30px #10274933;border:1px solid var(--line,#ccd8e5);z-index:40;padding:12px;border-radius:8px}
.picker-list{max-height:240px;overflow:auto}.picker-list label{display:flex!important;flex-direction:row!important;gap:7px!important;align-items:center;margin:7px 0!important;font-weight:400!important}.picker-list input[type=checkbox]{width:16px!important;min-width:16px!important}.picker-tools{display:flex;gap:5px;margin:8px 0}.picker-tools button{font-size:11px;padding:6px 8px}
.department-layout{display:grid;grid-template-columns:250px minmax(0,1fr);gap:20px}.department-tree{padding:16px;border:1px solid var(--line);border-radius:8px;align-self:start}.department-tree details>details{margin-left:14px}.department-tree summary{display:flex;align-items:center;gap:8px;list-style:none;cursor:pointer}.department-tree summary::-webkit-details-marker{display:none}.department-tree summary:before{content:'+'!important;display:inline-grid;place-items:center;flex:0 0 20px;width:20px;height:20px;border:1px solid var(--line);border-radius:4px;color:var(--ink)}.department-tree details[open]>summary:before{content:'−'!important}.department-main{min-width:0}
html[data-design=enterprise] #nav .group-chevron{font-size:0!important}html[data-design=enterprise] #nav .group-chevron:after{content:'+';font-size:16px}html[data-design=enterprise] #nav details[open]>summary .group-chevron:after{content:'−'}
html[data-design=enterprise] #content :is(.employee-action-cell,td:last-child){white-space:nowrap}html[data-design=enterprise] .employee-action-cell button{display:inline-flex;margin-right:5px}
html[data-design=enterprise] .leave-month-grid>button{background:var(--surface,#fff)!important;color:var(--ink)!important;border:1px solid var(--line)!important}html[data-design=enterprise] .leave-month-grid>button.leave-day{background:#f0e8fa!important;color:#59378b!important}html[data-design=enterprise] .leave-month-grid>button.selected{outline:2px solid #9d78bf!important}html[data-design=enterprise] .leave-month-grid>button.holiday-day{background:#fff2d9!important;color:#805a13!important}html[data-design=enterprise] .leave-month-grid>button.off-day{background:#edf1ef!important;color:#405d4a!important}
html[data-font-size=large] :is(#content,#dialog,#ess-app){font-size:16px}html[data-font-size=large] :is(#content,#dialog,#ess-app) :is(input,select,textarea,button,td,th,summary,label){font-size:15px!important}html[data-font-size=large] #nav :is(button,.nav-label){font-size:15px!important}
.portal-loading{margin:15vh auto;max-width:500px;padding:35px;background:var(--surface,#fff);border:1px solid var(--line,#ddd);border-radius:14px;color:var(--ink,#193961);text-align:center}
@media(max-width:760px){.department-layout{grid-template-columns:1fr}.department-tree{max-height:280px;overflow:auto}}
@media print{.employee-multi-picker,.portal-loading{display:none!important}}
.login-slide-editor{padding:14px;margin:14px 0;border:1px solid var(--line);border-radius:8px;display:grid;gap:12px}.login-slide-editor img{width:180px;aspect-ratio:4/3;object-fit:cover;border-radius:7px}
html[data-design=enterprise] :is(.employee-search,.employee-extra-filter,.board-filter-panel,#board-devices)>summary:before{content:"+";display:inline-block;margin-right:9px;font-weight:700}html[data-design=enterprise] :is(.employee-search,.employee-extra-filter,.board-filter-panel,#board-devices)[open]>summary:before{content:"−"}
html[data-design=enterprise] #nav .nav-chevron{font-size:0!important;transform:none!important}html[data-design=enterprise] #nav .nav-chevron:after{content:'+';font-size:16px}html[data-design=enterprise] #nav details[open]>summary .nav-chevron:after{content:'−'}
html[data-design=enterprise] .login-shell .login-slide-image{object-fit:contain!important;background:#123453}
html[data-design=enterprise] .login-shell .login-panel input{min-height:52px;font-size:16px;padding:12px 15px;border-radius:9px}
html[data-design=enterprise] .login-shell .login-panel button[type=submit],html[data-design=enterprise] .login-shell .login-panel form>button:not([type]){min-height:52px;font-size:18px;background:linear-gradient(100deg,#058dcc,#2464b4);border-radius:9px}
html[data-design=enterprise] .login-shell .login-panel .login-password-toggle{background:transparent;min-height:36px;border:0;color:#486588;right:9px;top:15px}
html[data-design=enterprise] #content .employee-inline-actions{display:flex;flex-wrap:nowrap;gap:5px;align-items:center}html[data-design=enterprise] #content .employee-inline-actions button{white-space:nowrap;margin:0}
html[data-design=enterprise] #content .employee-actions-sticky{position:sticky;right:0;background:var(--surface);z-index:2;box-shadow:-5px 0 7px #1027430b}html[data-design=enterprise] #content th.employee-actions-sticky{background:var(--tint);z-index:3}
html[data-design=enterprise] :is(.employee-search,.employee-extra-filter,.board-filter-panel,#board-devices)>summary{list-style:none}html[data-design=enterprise] :is(.employee-search,.employee-extra-filter,.board-filter-panel,#board-devices)>summary::-webkit-details-marker{display:none}
html[data-design=enterprise] #workspace #content :is(td,th).employee-actions-sticky{background:var(--surface)!important}html[data-design=enterprise] #workspace #content th.employee-actions-sticky{background:var(--tint)!important}
html[data-design=enterprise] .login-shell .login-panel input{min-height:52px!important;font-size:16px!important;padding:12px 15px!important;border-radius:9px!important}
html[data-design=enterprise] .login-shell .login-panel button[type=submit],html[data-design=enterprise] .login-shell .login-panel form>button:not([type]){min-height:52px!important;font-size:18px!important;border-radius:9px!important}
html[data-design=enterprise] .login-shell .login-panel .login-password-toggle{background:transparent!important;border:0!important;color:#486588!important;min-height:36px!important}

/* Consistent filter rows: scope first, sorting and search last. */
html[data-design=enterprise] #content .aligned-filters{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:16px!important;align-items:end!important}
html[data-design=enterprise] #content .aligned-filters :is(.employee-primary-filter,.employee-extra-filter,.filter-end-row){grid-column:1/-1;width:100%;min-width:0}
html[data-design=enterprise] #content .aligned-filters :is(.employee-primary-filter,.employee-extra-fields){display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:16px!important;align-items:end!important}
html[data-design=enterprise] #content .aligned-filters .filter-end-row{display:flex;flex-wrap:wrap;align-items:end;justify-content:flex-end;gap:12px}
html[data-design=enterprise] #content .aligned-filters label:not(.picker-body label){display:flex;flex-direction:column;gap:7px;min-width:0!important;line-height:1.4;margin:0}
html[data-design=enterprise] #content .aligned-filters .filter-end-row>label{flex:1 1 140px}
html[data-design=enterprise] #content .aligned-filters .filter-end-row>.filter-search-field{flex:2 1 220px}
html[data-design=enterprise] #content .aligned-filters :is(input:not([type=hidden]):not([type=checkbox]),select,.employee-multi-picker){box-sizing:border-box;width:100%!important;max-width:100%;min-width:0!important;min-height:40px;margin:0}
html[data-design=enterprise] #content .aligned-filters .employee-multi-picker>summary{min-height:18px;line-height:18px}
html[data-design=enterprise] #content .aligned-filters .filter-end-row>button{min-height:40px;margin:0;white-space:nowrap;flex:0 0 auto}
html[data-design=enterprise] #content .aligned-filters .picker-list input[type=checkbox]{width:16px!important;min-width:16px!important;min-height:16px}
@media(max-width:1050px){html[data-design=enterprise] #content .aligned-filters,html[data-design=enterprise] #content .aligned-filters :is(.employee-primary-filter,.employee-extra-fields){grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:600px){html[data-design=enterprise] #content .aligned-filters,html[data-design=enterprise] #content .aligned-filters :is(.employee-primary-filter,.employee-extra-fields){grid-template-columns:minmax(0,1fr)!important}html[data-design=enterprise] #content .aligned-filters .filter-end-row>label{flex-basis:100%}}
