/* Payroll uses the same spacing, surfaces, and readable text as the team page. */
#appView #payrollSection {
  --payroll-ink: #172b40;
  --payroll-text: #344b64;
  --payroll-muted: #52647a;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

#appView:has(#payrollSection:not(.hidden)) #addEmployeeBtn { display: none !important; }
#payrollSection .payroll-page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
#payrollSection .payroll-eyebrow { margin: 0 0 6px; font-size: 10px; font-weight: 650; letter-spacing: 1.4px; color: #4b6078; }
#payrollSection .payroll-page-head h2 { margin: 0 0 7px; font-size: 30px !important; line-height: 1.2; letter-spacing: -1px !important; color: var(--payroll-ink) !important; }
#payrollSection .payroll-page-description { margin: 0; color: #4b6078; font-size: 14px; line-height: 1.6; }
#payrollSection #saveStatus { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; width: auto !important; max-width: 100%; margin: 0 !important; padding: 7px 10px !important; border: 1px solid #d9e8df; border-radius: 6px; background: #f0f8f3; color: #276146; font-size: 11px; font-weight: 500; }
#payrollSection #saveStatus::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
#payrollSection #saveStatus:empty { display: none; }

#payrollSection #payrollTotalsBar { position: static !important; display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 0 !important; margin: 0 0 22px !important; padding: 20px 0 !important; border: 1px solid #e2e7ee !important; border-radius: 12px !important; background: #fff !important; box-shadow: none !important; backdrop-filter: none; }
#payrollSection #payrollTotalsBar > .payroll-overview-item { min-width: 0; padding: 0 20px; border: 0; border-radius: 0; background: transparent; }
#payrollSection #payrollTotalsBar > div + div { border-left: 1px solid #e9edf2; }
#payrollSection #payrollTotalsBar span { color: #40546d; font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; }
#payrollSection #payrollTotalsBar strong { margin-top: 9px; color: #20334a; font-size: clamp(18px, 1.55vw, 25px); line-height: 1.2; font-weight: 650; letter-spacing: -0.7px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#payrollSection #payrollTotalsBar .payroll-overview-net strong { color: #206343; }
#payrollSection #payrollTotalsBar small { display: block; margin-top: 7px; color: var(--payroll-muted); font-size: 10px; font-weight: 400; }

#payrollSection #payrollReviewPanel { margin: 0 0 22px !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
#payrollSection .payroll-review-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#payrollSection .payroll-review-period { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
#payrollSection .payroll-review-period h3 { margin: 0; color: var(--payroll-ink) !important; font-size: 16px; font-weight: 650 !important; letter-spacing: -0.4px !important; }
#payrollSection .payroll-review-period p,
#payrollSection .payroll-review-period span { margin: 0; color: var(--payroll-muted); font-size: 11px; font-weight: 500; }
#payrollSection .payroll-review-period .payroll-review-label { display: none; }
#payrollSection .payroll-review-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
#payrollSection .status-pill { display: inline-flex; align-items: center; min-height: 0 !important; padding: 4px 9px !important; border: 1px solid #d7eee3 !important; border-radius: 5px !important; background: #edf8f2 !important; color: #206343 !important; font-size: 10px; font-weight: 600; white-space: nowrap; }
#payrollSection .status-pill.leave { border-color: #f3e8c7 !important; background: #fff8e9 !important; color: #785815 !important; }
#payrollSection .status-pill.terminated { border-color: #f1dce0 !important; background: #f8eef0 !important; color: #8e3548 !important; }
#payrollSection .payroll-report-status { padding: 4px 8px; border: 1px solid #e1e7ee; border-radius: 5px; background: #eef2f6; color: #40546d; font-size: 10px; font-weight: 600; }
#payrollSection .payroll-report-status.generated { background: #edf8f2; color: #206343; border-color: #d7eee3; }
#payrollSection button { min-height: 38px; padding: 0 13px; border-radius: 7px !important; box-shadow: none !important; font-size: 11px; font-weight: 600 !important; transform: none !important; }
#payrollSection #generateVisiblePayslipsBtn,
#payrollSection button[data-action="payslip"] { min-height: 40px; border-color: #183b50 !important; background: #183b50 !important; color: #fff !important; }
#payrollSection #generateVisiblePayslipsBtn:hover,
#payrollSection button[data-action="payslip"]:hover { background: #23536b !important; }
#payrollSection button:disabled { opacity: 0.55; cursor: not-allowed !important; }
#payrollSection .payroll-checks { position: relative; }
#payrollSection .payroll-checks > summary { cursor: pointer; color: #785815; font-size: 11px; font-weight: 600; padding: 8px 10px; border: 1px solid #ecdfbf; border-radius: 6px; background: #fffaf0; }
#payrollSection .payroll-checks-content { position: absolute; right: 0; top: calc(100% + 9px); z-index: 30; width: min(430px, 75vw); max-height: 300px; overflow: auto; padding: 16px; border: 1px solid #eadfc9; border-radius: 9px; background: #fff; box-shadow: 0 8px 30px #172b401a; }
#payrollSection .payroll-checks-content strong { color: #61481e; font-size: 12px; }
#payrollSection .payroll-checks-content ul { padding-left: 16px; margin: 10px 0 0; }
#payrollSection .payroll-checks-content li { margin: 7px 0; color: #725529; font-size: 11px; line-height: 1.6; font-weight: 500; }
#payrollSection .payroll-checks-content p { color: #40546d; font-size: 11px; line-height: 1.6; }
#payrollSection .checks-clear > summary { background: #f0f8f3; border-color: #d7eee3; color: #206343; }

