.payslip-page { min-height: 100%; }

body.apu-payslip-theme .apu-app-header { background: #33597f !important; }
body.apu-payslip-theme .apu-header-brand-icon,
body.apu-payslip-theme #apuHeaderDateRow { color: #dbe6f1 !important; }
body.apu-payslip-theme .apu-header-logout-btn { background: rgba(20, 40, 64, .55) !important; }
body.apu-payslip-theme .apu-desktop-module-nav-btn:hover { background: rgba(20, 40, 64, .42) !important; }

#payslipBottomNav { display: none; }
@media (max-width: 640px) {
  body.apu-payslip-nav-visible #payslipBottomNav { display: grid !important; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
  body.apu-payslip-nav-visible #payslipPage { padding-bottom: 78px !important; }
  body.apu-ios-pwa.apu-payslip-nav-visible #payslipBottomNav { height: 82px !important; min-height: 82px !important; padding-bottom: 18px !important; }
  body:not(.apu-pwa-standalone).apu-payslip-nav-visible #payslipBottomNav { height: 58px; min-height: 58px; padding-bottom: 0; }
  body:not(.apu-pwa-standalone).apu-payslip-nav-visible #payslipBottomNav .apu-pwa-nav-item { min-height: 58px; }
}
@media (min-width: 641px) { #payslipBottomNav { display: none !important; } }
#payslipBottomNav .apu-pwa-nav-item.active { color: #33597f !important; }

.pay-slip-card { width: 100%; text-align: left; display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: #f9fafc; border: 1px solid #e2e8f0; transition: border-color .15s ease, transform .1s ease, box-shadow .15s ease; }
.pay-slip-card + .pay-slip-card { margin-top: 10px; }
.pay-slip-card:hover { border-color: #b9cadb; box-shadow: 0 6px 16px -10px rgba(51, 89, 127, .5); }
.pay-slip-card:active { transform: scale(.992); }
.pay-slip-icon { width: 44px; height: 44px; border-radius: 14px; background: #e3ebf4; color: #33597f; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 auto; }
.pay-slip-title { font-size: 14px; font-weight: 800; color: #1e293b; }
.pay-slip-sub { margin-top: 3px; font-size: 11px; font-weight: 600; color: #64748b; }
.pay-new { padding: 2px 8px; border-radius: 999px; background: #33597f; color: #fff; font-size: 9px; font-weight: 800; text-transform: uppercase; }

.pay-paper { border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; overflow: hidden; }
.pay-paper-head { padding: 14px 16px 10px; border-top: 5px solid #33597f; display: flex; align-items: center; gap: 12px; }
.pay-logo { height: 40px; width: auto; max-width: 140px; object-fit: contain; flex: 0 0 auto; }
.pay-head-text { min-width: 0; }
.pay-company { font-size: 16px; font-weight: 800; color: #33597f; overflow-wrap: anywhere; }
.pay-slipno { margin-top: 2px; font-size: 10px; font-weight: 700; color: #64748b; }
.pay-period-row { padding: 0 16px 6px; }
.pay-period { font-size: 15px; font-weight: 800; color: #1e293b; }
.pay-info { padding: 0 16px 10px; }
.pay-section-title { display: flex; justify-content: space-between; padding: 7px 16px; background: #e3ebf4; color: #33597f; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.pay-section-title.earn { background: #e5f3ea; color: #3c8a62; }
.pay-section-title.deduct { background: #fbe7e5; color: #b9564b; margin-top: 13px; }
.pay-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 16px; border-bottom: 1px solid #f1f5f9; font-size: 13px; font-weight: 600; color: #1e293b; }
.pay-line span:last-child { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-line.sum { font-weight: 800; border-bottom: 0; padding-top: 9px; padding-bottom: 9px; }
.pay-line.sum.earn { background: #f0f8f3; }
.pay-line.sum.deduct { background: #fdf1f0; }
.pay-line.pay-loan { margin-top: 14px; background: #f1f5f9; }
.pay-download-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.pay-export-footer { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
.pay-export-cancel { grid-column: 1 / -1; }
.pay-footer-row { display: flex; gap: 10px; align-items: stretch; width: 100%; }
.pay-more { position: relative; flex: 0 0 54px; display: flex; }
.pay-more-btn { width: 100%; padding: 0; }
.pay-more-menu { position: absolute; right: 0; bottom: calc(100% + 8px); min-width: 150px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 14px 30px -12px rgba(15, 23, 42, .35); overflow: hidden; z-index: 6; }
.pay-more-menu.hidden { display: none; }
.pay-more-menu button { display: block; width: 100%; text-align: left; padding: 13px 16px; font-size: 13px; font-weight: 800; color: #1e293b; }
.pay-more-menu button + button { border-top: 1px solid #f1f5f9; }
.pay-more-menu button.danger { color: #be123c; }
.pay-logo-preview { min-height: 48px; display: flex; align-items: center; margin: 10px 0; }
.pay-logo-preview img { max-height: 60px; max-width: 100%; object-fit: contain; }
.pay-total-box { margin: 12px 16px 14px; padding: 13px 16px; border-radius: 14px; background: #33597f; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pay-total-box .l { font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.pay-total-box .v { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pay-note { padding: 0 16px 12px; font-size: 11px; font-weight: 600; color: #64748b; line-height: 1.55; }

.pay-sum-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pay-sum-total { padding: 12px 14px; border-radius: 14px; background: #f8fafc; border: 1px solid #eef2f6; min-width: 0; }
.pay-sum-total.main { grid-column: 1 / -1; background: #e3ebf4; border-color: #d4e0ec; }
.pay-sum-total .l { font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #64748b; }
.pay-sum-total .v { margin-top: 4px; font-size: 18px; font-weight: 800; color: #1e293b; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pay-sum-total.main .v { font-size: 24px; color: #33597f; }
.pay-sum-total .v.ok { color: #166534; }
.pay-sum-total .v.bad { color: #b45309; }
.pay-sum-total .s { margin-top: 2px; font-size: 11px; font-weight: 600; color: #64748b; }
.pay-sum-note { grid-column: 1 / -1; padding: 9px 12px; border-radius: 12px; background: #fff7ed; color: #9a3412; font-size: 12px; font-weight: 700; }
.pay-sum-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.pay-sum-row:last-child { border-bottom: 0; }
.pay-sum-row.done { background: linear-gradient(90deg, rgba(220, 252, 231, .45), transparent 70%); }
.pay-sum-check { flex: 0 0 auto; padding-top: 2px; cursor: pointer; }
.pay-sum-check input { width: 22px; height: 22px; accent-color: #33597f; }
.pay-sum-main { flex: 1 1 auto; min-width: 0; }
.pay-sum-name { font-size: 13px; font-weight: 800; color: #1e293b; overflow-wrap: anywhere; }
.pay-sum-name small { font-size: 11px; font-weight: 600; color: #64748b; }
.pay-sum-bank { margin-top: 3px; font-size: 12px; font-weight: 600; color: #475569; overflow-wrap: anywhere; }
.pay-sum-bank b { font-weight: 800; color: #1e293b; letter-spacing: .02em; }
.pay-sum-bank.bad { color: #be123c; }
.pay-sum-meta { margin-top: 3px; font-size: 10px; font-weight: 600; color: #166534; }
.pay-sum-warn { margin-top: 4px; font-size: 11px; font-weight: 700; color: #b45309; }
.pay-sum-side { flex: 0 0 auto; text-align: right; }
.pay-sum-amount { font-size: 14px; font-weight: 800; color: #1e293b; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-sum-actions { margin-top: 6px; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.pay-sum-copy { padding: 5px 9px; border-radius: 9px; background: #f1f5f9; border: 1px solid #cbd5e1; font-size: 10px; font-weight: 800; color: #334155; white-space: nowrap; }
.pay-sum-copy:active { background: #e2e8f0; }
@media (max-width: 420px) { .pay-sum-row { flex-wrap: wrap; } .pay-sum-side { flex: 1 0 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 34px; } .pay-sum-actions { margin-top: 0; } }
.pay-item-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) 34px; gap: 8px 6px; align-items: center; margin-top: 8px; }
.pay-item-row + .pay-item-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e2e8f0; }
.pay-item-row .pay-combo { grid-column: 1 / 3; grid-row: 1; }
.pay-item-row > .pay-item-remove { grid-column: 3; grid-row: 1; }
.pay-item-row [data-pay-amount] { grid-column: 1; grid-row: 2; }
.pay-item-row .pay-item-note { grid-column: 2 / 4; grid-row: 2; }
.pay-line-note { margin-left: 6px; font-size: 11px; font-weight: 600; color: #94a3b8; }
#payBonusWrap.hidden, #payLoanWrap.hidden, #payDeductionWrap.hidden { display: none; }
.pay-thr-toggle { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid #d4e0ec; border-radius: 16px; background: #f3f7fb; cursor: pointer; }
.pay-thr-toggle input { width: 20px; height: 20px; margin-top: 2px; accent-color: #33597f; flex: 0 0 auto; }
.pay-thr-toggle b { display: block; font-size: 13px; font-weight: 800; color: #1e293b; }
.pay-thr-toggle small { display: block; margin-top: 2px; font-size: 11px; font-weight: 600; color: #64748b; line-height: 1.45; }
.pay-copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 8px; }
.pay-combo { position: relative; min-width: 0; }
.pay-combo.open { z-index: 20; }
.pay-combo-input { padding-right: 40px !important; }
.pay-combo-toggle { position: absolute; top: 0; right: 0; width: 40px; height: 100%; display: flex; align-items: center; justify-content: center; color: #64748b; }
.pay-combo.open .pay-combo-toggle svg { transform: rotate(180deg); }
.pay-combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); max-height: 220px; overflow-y: auto; background: #fff; border: 1px solid #cbd5e1; border-radius: 12px; box-shadow: 0 14px 30px -12px rgba(15, 23, 42, .35); -webkit-overflow-scrolling: touch; }
.pay-combo-list.hidden { display: none; }
.pay-combo-option { display: block; width: 100%; text-align: left; padding: 11px 12px; font-size: 14px; font-weight: 700; color: #1e293b; border-bottom: 1px solid #f1f5f9; }
.pay-combo-option:last-child { border-bottom: 0; }
.pay-combo-option:active, .pay-combo-option.selected { background: #e3ebf4; color: #264565; }
.pay-combo-empty { padding: 12px; font-size: 12px; font-weight: 600; color: #64748b; }
.pay-item-row .fx-input, .pay-item-row .fx-select { padding: 9px 10px; font-size: 16px; }
.pay-item-remove { width: 34px; height: 34px; border-radius: 10px; background: #fee2e2; color: #b91c1c; display: flex; align-items: center; justify-content: center; }
.pay-item-add { margin-top: 10px; }
.pay-total-preview { padding: 12px 14px; border-radius: 14px; background: #e3ebf4; color: #264565; font-size: 13px; font-weight: 800; display: flex; justify-content: space-between; gap: 10px; }
.pay-history-item { padding: 10px 12px; border-radius: 12px; background: #f8fafc; border: 1px solid #eef2f6; font-size: 12px; font-weight: 600; color: #475569; }
.pay-history-item + .pay-history-item { margin-top: 6px; }
.pay-notify-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #e3ebf4; color: #264565; }
.pay-notify-card .t { font-size: 12px; font-weight: 800; }
.pay-notify-card .s { font-size: 11px; font-weight: 600; opacity: .85; margin-top: 2px; }
.pay-loan-balance { padding: 14px 16px; }
.pay-loan-balance-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pay-info-btn { width: 32px; height: 32px; margin: -6px -6px -6px 0; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #64748b; font-size: 17px; }
.pay-info-btn:active { background: #f1f5f9; }
.pay-view-employees .apu-module-page-back { display: none; }
.pay-set-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.pay-set-row:last-of-type { border-bottom: 0; }
.pay-set-row.is-editing .fx-input { flex: 1; min-width: 0; padding: 8px 10px; font-size: 16px; }
.pay-set-pos { flex: 0 0 26px; height: 26px; border-radius: 8px; background: #e3ebf4; color: #264565; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.pay-set-name { flex: 1; min-width: 0; font-weight: 700; color: #334155; overflow-wrap: anywhere; }
.pay-set-name.is-off { opacity: .5; }
.pay-set-lock { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #f1f5f9; color: #64748b; font-size: 10px; font-weight: 800; vertical-align: 1px; }
.pay-set-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; }
.pay-set-row.is-editing .pay-set-actions { gap: 6px; }
.pay-set-move { width: 34px; height: 34px; border-radius: 10px; background: #f1f5f9; color: #334155; display: flex; align-items: center; justify-content: center; }
.pay-set-move:disabled { opacity: .35; }
.fx-link-btn.danger { color: #b91c1c; }
.pay-loan-balance .v { margin-top: 2px; font-size: 24px; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; }
.pay-loan-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.pay-loan-row:last-child { border-bottom: 0; }
.pay-loan-main { flex: 1; min-width: 0; }
.pay-loan-title { font-size: 13px; font-weight: 800; color: #1e293b; overflow-wrap: anywhere; }
.pay-loan-sub { margin-top: 2px; font-size: 12px; color: #64748b; overflow-wrap: anywhere; }
.pay-loan-amount { flex: 0 0 auto; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pay-loan-amount.add { color: #b45309; }
.pay-loan-amount.cut { color: #15803d; }
.pay-loan-row .pay-item-remove { flex: 0 0 auto; }
#payLoan[readonly] { background: #f1f5f9; color: #334155; }
