/* The named layer makes deliberate important visual overrides win over unlayered legacy CSS. */
@layer gentri-refinement {
/* MyGenTri shared interface. Screen geometry only; document/print output stays authored. */
@media screen {
  html[data-bims-theme] {
    --gt-surface:var(--bims-surface);--gt-canvas:var(--bims-canvas);
    --gt-line:color-mix(in srgb,var(--bims-border) 70%,var(--bims-surface));
    --gt-ink:var(--bims-text-strong);--gt-muted:var(--bims-muted);--gt-soft:var(--bims-surface-soft);
    --bims-system-radius-control:9px;--bims-system-radius-inset:12px;--bims-system-radius-card:16px;--bims-system-radius-shell:18px;
    --bims-system-shadow-card:0 3px 16px -6px var(--bims-shadow);--bims-system-line:var(--gt-line);--bims-system-line-strong:var(--bims-border-strong);
  }
  html[data-bims-theme] body:is(.bims-pro-shell,.public-service-body,.citizen-page,.city-government,.auth-page) {
    background:var(--gt-canvas)!important;background-image:none!important;color:var(--bims-text)!important;
    font-family:Inter,"Segoe UI Variable","Segoe UI",system-ui,-apple-system,sans-serif!important;
    font-size:14px!important;line-height:1.6!important;font-weight:400!important;letter-spacing:0!important;-webkit-font-smoothing:antialiased;
  }
  html[data-bims-theme] body :is(h1,h2,h3) {color:var(--gt-ink);letter-spacing:-.025em;line-height:1.3;white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important;min-width:0}
  html[data-bims-theme] body :is(h1,h2,h3) :is(.ico,.bpw-icon) {align-self:center}
  html[data-bims-theme] body.bims-admin-shell {--sidebar-width:260px!important;--bims-system-page-gutter:clamp(20px,2.2vw,36px)!important}
  html[data-bims-theme] body.bims-admin-shell .sidebar {padding:24px 14px!important;background:var(--gt-surface)!important;border-right:1px solid var(--gt-line)!important;color:var(--gt-ink)!important;box-shadow:none!important}
  html[data-bims-theme] body.bims-admin-shell .sidebar .brand {border:0!important;border-bottom:1px solid var(--gt-line)!important;border-radius:0!important;background:none!important;box-shadow:none!important;padding:0 8px 24px!important;margin:0 0 20px!important;gap:12px!important;min-height:0!important}
  html[data-bims-theme] body.bims-admin-shell .sidebar .brand-mark {width:44px!important;height:44px!important;min-width:44px!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important}
  html[data-bims-theme] body.bims-admin-shell .sidebar .brand strong {font-size:13px!important;font-weight:700!important;line-height:1.45!important;color:var(--gt-ink)!important;overflow-wrap:normal!important}
  html[data-bims-theme] body.bims-admin-shell .sidebar .brand .bpw-brand-copy>span {font-size:10px!important;line-height:1.5!important;font-weight:450!important;color:var(--gt-muted)!important;margin-top:4px}
  html[data-bims-theme] body.bims-admin-shell .sidebar .nav {gap:7px!important}
  html[data-bims-theme] body.bims-admin-shell .sidebar .nav details {border:0!important;border-radius:10px!important;background:transparent!important;box-shadow:none!important;overflow:hidden}
  html[data-bims-theme] body.bims-admin-shell .sidebar .nav summary {min-height:46px!important;padding:11px 12px!important;border:0!important;border-radius:10px!important;color:var(--gt-muted)!important;background:transparent!important;font-size:12px!important;font-weight:600!important;gap:12px!important;box-shadow:none!important}
  html[data-bims-theme] body.bims-admin-shell .sidebar .nav summary:hover {background:var(--gt-soft)!important;color:var(--gt-ink)!important}
  html[data-bims-theme] body.bims-admin-shell .sidebar .nav .active-group>summary {background:var(--bims-primary-soft)!important;color:var(--bims-primary)!important}
  html[data-bims-theme] body.bims-admin-shell .sidebar .nav :is(a.active,a.is-active) {background:var(--bims-primary-soft)!important;border-color:transparent!important;box-shadow:none!important;color:var(--bims-primary)!important}
  html[data-bims-theme] body.bims-admin-shell .sidebar .nav a {min-height:44px!important;padding:10px 12px!important;gap:10px!important;border:0!important;border-radius:9px!important;background:transparent!important;color:var(--gt-muted)!important;font-size:11px!important;font-weight:550!important;box-shadow:none!important}
  html[data-bims-theme] body.bims-admin-shell .sidebar .nav a:hover {background:var(--gt-soft)!important;color:var(--gt-ink)!important}
  html[data-bims-theme] body.bims-admin-shell .nav-step {border:0!important;background:var(--gt-soft)!important;color:var(--gt-muted)!important;border-radius:6px!important;min-width:23px!important;width:23px!important;height:23px!important;box-shadow:none!important;font-size:10px!important;font-weight:600!important}
  html[data-bims-theme] body.bims-admin-shell .nav :is(a.active,a.is-active) .nav-step {background:var(--bims-primary)!important;color:var(--bims-on-primary)!important}
  html[data-bims-theme] body.bims-admin-shell .topbar {min-height:82px!important;padding-top:16px!important;padding-bottom:16px!important;background:var(--gt-surface)!important;border-bottom:1px solid var(--gt-line)!important;box-shadow:none!important;backdrop-filter:none!important;gap:20px!important;margin-bottom:28px!important}
  html[data-bims-theme] body.bims-admin-shell .topbar-title h1 {font-size:20px!important;font-weight:720!important;line-height:1.35!important;gap:10px!important}
  html[data-bims-theme] body.bims-admin-shell .topbar-title>small {font-size:11px!important;font-weight:400!important;color:var(--gt-muted)!important;margin-top:3px!important}
  html[data-bims-theme] body.bims-admin-shell .topbar :is(.barangay-switcher,.barangay-scope-pill,.kld-nextly-profile) {border-color:var(--gt-line)!important;border-radius:10px!important;background:var(--gt-surface)!important;box-shadow:none!important}
  html[data-bims-theme] body.bims-admin-shell .main>:is(.card,section.card,.panel) {margin-bottom:22px!important}
  html[data-bims-theme] body :is(.card,.panel,.public-card,.module-card,.summary-card,.public-service-card,.stat-card,.kpi-card) {border-color:var(--gt-line)!important;background:var(--gt-surface)!important;border-radius:14px!important;box-shadow:0 3px 14px -8px #27325715!important}
  html[data-bims-theme] body :is(.card,.panel)::before {display:none!important}
  html[data-bims-theme] body.bims-admin-shell .main>.card {padding:24px!important}
  html[data-bims-theme] body.bims-admin-shell .main>.card>:is(h2,.section-title) {font-size:18px!important;font-weight:700!important;margin:0 0 20px!important;gap:10px!important}
  html[data-bims-theme] body :is(.module-grid,.cards-grid,.dashboard-grid) {gap:16px!important}
  html[data-bims-theme] body a.module-card {padding:20px!important;min-height:150px!important;gap:12px!important;transition:transform .16s,box-shadow .16s,border-color .16s}
  html[data-bims-theme] body a.module-card:hover {transform:translateY(-2px);border-color:color-mix(in srgb,var(--bims-primary) 35%,var(--gt-line))!important;box-shadow:0 8px 24px -12px #2c2b5650!important}
  html[data-bims-theme] body .module-card :is(h3,strong) {font-size:13px!important;font-weight:650!important;line-height:1.5!important;color:var(--gt-ink)!important}
  html[data-bims-theme] body .module-card :is(.card-meta,.module-meta,.module-counts,small) {font-size:11px!important;color:var(--gt-muted)!important;line-height:1.5!important}
  html[data-bims-theme] body :is(.btn,a.btn,button.btn,.button):not(.btn-link) {display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;min-height:44px!important;padding:10px 15px!important;border-radius:9px!important;font-family:inherit!important;font-size:12px!important;font-weight:600!important;line-height:1.5!important;letter-spacing:0!important;text-decoration:none!important;overflow-wrap:normal!important;word-break:normal!important;white-space:normal!important;box-shadow:none!important;flex-shrink:0}
  html[data-bims-theme] body :is(.btn-primary,.btn.primary,.btn.btn-primary) {background:var(--bims-primary)!important;background-image:none!important;border:1px solid var(--bims-primary)!important;color:var(--bims-on-primary)!important;box-shadow:0 3px 7px #38215f10!important}
  html[data-bims-theme] body :is(.btn-primary,.btn.primary,.btn.btn-primary):hover {background:var(--bims-primary-hover,var(--bims-primary-strong))!important}
  html[data-bims-theme] body :is(.btn-light,.btn.ghost,.btn-outline,.btn-secondary) {background:var(--gt-surface)!important;border:1px solid var(--gt-line)!important;color:var(--gt-ink)!important}
  html[data-bims-theme] body :is(.btn-light,.btn.ghost,.btn-outline,.btn-secondary):hover {background:var(--gt-soft)!important;border-color:var(--bims-border-strong)!important}
  html[data-bims-theme] body .btn-danger {background:#fff4f4!important;border-color:#f4cdcd!important;color:#b33c45!important}
  html[data-bims-theme] body :is(.ico,.bpw-icon) {display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 18px!important;width:18px!important;min-width:18px!important;height:18px!important;padding:0!important;margin:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;color:currentColor!important;--icon-ink:currentColor!important;--icon-accent:currentColor!important;--icon-detail:currentColor!important;line-height:1!important;vertical-align:middle}
  html[data-bims-theme] body :is(.ico,.bpw-icon)>svg {display:block!important;width:18px!important;height:18px!important;min-width:18px!important;stroke:currentColor!important;filter:none!important}
  html[data-bims-theme] body :is(.ico,.bpw-icon)>svg [stroke]:not([stroke="none"]) {stroke:currentColor!important}
  html[data-bims-theme] body :is(.btn,.nav a,.nav summary,.field-title,.form-section-title,.section-heading) {align-items:center;gap:8px}
  html[data-bims-theme] body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="file"]):not([type="color"]),select,textarea) {font-family:inherit!important;font-size:13px!important;font-weight:450!important;line-height:1.5!important;color:var(--gt-ink)!important;background:var(--gt-surface)!important;border:1px solid var(--gt-line)!important;border-radius:9px!important;box-shadow:0 1px 2px #1a244604!important;min-height:44px!important;padding:11px 13px!important;max-width:100%}
  html[data-bims-theme] body :is(input,select,textarea):focus {border-color:var(--bims-primary)!important;outline:3px solid color-mix(in srgb,var(--bims-primary) 12%,transparent)!important;outline-offset:0!important}
  html[data-bims-theme] body :is(input[type="checkbox"],input[type="radio"]) {accent-color:var(--bims-primary)!important;width:17px!important;height:17px!important;min-height:17px!important;flex:0 0 17px!important;margin:0 8px 0 0!important;vertical-align:middle;box-shadow:none!important}
  html[data-bims-theme] body :is(.form-stack,.form-grid,.record-form) label:has(>input:is([type="checkbox"],[type="radio"])) {display:flex!important;align-items:center!important;gap:8px!important;line-height:1.6!important}
  html[data-bims-theme] body :is(.form-stack,.form-grid,.record-form) label:has(>input:is([type="checkbox"],[type="radio"]))::before {display:none!important}
  html[data-bims-theme] body :is(.field-title,.form-label,.form-stack>label,.form-grid>label) {font-size:12px!important;font-weight:600!important;color:var(--gt-ink)!important;line-height:1.5}
  html[data-bims-theme] body :is(input,textarea)::placeholder {color:var(--bims-subtle)!important;font-weight:400!important}
  html[data-bims-theme] body :is(.field-help,.form-hint,.help-text,.muted,.text-muted) {color:var(--gt-muted)!important;font-size:12px;line-height:1.7}
  html[data-bims-theme] body :is(.form-section,.form-block,fieldset) {border-color:var(--gt-line)!important;border-radius:12px!important}
  html[data-bims-theme] body :is(.form-grid,.filter-grid) {column-gap:20px!important;row-gap:18px!important}
  html[data-bims-theme] body :is(.table-wrap,.table-responsive) {border:1px solid var(--gt-line)!important;border-radius:12px!important;box-shadow:none!important}
  html[data-bims-theme] body :is(.table-wrap,.table-responsive,.data-table,.bims-table) :is(th,td) {padding:13px 16px!important;border-color:var(--gt-line)!important;font-size:12px!important;line-height:1.6!important}
  html[data-bims-theme] body :is(.table-wrap,.table-responsive,.data-table,.bims-table) th {background:var(--gt-soft)!important;color:var(--gt-muted)!important;font-size:10px!important;font-weight:650!important;letter-spacing:.045em;text-transform:uppercase}
  html[data-bims-theme] body :is(.table-wrap,.table-responsive,.data-table,.bims-table) tbody tr:hover {background:var(--gt-soft)!important}
  html[data-bims-theme] body :is(.empty-state,.empty,.public-empty,.empty-message) {padding:24px!important;border:1px dashed var(--gt-line)!important;border-radius:12px!important;background:var(--gt-soft)!important;box-shadow:none!important;color:var(--gt-muted)!important}
  html[data-bims-theme] body :is(.modal-card,.modal-content,.dialog-panel) {border:1px solid var(--gt-line)!important;border-radius:18px!important;box-shadow:0 24px 80px #1c254329!important;background:var(--gt-surface)!important}
  html[data-bims-theme] body :is(.modal-header,.modal-head) {padding:20px 24px!important;gap:16px!important;border-bottom:1px solid var(--gt-line)!important;background:var(--gt-surface)!important}
  html[data-bims-theme] body :is(.modal-footer,.modal-actions) {padding:16px 24px!important;gap:10px!important;border-top:1px solid var(--gt-line)!important;background:var(--gt-soft)!important}
  html[data-bims-theme] body :is(.modal-body,.dialog-body) {padding:24px!important}
  html[data-bims-theme] body :is(.gt-section-heading,.gt-workspace-heading) {display:flex!important;align-items:center!important;justify-content:space-between!important;gap:16px!important;flex-wrap:wrap!important;margin-bottom:22px!important}
  html[data-bims-theme] body :is(.gt-section-heading,.gt-workspace-heading) h2 {margin:0!important;font-size:20px!important;font-weight:700!important}
  html[data-bims-theme] body :is(.gt-section-actions,.gt-workspace-actions) {display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:10px!important;margin-left:auto!important}
  html[data-bims-theme] body .gt-worklist-summary {display:flex!important;flex-wrap:wrap!important;gap:10px 24px!important;align-items:center!important;margin:0 0 20px!important;padding:0 0 18px!important;border-bottom:1px solid var(--gt-line)!important;color:var(--gt-muted)!important;font-size:12px!important;line-height:1.6!important}
  html[data-bims-theme] body .gt-worklist-summary strong {color:var(--gt-ink)!important;font-size:18px!important;font-weight:700!important;margin-right:5px!important}
  html[data-bims-theme] body .gt-worklist-metrics {display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px!important;margin-bottom:22px!important}
  html[data-bims-theme] body .gt-worklist-metrics>a {display:flex!important;align-items:center!important;gap:12px!important;min-width:0!important;padding:16px!important;border:1px solid var(--gt-line)!important;border-radius:10px!important;background:var(--gt-soft)!important;box-shadow:none!important;text-decoration:none!important}
  html[data-bims-theme] body .gt-worklist-metrics>a:hover {border-color:var(--bims-primary)!important}
  html[data-bims-theme] body .gt-worklist-metrics :is(strong,b) {color:var(--gt-ink)!important;font-size:20px!important;line-height:1.2!important}
  html[data-bims-theme] body :is(.auth-page,.login-card,.bims-install-card) {background-image:none!important}
  html[data-bims-theme] body.auth-page .login-card {border-color:var(--gt-line)!important;box-shadow:0 20px 70px -30px #25305025!important;border-radius:20px!important}
  html[data-bims-theme] body :is(a,button,input,select,textarea,summary):focus-visible {outline:3px solid color-mix(in srgb,var(--bims-primary) 35%,white)!important;outline-offset:3px!important}
  @media(min-width:1100px){html[data-bims-theme] body.bims-admin-shell .module-grid{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))!important}}
  @media(max-width:900px){html[data-bims-theme] body .gt-worklist-metrics{grid-template-columns:repeat(2,minmax(0,1fr))!important}html[data-bims-theme] body.bims-admin-shell .topbar{min-height:72px!important;padding-top:12px!important;padding-bottom:12px!important;gap:12px!important}html[data-bims-theme] body.bims-admin-shell .main>.card{padding:20px!important}}
  @media(max-width:600px){html[data-bims-theme] body.bims-admin-shell{--bims-system-page-gutter:16px!important}html[data-bims-theme] body.bims-admin-shell .main>.card{padding:18px!important;border-radius:12px!important}html[data-bims-theme] body.bims-admin-shell .topbar-title h1{font-size:17px!important}html[data-bims-theme] body :is(.gt-section-actions,.gt-workspace-actions){margin-left:0!important;width:100%!important}html[data-bims-theme] body .gt-worklist-metrics{gap:8px!important}html[data-bims-theme] body .gt-worklist-metrics>a{padding:12px!important}html[data-bims-theme] body :is(.modal-header,.modal-head,.modal-body,.dialog-body){padding:18px!important}html[data-bims-theme] body :is(.modal-footer,.modal-actions){padding:14px 18px!important}html[data-bims-theme] body :is(.btn,a.btn,button.btn,.button):not(.btn-link){min-height:44px!important;max-width:100%}}
  @media(prefers-reduced-motion:reduce){html[data-bims-theme] body *{scroll-behavior:auto!important;transition:none!important;animation-duration:.001ms!important;animation-iteration-count:1!important}}
}

}

@layer gentri-refinement {
/* Payroll inherits the selected system palette; screen only, scoped away from payslip print. */
@media screen {
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace {
    --payroll-accent:var(--bims-primary)!important;--payroll-border:var(--gt-line)!important;--payroll-muted:var(--gt-muted)!important;
    color:var(--gt-ink)!important;
  }
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace :is(h1,h2,h3,legend,.payroll-scope-bar strong,.payroll-empty-state strong) {color:var(--gt-ink)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace :is(.payroll-intro,.payroll-muted,.payroll-block,.payroll-scope-bar,.payroll-section-kicker,.payroll-empty-state p,.payroll-form small,.payroll-scope-copy>p,.payroll-scope-note p,.payroll-start-steps li,.payroll-scope-search-status) {color:var(--gt-muted)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace :is(.payroll-eyebrow,.payroll-scope-change>summary,.payroll-table a:not(.btn)) {color:var(--bims-primary)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace :is(.btn,a.btn,button.btn) {min-height:44px!important;background:var(--gt-surface)!important;border-color:var(--gt-line)!important;color:var(--gt-ink)!important;box-shadow:none!important;font-weight:600!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace :is(.btn-primary,button.btn-primary) {background:var(--bims-primary)!important;border-color:var(--bims-primary)!important;color:var(--bims-on-primary,#fff)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace :is(.btn-primary,button.btn-primary):hover {background:var(--bims-primary-strong)!important;border-color:var(--bims-primary-strong)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-primary-nav {background:var(--gt-soft)!important;border-color:var(--gt-line)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-primary-nav a {color:var(--gt-muted)!important;min-height:48px!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-primary-nav a:hover {background:var(--gt-surface)!important;color:var(--gt-ink)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-primary-nav a[aria-current=location] {background:var(--bims-primary-soft)!important;color:var(--bims-primary)!important;border-color:transparent!important;box-shadow:none!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-tabs {border-bottom-color:var(--gt-line)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-tabs a {color:var(--gt-muted)!important;min-height:44px!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-tabs a[aria-current=page] {color:var(--bims-primary)!important;border-bottom-color:var(--bims-primary)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-nav-icon {color:inherit!important;stroke:currentColor!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-scope-dot {background:var(--bims-primary)!important;box-shadow:0 0 0 4px var(--bims-primary-soft)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace :is(.panel,.payroll-scope-popover,.payroll-scope-picker,.payroll-component-card) {background:var(--gt-surface)!important;background-image:none!important;border-color:var(--gt-line)!important;box-shadow:none!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace :is(.payroll-guide,.payroll-policy-guided,.payroll-totals>div,.payroll-scope-note,.payroll-scope-welcome) {background:var(--gt-soft)!important;background-image:none!important;border-color:var(--gt-line)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace :is(.payroll-guide>summary,.payroll-record-count,.payroll-scope-note strong,.payroll-start-steps li>span) {color:var(--gt-muted)!important;background:var(--gt-soft)!important;border-color:var(--gt-line)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace :is(.payroll-form,.payroll-filters,.payroll-scope-form) label {color:var(--gt-ink)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace :is(.payroll-form,.payroll-filters,.payroll-scope-form) :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {min-height:44px!important;background:var(--gt-surface)!important;border-color:var(--gt-line)!important;color:var(--gt-ink)!important;box-shadow:none!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace :is(input,select,textarea,button,a,summary):focus-visible {outline:3px solid color-mix(in srgb,var(--bims-primary) 35%,transparent)!important;outline-offset:3px!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-table-wrap {border-color:var(--gt-line)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-table {color:var(--gt-ink)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-table thead th {background:var(--gt-soft)!important;color:var(--gt-muted)!important;border-bottom-color:var(--gt-line)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-table td {background:var(--gt-surface)!important;color:var(--gt-ink)!important;border-bottom-color:var(--gt-line)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-table tbody tr:hover td {background:var(--gt-soft)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-empty-state>.payroll-nav-icon {color:var(--gt-muted)!important}
  html:root[data-bims-theme] body.bims-admin-shell :is(#main-content,main) .payroll-workspace .payroll-status:not([data-status]) {background:var(--gt-soft)!important;color:var(--gt-muted)!important;border-color:var(--gt-line)!important}
}
}

/* AI workspace colors follow the selected organization theme. Geometry and review states stay authored. */
@layer gentri-refinement {
@media screen {
  html[data-bims-theme] :is(.ai-workspace-root,.ai-workspace-card,.ai-workspace-inline) {
    --ai-accent:var(--bims-primary)!important;--ai-text:var(--gt-ink)!important;
    --ai-muted:var(--gt-muted)!important;--ai-border:var(--gt-line)!important;--ai-soft:var(--gt-soft)!important;
  }
  html[data-bims-theme] body .ai-workspace-launcher {
    background:var(--bims-primary)!important;border-color:var(--bims-primary)!important;color:var(--bims-on-primary)!important;
    box-shadow:0 6px 24px var(--bims-shadow)!important;
  }
  html[data-bims-theme] body .ai-workspace-panel {
    background:var(--gt-surface)!important;color:var(--gt-ink)!important;border-color:var(--gt-line)!important;
    box-shadow:-12px 0 48px var(--bims-shadow)!important;
  }
  html[data-bims-theme] body .ai-workspace-panel::backdrop {background:color-mix(in srgb,var(--bims-nav-end) 30%,transparent)!important}
  html[data-bims-theme] body .ai-workspace-panel::before {background:var(--gt-line)!important}
  html[data-bims-theme] body .ai-workspace-header {background:var(--gt-soft)!important;border-color:var(--gt-line)!important}
  html[data-bims-theme] body :is(.ai-workspace-header h2,.ai-workspace-results h3,.ai-workspace-results h4,.ai-workspace-inline strong) {color:var(--gt-ink)!important}
  html[data-bims-theme] body :is(.ai-workspace-eyebrow,.ai-workspace-status:not(.is-error)) {color:var(--bims-primary)!important}
  html[data-bims-theme] body :is(.ai-workspace-description,.ai-workspace-answer,.ai-workspace-footnote,.ai-workspace-request-reference,.ai-workspace-small,.ai-workspace-inline p,.ai-workspace-card p:not(.ai-workspace-eyebrow),.ai-workspace-sources ul,.ai-workspace-limitations ul) {color:var(--gt-muted)!important}
  html[data-bims-theme] body .ai-workspace-panel small:not(.ai-workspace-uncertain) {color:var(--gt-muted)!important}
  html[data-bims-theme] body :is(.ai-workspace-context,.ai-workspace-image-input,.ai-workspace-box) {background:var(--gt-soft)!important;border-color:var(--gt-line)!important;color:var(--gt-ink)!important}
  html[data-bims-theme] body :is(.ai-workspace-results,.ai-workspace-limitations,.ai-workspace-footnote,.ai-workspace-field) {border-color:var(--gt-line)!important}
  html[data-bims-theme] body :is(.ai-workspace-panel button,.ai-workspace-panel .ai-workspace-secondary,.ai-workspace-action) {
    background:var(--gt-surface)!important;border-color:var(--gt-line)!important;color:var(--bims-primary)!important;
  }
  html[data-bims-theme] body .ai-workspace-panel .ai-workspace-primary {background:var(--bims-primary)!important;border-color:var(--bims-primary)!important;color:var(--bims-on-primary)!important}
  html[data-bims-theme] body .ai-workspace-panel .ai-workspace-primary:hover {background:var(--bims-primary-hover)!important}
  html[data-bims-theme] body .ai-workspace-panel .ai-workspace-icon-button {background:transparent!important;border-color:transparent!important;color:var(--gt-ink)!important}
  html[data-bims-theme] body .ai-workspace-panel :is(label,.ai-workspace-draft-label) {color:var(--gt-ink)!important}
  html[data-bims-theme] body #bims-ai-workspace-panel :is(input:not([type="checkbox"]),textarea,select) {background:var(--gt-surface)!important;border-color:var(--gt-line)!important;color:var(--gt-ink)!important;caret-color:var(--bims-primary)!important}
  html[data-bims-theme] body .ai-workspace-panel :is(input,textarea)::placeholder {color:var(--gt-muted)!important}
  /* Keep the component's authored writing area above the shared control minimum. */
  html[data-bims-theme] body #bims-ai-workspace-panel textarea {min-height:100px!important}
  html[data-bims-theme] body #bims-ai-workspace-panel textarea.ai-workspace-draft {min-height:170px!important}
  html[data-bims-theme] body .ai-workspace-panel input[type="checkbox"] {accent-color:var(--bims-primary)!important}
  html[data-bims-theme] body :is(.ai-workspace-root,.ai-workspace-card,.ai-workspace-inline) :is(button,a,summary,input,select,textarea):focus-visible {outline-color:var(--bims-primary)!important}
  html[data-bims-theme] body .ai-workspace-provider {background:var(--bims-primary-soft)!important;border-color:var(--gt-line)!important;color:var(--bims-primary)!important}
  html[data-bims-theme] body .ai-workspace-finding:not([data-severity="warning"]):not([data-severity="critical"]) {background:var(--gt-soft)!important;border-color:var(--gt-line)!important;border-left-color:var(--bims-primary)!important}
  html[data-bims-theme] body .ai-workspace-finding:not([data-severity="warning"]):not([data-severity="critical"]) strong {color:var(--gt-ink)!important}
  html[data-bims-theme] body .ai-workspace-finding:not([data-severity="warning"]):not([data-severity="critical"]) p {color:var(--gt-muted)!important}
  html[data-bims-theme] body .ai-workspace-sources a {color:var(--bims-primary)!important}
  html[data-bims-theme] body .ai-workspace-box>summary {color:var(--gt-ink)!important}
  html[data-bims-theme] body .ai-workspace-box>summary::after {color:var(--gt-muted)!important}
  html[data-bims-theme] body .ai-workspace-card {background:var(--gt-surface)!important;color:var(--gt-ink)!important;border-color:var(--gt-line)!important;box-shadow:0 2px 12px color-mix(in srgb,var(--bims-shadow) 25%,transparent)!important}
  html[data-bims-theme] body .ai-workspace-card h2 {color:var(--gt-ink)!important}
  html[data-bims-theme] body .ai-workspace-card-mark {background:var(--bims-primary-soft)!important;border-color:var(--gt-line)!important;color:var(--bims-primary)!important}
  html[data-bims-theme] body .ai-workspace-inline {background:var(--gt-soft)!important;color:var(--gt-ink)!important;border-color:var(--gt-line)!important}
  @media(max-width:700px){html[data-bims-theme] body .ai-workspace-panel{box-shadow:0 -12px 44px var(--bims-shadow)!important}}
}
}

@layer gentri-refinement {
@media screen {
  /* Keep Scope and its selected value together on one horizontal line. */
  html[data-bims-theme] body.bims-admin-shell .topbar .bpw-account-shell .barangay-switcher .barangay-lookup-label {display:flex!important;align-items:center!important;gap:10px!important;position:relative!important;box-sizing:border-box!important;height:52px!important;margin:0!important;padding:0 12px!important;min-width:0!important;border:1px solid var(--gt-line)!important;border-radius:9px!important;background:var(--gt-surface)!important}
  html[data-bims-theme] body.bims-admin-shell .topbar .bpw-account-shell .barangay-switcher .topbar-field-title {position:static!important;inset:auto!important;display:inline-flex!important;flex:0 0 auto!important;align-items:center!important;justify-content:flex-start!important;gap:5px!important;height:20px!important;line-height:20px!important;font-size:12px!important;font-weight:550!important;color:var(--bims-muted)!important;white-space:nowrap!important;pointer-events:none}
  html[data-bims-theme] body.bims-admin-shell .topbar .bpw-account-shell .barangay-switcher .topbar-field-title :is(.ico,.bpw-icon),html[data-bims-theme] body.bims-admin-shell .topbar .bpw-account-shell .barangay-switcher .topbar-field-title :is(.ico,.bpw-icon)>svg {width:12px!important;min-width:12px!important;height:12px!important;min-height:12px!important;flex:0 0 12px!important}
  html[data-bims-theme] body.bims-admin-shell .topbar .bpw-account-shell .barangay-switcher .barangay-lookup>input[type="search"][data-barangay-input] {box-sizing:border-box!important;min-height:50px!important;height:50px!important;max-height:50px!important;width:100%!important;padding:12px 0!important;font-size:13px!important;font-weight:650!important;line-height:24px!important;text-align:left!important;text-overflow:ellipsis;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
  html[data-bims-theme] body.bims-admin-shell .topbar .bpw-account-shell .barangay-switcher .barangay-lookup {position:static!important;display:block!important;flex:1 1 auto!important;width:auto!important;min-width:0!important}
  html[data-bims-theme] body.bims-admin-shell .topbar .bpw-account-shell .barangay-switcher .barangay-lookup-label:focus-within {border-color:var(--bims-primary)!important;outline:3px solid color-mix(in srgb,var(--bims-primary) 12%,transparent)!important;outline-offset:0!important}
  html[data-bims-theme] body.bims-admin-shell .topbar .bpw-account-shell .barangay-switcher .barangay-lookup>input[type="search"][data-barangay-input]:focus {outline:0!important}
  html[data-bims-theme] body.bims-admin-shell .topbar .kld-nextly-profile>.kld-nextly-profile-button,html[data-bims-theme] body.bims-admin-shell .topbar .barangay-scope-pill {min-height:52px!important;height:52px!important;max-height:none!important}
  html[data-bims-theme] body.bims-admin-shell .topbar .barangay-lookup-results {top:calc(100% + 8px)!important;text-align:left!important}
  html[data-bims-theme] body.bims-admin-shell .topbar .barangay-scope-pill {display:flex!important;align-items:center!important;justify-content:center!important;padding:8px 12px!important;font-size:12px!important;line-height:1.4!important;text-align:center!important}
}
}

@layer gentri-refinement {
@media screen {
  /* The finance period is always visible; the generic filter popover opts out. */
  html[data-bims-theme] body.bims-admin-shell .gt-dashboard-finance .gt-finance-controls {display:grid!important;grid-template-columns:minmax(180px,240px) minmax(0,max-content) max-content!important;justify-content:start!important;align-items:end!important;gap:20px!important;width:100%!important;max-width:none!important;box-sizing:border-box!important;margin:20px 0!important;padding:18px!important;border:1px solid var(--gt-line)!important;border-radius:12px!important;background:var(--gt-soft)!important;box-shadow:none!important}
  html[data-bims-theme] body.bims-admin-shell .gt-finance-field,html[data-bims-theme] body.bims-admin-shell .gt-finance-range {display:grid!important;align-content:start!important;gap:7px!important;min-width:0!important;margin:0!important;padding:0!important}
  html[data-bims-theme] body.bims-admin-shell .gt-finance-field::before {display:none!important}
  html[data-bims-theme] body.bims-admin-shell .gt-finance-field-label {font-size:12px!important;line-height:18px!important;font-weight:650!important;color:var(--gt-ink)!important}
  html[data-bims-theme] body.bims-admin-shell #dashboard-finance-period {width:100%!important;font-weight:550!important}
  html[data-bims-theme] body.bims-admin-shell .gt-finance-range-value {display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:8px!important;min-height:44px!important;box-sizing:border-box!important;color:var(--gt-ink)!important;font-size:13px!important;font-weight:550!important;line-height:1.6!important}
  html[data-bims-theme] body.bims-admin-shell .gt-finance-range-value>span[aria-hidden] {color:var(--gt-muted)!important}
  html[data-bims-theme] body.bims-admin-shell .gt-finance-apply {margin:0!important}
  /* Shared compact workflow rows: icon, readable copy, and an aligned badge. */
  html[data-bims-theme] body.bims-admin-shell .gt-module-grid {display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;align-items:stretch!important;gap:10px!important}
  html[data-bims-theme] body.bims-admin-shell .gt-module-grid>.gt-module-row {display:grid!important;grid-template-columns:22px minmax(0,1fr) auto!important;align-items:center!important;gap:14px!important;min-width:0!important;min-height:88px!important;box-sizing:border-box!important;margin:0!important;padding:15px 18px!important;border:1px solid var(--gt-line)!important;border-radius:12px!important;background:var(--gt-surface)!important;color:var(--gt-ink)!important;box-shadow:none!important;text-decoration:none!important;transition:background .16s,border-color .16s!important;transform:none!important}
  html[data-bims-theme] body.bims-admin-shell .gt-module-grid>.gt-module-row:hover {background:var(--gt-soft)!important;border-color:var(--bims-primary)!important}
  html[data-bims-theme] body.bims-admin-shell .gt-module-row[hidden] {display:none!important}
  html[data-bims-theme] body.bims-admin-shell .gt-module-icon {display:flex!important;align-items:center!important;justify-content:center!important;width:22px!important;min-width:22px!important;padding:0!important;border:0!important;background:transparent!important;color:var(--bims-primary)!important}
  html[data-bims-theme] body.bims-admin-shell .gt-module-copy {display:grid!important;align-content:center!important;gap:4px!important;min-width:0!important}
  html[data-bims-theme] body.bims-admin-shell .gt-module-title {font-size:13px!important;line-height:1.45!important;font-weight:650!important;color:var(--gt-ink)!important;overflow-wrap:break-word!important}
  html[data-bims-theme] body.bims-admin-shell .gt-module-description,html[data-bims-theme] body.bims-admin-shell .gt-module-meta {display:block!important;font-size:11px!important;line-height:1.6!important;font-weight:400!important;color:var(--gt-muted)!important;overflow-wrap:break-word!important}
  html[data-bims-theme] body.bims-admin-shell .gt-module-ordinal {margin-right:7px!important;font-variant-numeric:tabular-nums}
  html[data-bims-theme] body.bims-admin-shell .gt-module-count {display:flex!important;align-items:center!important;justify-content:center!important;min-width:34px!important;min-height:34px!important;width:auto!important;height:auto!important;box-sizing:border-box!important;padding:6px 9px!important;margin:0!important;border:0!important;border-radius:999px!important;background:var(--bims-primary-soft)!important;color:var(--bims-primary)!important;font-size:12px!important;font-weight:650!important;line-height:1.5!important;font-variant-numeric:tabular-nums;white-space:nowrap}
  html[data-bims-theme] body.bims-admin-shell .gt-section-actions>[data-filter-cards] {width:clamp(220px,22vw,340px)!important;min-width:0!important}
  @media(max-width:1200px){html[data-bims-theme] body.bims-admin-shell .gt-module-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
  @media(max-width:700px){html[data-bims-theme] body.bims-admin-shell .gt-module-grid{grid-template-columns:minmax(0,1fr)!important}html[data-bims-theme] body.bims-admin-shell .gt-dashboard-finance .gt-finance-controls{grid-template-columns:minmax(0,1fr)!important;gap:16px!important;padding:16px!important}html[data-bims-theme] body.bims-admin-shell .gt-finance-apply{width:100%!important}html[data-bims-theme] body.bims-admin-shell .gt-section-actions>[data-filter-cards]{width:100%!important}}
}
}

@layer gentri-refinement {
@media screen {
  html:root[data-bims-theme] body.bims-admin-shell .gt-module-icon>.bpw-icon.ico {--bims-icon-size:22px!important;flex:0 0 22px!important;width:22px!important;min-width:22px!important;max-width:22px!important;height:22px!important;min-height:22px!important;max-height:22px!important;transform:none!important}
  html:root[data-bims-theme] body.bims-admin-shell .gt-module-icon>.bpw-icon.ico>svg {transform:none!important}
}
}


/* Compact staff actions on desktop. Keep the established important layer;
   narrow screens and coarse pointers retain the existing touch geometry. */
@layer gentri-refinement {
@media screen and (min-width: 1025px) and (hover: hover) and (pointer: fine) {
  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell {
    --gt-desktop-action-height: 32px;
    --gt-desktop-filter-height: 34px;
    --ui-action-height: var(--gt-desktop-action-height) !important;
    --ui-filter-control-height: var(--gt-desktop-filter-height) !important;
    --bims-system-control: var(--gt-desktop-filter-height);
    --bims-system-control-compact: var(--gt-desktop-action-height);
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    :is(.btn, a.btn, button.btn, .button, input[type="submit"], input[type="button"], input[type="reset"]):not(.btn-icon):not(.icon-btn):not(.menu-btn):not(:where(.gm-style *, .leaflet-container *, .mapboxgl-map *, .maplibregl-map *)) {
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: var(--gt-desktop-action-height) !important;
    height: auto !important;
    max-height: none !important;
    padding: 6px 10px !important;
    gap: 6px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    flex: 0 1 auto !important;
  }

  /* Explicit full-width form actions remain available. */
  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    :is(.btn.btn-block, .button.btn-block):not(.btn-icon):not(.icon-btn):not(.menu-btn) { width: 100% !important; }

  /* Payroll has a more specific 44px rule in this same layer. */
  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    :is(#main-content, main) .payroll-workspace :is(.btn, a.btn, button.btn):not(.btn-icon):not(.icon-btn) {
    min-height: var(--gt-desktop-action-height) !important;
    height: auto !important;
    max-height: none !important;
    width: auto !important;
    padding: 6px 10px !important;
    gap: 6px !important;
    line-height: 1.35 !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    :is(#main-content, main) .payroll-workspace .btn.btn-block:not(.btn-icon):not(.icon-btn) {
    width: 100% !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    :is(.button-row, .form-actions, .record-form-actions, .panel-actions, .filter-actions, .bims-filter-actions) {
    align-items: center !important;
    gap: 6px !important;
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    :is(.button-row, .form-actions, .record-form-actions, .panel-actions, .filter-actions, .bims-filter-actions, .row-actions)
    > :is(.btn, .button, input[type="submit"], input[type="button"], input[type="reset"]),
  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell .row-actions .btn {
    width: auto !important;
    flex: 0 1 auto !important;
    justify-self: start !important;
    align-self: center !important;
  }

  /* Filters share one baseline with Apply, Reset, and the advanced toggle. */
  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell form[data-bims-filter-ready] {
    --bims-filter-control-height: var(--gt-desktop-filter-height) !important;
    --ui-filter-control-height: var(--gt-desktop-filter-height) !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    :is(.filter-bar, .resident-filter-bar, .complaint-basic-filter, .service-request-quick-filters, form[data-bims-filter-ready], .gt-finance-controls, .payroll-filter, .payroll-filters)
    :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]), select:not([multiple]), .btn, .bims-filter-toggle, .bims-filter-advanced > summary) {
    box-sizing: border-box !important;
    min-height: var(--gt-desktop-filter-height) !important;
    height: auto !important;
    max-height: none !important;
    padding: 6px 10px !important;
    line-height: 1.35 !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    :is(.filter-bar, .resident-filter-bar, .complaint-basic-filter, .service-request-quick-filters, form[data-bims-filter-ready], .gt-finance-controls, .payroll-filter, .payroll-filters)
    :is(.btn, .bims-filter-toggle, .bims-filter-advanced > summary) {
    width: auto !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell .gt-finance-range-value {
    min-height: var(--gt-desktop-filter-height) !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    :is(.btn, .button, .bims-filter-toggle):not(.btn-icon):not(.icon-btn)
    :is(.bpw-icon.ico, .action-auto-icon) {
    --bims-icon-size: 16px !important;
    flex: 0 0 16px !important;
    width: 16px !important;
    min-width: 16px !important;
    max-width: 16px !important;
    height: 16px !important;
    min-height: 16px !important;
    max-height: 16px !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    :is(.btn, .button, .bims-filter-toggle):not(.btn-icon):not(.icon-btn)
    :is(.bpw-icon.ico, .action-auto-icon) > svg {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
  }

  /* Short, wrapping resident tools replace tall full-width button columns. */
  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    .panel:has(> .resident-three-step-workflow) > .panel-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    .panel:has(> .resident-three-step-workflow) > .panel-header > :first-child {
    flex: 1 1 220px !important;
    width: auto !important;
    min-width: 0 !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    .panel:has(> .resident-three-step-workflow) .resident-tool-groups {
    display: flex !important;
    flex: 1 1 740px !important;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 8px !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    .panel:has(> .resident-three-step-workflow) .resident-tool-group {
    display: grid !important;
    align-content: start !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 7px !important;
    gap: 5px !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    .panel:has(> .resident-three-step-workflow) .resident-tool-group:nth-child(2) {
    flex: 1 1 360px !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    .panel:has(> .resident-three-step-workflow) .resident-tool-group .resident-review-next-step-eyebrow {
    margin-bottom: 0 !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    .panel:has(> .resident-three-step-workflow) .resident-tool-group .button-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 6px !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    .panel:has(> .resident-three-step-workflow) .resident-tool-group .btn {
    width: auto !important;
    flex: 0 1 auto !important;
    justify-content: center !important;
    min-height: var(--gt-desktop-action-height) !important;
    padding: 6px 10px !important;
  }

  /* Keep review guidance visible above compact peer actions. */
  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    .panel:has(> .resident-three-step-workflow) .resident-actions-cluster {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    .panel:has(> .resident-three-step-workflow) .resident-actions-cluster > :is(.resident-workflow-action, .resident-row-actions-inner) {
    grid-column: 1 / -1 !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    .panel:has(> .resident-three-step-workflow) .resident-actions-cluster > .resident-row-actions-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
    width: auto !important;
    gap: 6px !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    .panel:has(> .resident-three-step-workflow) .resident-actions-cluster > .resident-row-actions-inner > .resident-row-action {
    width: auto !important;
    flex: 0 1 auto !important;
    min-height: var(--gt-desktop-action-height) !important;
    height: auto !important;
    max-height: none !important;
    padding: 6px 10px !important;
    overflow: visible !important;
    line-height: 1.35 !important;
  }

  html:root[data-bims-theme] body.bims-pro-shell.bims-admin-shell
    .panel:has(> .resident-three-step-workflow) .resident-row-action > span {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
  }

  /* Ordinary public website actions share the compact desktop rhythm. Public
     navigation, icon tools, weather controls, and resident app chrome keep
     their own layouts and are not selected here. */
  html:root[data-bims-theme] body.city-government:not(.auth-page)
    :is(.btn, a.btn, button.btn, .button):not(.btn-icon):not(.icon-btn):not(.menu-btn):not(:where(.gm-style *, .leaflet-container *, .mapboxgl-map *, .maplibregl-map *, .city-weather *, .city-weather-panel *, .city-storm *, .city-storm-panel *)) {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 34px !important;
    height: auto !important;
    max-height: none !important;
    padding: 6px 11px !important;
    gap: 6px !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    flex: 0 1 auto !important;
  }

  html:root[data-bims-theme] body.city-government:not(.auth-page)
    :is(.btn.btn-block, .button.btn-block):not(.btn-icon):not(.icon-btn):not(.menu-btn) { width: 100% !important; }
}
}