#payrollSection .payroll-workspace-panel { min-width: 0; border: 1px solid #e2e7ee; border-radius: 12px; background: #fff; overflow: hidden; }
#payrollSection .payroll-control-panel { margin: 0 !important; padding: 20px !important; border: 0 !important; border-bottom: 1px solid #e8edf3 !important; border-radius: 0 !important; background: #fff !important; box-shadow: none !important; }
#payrollSection .payroll-directory-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
#payrollSection .payroll-directory-title { display: flex; align-items: center; gap: 10px; }
#payrollSection .payroll-directory-title h3 { margin: 0; color: var(--payroll-ink) !important; font-size: 15px; font-weight: 650 !important; }
#payrollSection .payroll-count { color: var(--payroll-muted); padding: 3px 7px; border-radius: 5px; background: #f1f4f8; font-size: 10px; font-weight: 600; }
#payrollSection .payroll-search-row { display: grid !important; grid-template-columns: 245px 174px !important; gap: 10px !important; }
#payrollSection .payroll-search-row label { min-width: 0; margin: 0; }
#payrollSection .payroll-search-field { position: relative; }
#payrollSection .payroll-search-field svg { position: absolute; top: 11px; left: 11px; width: 16px; height: 16px; color: var(--payroll-muted); pointer-events: none; }
#payrollSection input,
#payrollSection select,
#payrollSection textarea { min-width: 0; min-height: 40px !important; height: 40px; padding: 0 12px !important; margin-top: 7px; border: 1px solid #dce4ed !important; border-radius: 7px !important; background: #fff !important; color: #263e57 !important; font-size: 13px !important; font-weight: 500; line-height: normal; }
#payrollSection select { appearance: auto; }
#payrollSection input::placeholder,
#payrollSection textarea::placeholder { color: #607187; opacity: 1; font-weight: 400; }
#payrollSection #payrollSearchInput,
#payrollSection #payrollFilterSelect { height: 38px; min-height: 38px !important; margin: 0; font-size: 12px !important; }
#payrollSection #payrollSearchInput { padding-left: 34px !important; }
#payrollSection #payrollFilterSelect { padding-right: 6px !important; }

#payrollSection .payroll-bulk-controls { margin-top: 16px; padding-top: 14px; border-top: 1px solid #edf0f4; }
#payrollSection .payroll-bulk-controls > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: fit-content; padding: 0; border: 0; border-radius: 0; background: transparent; color: #344b64; font-size: 11px; font-weight: 600; cursor: pointer; list-style: none; }
#payrollSection .payroll-bulk-controls > summary::-webkit-details-marker { display: none; }
#payrollSection .payroll-bulk-controls > summary::before { content: "+"; font-size: 17px; font-weight: 400; line-height: 1; }
#payrollSection .payroll-bulk-controls[open] > summary::before { content: "−"; }
#payrollSection .payroll-bulk-scope { font-size: 10px; color: var(--payroll-muted); font-weight: 400; }
#payrollSection .payroll-bulk-note { margin: 14px 0 0; color: var(--payroll-muted); font-size: 11px; line-height: 1.6; }
#payrollSection .payroll-bulk-panel { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 18px !important; margin-top: 14px; padding: 16px; border: 1px solid #e5eaf1; border-radius: 8px; background: #f8fafc; }
#payrollSection .payroll-bulk-field { min-width: 0; }
#payrollSection .payroll-bulk-field label { margin: 0 0 7px; font-size: 11px; font-weight: 600; color: #40546d; }
#payrollSection .payroll-bulk-field > div { display: flex; align-items: center; gap: 7px; }
#payrollSection .payroll-bulk-field input { margin: 0; flex: 1; }
#payrollSection .payroll-bulk-field button { flex: 0 0 auto; min-height: 40px; padding: 0 11px; font-size: 10px; border-color: #d7e1eb !important; color: #365572 !important; background: #fff !important; }

#payrollSection #payrollBody { padding: 0 !important; margin: 0; display: block; }
#payrollSection .payroll-entry-card { padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: #fff !important; box-shadow: none !important; overflow: visible !important; }
#payrollSection .payroll-employee-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px; border-bottom: 1px solid #e8edf3; background: #fafcfe; }
#payrollSection .payroll-employee-identity { display: flex; align-items: flex-start; flex: 1 1 280px; gap: 12px; min-width: 0; }
#payrollSection .payroll-employee-info { min-width: 0; }
#payrollSection .payroll-employee-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 4px; }
#payrollSection .payroll-employee-heading h3 { max-width: 100%; margin: 0; overflow-wrap: anywhere; }
#payrollSection .payroll-employee-avatar { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #dce7f0; border-radius: 50%; color: #365572; background: #eaf1f7; font-size: 14px; font-weight: 600; }
#payrollSection .payroll-employee-identity h3 { margin: 0; color: var(--payroll-ink) !important; font-size: 17px; font-weight: 650 !important; letter-spacing: -0.4px !important; }
#payrollSection .payroll-employee-meta { margin: 0; font-size: 11px; color: var(--payroll-muted); line-height: 1.6; }
#payrollSection .payroll-employee-identity p { margin: 0; font-size: 11px; color: var(--payroll-muted); line-height: 1.6; overflow-wrap: anywhere; }
#payrollSection .payroll-employee-identity .payroll-status-detail { margin-top: 3px; color: var(--payroll-muted); font-size: 10px; line-height: 1.5; }
#payrollSection .payroll-employee-switcher { display: flex; align-items: center; flex: 0 0 auto; flex-wrap: nowrap; gap: 12px; margin-left: auto; }
#payrollSection .payroll-employee-switcher select { min-width: 190px; width: 220px; max-width: 240px; margin: 0; min-height: 36px !important; height: 36px; font-size: 11px !important; }
#payrollSection .payroll-switcher-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#payrollSection .payroll-record-navigation { display: flex; align-items: center; gap: 9px; color: var(--payroll-muted); font-size: 10px; }
#payrollSection .payroll-record-navigation button { min-width: 30px; min-height: 32px; padding: 0 8px; background: #fff !important; color: #365572 !important; border: 1px solid #dce4ed !important; border-radius: 5px !important; font-size: 16px; }

#payrollSection .payroll-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
#payrollSection .payroll-editor-main { min-width: 0; padding: 0 24px; border-right: 1px solid #e8edf3; }
#payrollSection .payroll-editor-section { min-width: 0; padding: 24px 0; border: 0; border-bottom: 1px solid #e8edf3; background: #fff; }
#payrollSection .payroll-editor-section:last-child { border-bottom: 0; }
#payrollSection .payroll-editor-section h3 { margin: 0 0 17px; padding: 0; border: 0; color: #20334a !important; font-size: 13px; font-weight: 650 !important; letter-spacing: 0 !important; text-transform: none; }
#payrollSection .payroll-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
#payrollSection .payroll-section-heading h4 { margin: 0; color: #20334a !important; font-size: 13px; font-weight: 650 !important; letter-spacing: 0 !important; }
#payrollSection .payroll-section-heading > span { color: var(--payroll-muted); font-size: 10px; }
#payrollSection .payroll-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px 18px; }
#payrollSection .payroll-field-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#payrollSection .payroll-field-grid label,
#payrollSection .payroll-editor-section > label { display: block; min-width: 0; margin: 0; color: #40546d !important; font-size: 11px !important; font-weight: 600 !important; line-height: 1.5; text-transform: none !important; letter-spacing: 0 !important; }
#payrollSection .payroll-readout { min-width: 0; margin: 0; }
#payrollSection .payroll-readout > span,
#payrollSection .payroll-readout dt { display: block; margin: 0 0 7px; color: #40546d; font-size: 11px; font-weight: 600; }
#payrollSection .payroll-readout > strong,
#payrollSection .payroll-readout dd { display: flex; align-items: center; height: 40px; margin: 0; padding: 0 12px; color: #344b64; background: #f5f7fa; border: 1px solid #e6ebf1; border-radius: 7px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
#payrollSection .payroll-readout small { display: block; margin-top: 5px; color: var(--payroll-muted); font-size: 10px; line-height: 1.5; }
#payrollSection .payroll-readout strong small { display: inline; margin: 0 0 0 6px; font-weight: 400; }
#payrollSection .payroll-section-note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin: 15px 0 0; color: var(--payroll-muted); font-size: 11px; }
#payrollSection .payroll-section-note strong { color: #344b64; font-size: 12px; font-weight: 600; }
#payrollSection .field-note { display: block; margin: 6px 0 0; color: var(--payroll-muted); font-size: 10px; font-weight: 400; line-height: 1.5; }
#payrollSection input:disabled,
#payrollSection input[readonly] { color: #52647a !important; background: #f5f7fa !important; border-color: #e6ebf1 !important; cursor: default !important; }
#payrollSection .payroll-section-total,
#payrollSection .payroll-inline-total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #edf0f4; font-size: 11px; color: var(--payroll-muted); }
#payrollSection .payroll-section-total strong,
#payrollSection .payroll-inline-total strong { color: #20334a; font-size: 13px; font-weight: 650; }
#payrollSection .payroll-calculation-details { margin-top: 15px; }
#payrollSection .payroll-calculation-details > summary { width: fit-content; color: #365572; padding: 0; font-size: 11px; font-weight: 500; cursor: pointer; }
#payrollSection .payroll-calculation-details p { color: var(--payroll-muted); font-size: 11px; line-height: 1.7; }
#payrollSection .payroll-calculation-details .payroll-summary-line { margin-top: 10px; }
#payrollSection .payroll-zero-notice,
#payrollSection .payroll-zero-reason,
#payrollSection .payroll-zero-pay-note { margin: 16px 0 0; padding: 11px 13px; border: 1px solid #eadfca; border-radius: 7px; background: #fffaf0; color: #785815; font-size: 11px; line-height: 1.7; }
#payrollSection textarea { height: auto; min-height: 78px !important; padding: 11px 12px !important; resize: vertical; line-height: 1.6; }

#payrollSection .payroll-pay-summary { position: sticky; top: 20px; min-width: 0; padding: 22px 20px; display: grid; gap: 16px; }
#payrollSection .payroll-net-card { padding: 20px; border: 1px solid #183b50; border-radius: 10px; background: #183b50; color: #fff; }
#payrollSection .payroll-net-card p { margin: 0 0 10px; color: #e0ecf3; font-size: 11px; font-weight: 500; }
#payrollSection .payroll-net-card strong { display: block; color: #fff; font-size: 27px; font-weight: 650; line-height: 1.25; letter-spacing: -0.8px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#payrollSection .payroll-net-card small,
#payrollSection .payroll-net-card > span { display: block; margin-top: 10px; color: #d5e4ed; font-size: 10px; line-height: 1.6; }
#payrollSection .payroll-summary-card { padding: 0 0 18px; border: 0; border-bottom: 1px solid #e8edf3; background: #fff; }
#payrollSection .payroll-summary-card h3,
#payrollSection .payroll-summary-card h4 { margin: 0 0 15px; color: #20334a !important; font-size: 12px; font-weight: 650 !important; }
#payrollSection .payroll-summary-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 11px; color: var(--payroll-muted); }
#payrollSection .payroll-summary-line strong,
#payrollSection .payroll-summary-line b { color: #344b64; font-size: 11px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
#payrollSection .payroll-summary-total { margin-top: 13px; padding-top: 12px; border-top: 1px solid #e8edf3; font-weight: 600; color: #20334a; }
#payrollSection .payroll-summary-total strong { color: #206343; font-size: 13px; }
#payrollSection .payroll-summary-equation { margin: 13px 0 0; color: var(--payroll-muted); font-size: 10px; line-height: 1.6; }
#payrollSection .payroll-summary-total .payroll-advance-pending { color: #9d4c2c; }
#payrollSection .advance-remained-alert { color: #9d4c2c !important; }
#payrollSection .payroll-summary-actions { display: grid; gap: 10px; }
#payrollSection .payroll-summary-actions button { width: 100%; min-height: 40px; }
#payrollSection .payroll-summary-actions button[data-action="delete"] { min-height: 32px; border-color: transparent !important; background: transparent !important; color: #984255 !important; font-size: 10px; }
#payrollSection .payroll-summary-actions button[data-action="delete"]:hover { background: #fff1f2 !important; }
#payrollSection .payroll-summary-actions p { margin: 0; color: var(--payroll-muted); font-size: 10px; line-height: 1.6; }
#payrollSection .empty { padding: 44px 24px; color: var(--payroll-muted); font-size: 13px; line-height: 1.7; }
#payrollSection input:focus-visible,
#payrollSection textarea:focus-visible,
#payrollSection select:focus-visible,
#payrollSection button:focus-visible,
#payrollSection summary:focus-visible { outline: 2px solid #3984a5 !important; outline-offset: 3px; }
#appView:has(#payrollSection:not(.hidden)) #appMessage:not(:empty) { position: fixed; z-index: 60; right: 24px; bottom: 24px; max-width: min(430px, calc(100% - 32px)); min-height: 0; margin: 0; padding: 12px 18px; border: 1px solid #dce8e2; border-radius: 9px; background: #fff; box-shadow: 0 5px 24px #172b401a; font-size: 13px; }

@media (min-width: 1800px) {
  #payrollSection .payroll-editor-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  #payrollSection .payroll-field-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  #payrollSection .payroll-page-head { align-items: flex-start; }
  #payrollSection #payrollTotalsBar > .payroll-overview-item { padding-left: 14px; padding-right: 14px; }
  #payrollSection #payrollTotalsBar strong { font-size: 18px; }
  #payrollSection #payrollTotalsBar small { font-size: 9px; }
  #payrollSection .payroll-review-toolbar { flex-wrap: wrap; }
  #payrollSection .payroll-editor-grid { grid-template-columns: minmax(0, 1fr) 265px; }
  #payrollSection .payroll-editor-main { padding: 0 20px; }
  #payrollSection .payroll-employee-header { padding: 20px; }
  #payrollSection .payroll-pay-summary { padding: 20px 16px; }
  #payrollSection .payroll-net-card { padding: 16px; }
  #payrollSection .payroll-net-card strong { font-size: 23px; }
  #payrollSection .payroll-field-grid-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  #payrollSection .payroll-page-head { flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
  #payrollSection .payroll-page-head h2 { font-size: 26px !important; }
  #payrollSection .payroll-page-description { font-size: 12px; }
  #payrollSection #saveStatus { font-size: 10px; padding: 5px 8px !important; }
  #payrollSection #payrollTotalsBar { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; padding: 0 !important; margin-bottom: 20px !important; }
  #payrollSection #payrollTotalsBar > .payroll-overview-item { padding: 15px 16px; }
  #payrollSection #payrollTotalsBar > div:nth-child(odd) { border-left: 0; }
  #payrollSection #payrollTotalsBar > div:nth-child(n+3) { border-top: 1px solid #e9edf2; }
  #payrollSection #payrollTotalsBar > div:last-child { grid-column: 1 / -1; }
  #payrollSection #payrollTotalsBar strong { font-size: 22px; }
  #payrollSection #payrollTotalsBar small { font-size: 10px; }
  #payrollSection .payroll-review-toolbar { align-items: flex-start; gap: 12px; }
  #payrollSection .payroll-review-period { gap: 5px 10px; }
  #payrollSection .payroll-review-period h3 { font-size: 15px; }
  #payrollSection .payroll-review-actions { position: relative; width: 100%; justify-content: flex-start; gap: 8px; }
  #payrollSection #generateVisiblePayslipsBtn { margin-left: auto; font-size: 10px; }
  #payrollSection .payroll-checks { position: static; }
  #payrollSection .payroll-checks-content { left: 0; right: auto; width: min(430px, 100%); }
  #payrollSection .payroll-control-panel { padding: 16px !important; }
  #payrollSection .payroll-directory-toolbar { gap: 14px; }
  #payrollSection .payroll-search-row { width: 100%; grid-template-columns: minmax(0, 1fr) 160px !important; gap: 8px !important; }
  #payrollSection .payroll-bulk-controls > summary { gap: 7px; }
  #payrollSection .payroll-bulk-panel { padding: 13px; gap: 14px !important; }
  #payrollSection .payroll-employee-header { padding: 18px 16px; gap: 16px; }
  #payrollSection .payroll-employee-identity h3 { font-size: 16px; }
  #payrollSection .payroll-employee-switcher { width: 100%; justify-content: space-between; gap: 8px; }
  #payrollSection .payroll-employee-switcher select { max-width: 100%; min-width: 0; width: auto; flex: 1; }
  #payrollSection .payroll-editor-grid { grid-template-columns: minmax(0, 1fr); }
  #payrollSection .payroll-editor-main { border-right: 0; padding: 0 16px; }
  #payrollSection .payroll-editor-section { padding: 20px 0; }
  #payrollSection .payroll-field-grid { gap: 16px 12px; }
  #payrollSection .payroll-pay-summary { position: static; border-top: 1px solid #e8edf3; padding: 20px 16px; }
  #payrollSection .payroll-net-card strong { font-size: 28px; }
  #payrollSection input,
  #payrollSection select,
  #payrollSection textarea { min-height: 44px !important; font-size: 16px !important; }
  #payrollSection #payrollSearchInput,
  #payrollSection #payrollFilterSelect { font-size: 12px !important; }
  #payrollSection button { min-height: 44px; }
  #appView:has(#payrollSection:not(.hidden)) #appMessage:not(:empty) { right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); }
}

@media (max-width: 480px) {
  #payrollSection .payroll-search-row { grid-template-columns: minmax(0, 1fr) !important; }
  #payrollSection .payroll-bulk-panel { grid-template-columns: minmax(0, 1fr) !important; }
  #payrollSection .payroll-field-grid { grid-template-columns: minmax(0, 1fr); }
  #payrollSection .payroll-field-grid-three { grid-template-columns: minmax(0, 1fr); }
  #payrollSection .payroll-record-navigation { gap: 7px; }
  #payrollSection .payroll-review-actions { flex-wrap: wrap; }
  #payrollSection #generateVisiblePayslipsBtn { width: 100%; margin: 2px 0 0; }
}
