:root {
    --pl-navy: #102a43;
    --pl-blue: #1769aa;
    --pl-blue-dark: #0d426e;
    --pl-teal: #159a9c;
    --pl-ink: #172b4d;
    --pl-muted: #6b7c93;
    --pl-line: #d9e2ec;
    --pl-soft: #f5f8fb;
    --pl-white: #ffffff;
    --pl-shadow: 0 24px 70px rgba(16, 42, 67, .14);
}

.pl-payslip-lookup {
    position: relative;
    max-width: 980px;
    margin: clamp(24px, 5vw, 64px) auto;
    padding: clamp(24px, 4vw, 48px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 24px;
    color: var(--pl-ink);
    background: linear-gradient(145deg, #ffffff 0%, #f3f8fc 100%);
    box-shadow: var(--pl-shadow);
}

.pl-payslip-lookup::before,
.pl-payslip-lookup::after {
    position: absolute;
    z-index: 0;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.pl-payslip-lookup::before {
    top: -150px;
    right: -80px;
    background: rgba(21, 154, 156, .12);
}

.pl-payslip-lookup::after {
    bottom: -160px;
    left: -100px;
    background: rgba(23, 105, 170, .1);
}

.pl-payslip-lookup > * {
    position: relative;
    z-index: 1;
}

.pl-payslip-lookup > h2 {
    margin: 0;
    color: var(--pl-navy);
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.15;
    letter-spacing: -.02em;
}

.pl-form-intro {
    max-width: 620px;
    margin: 10px 0 28px;
    color: var(--pl-muted);
    font-size: 16px;
    line-height: 1.6;
}

.pl-payslip-form {
    display: grid;
    grid-template-columns: minmax(250px, 2fr) minmax(130px, .8fr) minmax(110px, .7fr) auto;
    gap: 10px 16px;
    align-items: start;
    padding: 16px 18px;
    border: 1px solid var(--pl-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 10px 30px rgba(16, 42, 67, .06);
}

.pl-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.pl-field label {
    min-height: 16px;
    color: var(--pl-ink);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.2;
}

.pl-field-hint {
    color: var(--pl-muted);
    font-size: 11px;
    line-height: 1.3;
}

.pl-field input,
.pl-field select {
    width: 100%;
    min-height: 50px;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #b8c7d8;
    border-radius: 9px;
    outline: none;
    color: var(--pl-ink);
    background: #fff;
    font: inherit;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.pl-field input:focus,
.pl-field select:focus {
    border-color: var(--pl-blue);
    box-shadow: 0 0 0 4px rgba(23, 105, 170, .14);
}

.pl-submit,
.pl-download-pdf {
    min-height: 50px;
    padding: 12px 18px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(135deg, var(--pl-blue), var(--pl-teal));
    box-shadow: 0 8px 18px rgba(23, 105, 170, .22);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    white-space: nowrap;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.pl-payslip-form .pl-submit {
    align-self: start;
    margin-top: 22px;
}

.pl-submit:hover,
.pl-download-pdf:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 12px 22px rgba(23, 105, 170, .28);
}

.pl-submit:focus-visible,
.pl-download-pdf:focus-visible {
    outline: 3px solid rgba(21, 154, 156, .35);
    outline-offset: 3px;
}

.pl-slip-footer .pl-download-pdf {
    color: #fff;
    background: #111;
    box-shadow: none;
}

.pl-slip-footer .pl-download-pdf:hover {
    background: #333;
}

.pl-ajax-result {
    min-height: 0;
}

.pl-ajax-message,
.pl-message {
    margin: 20px 0 0;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
}

.pl-loading {
    color: var(--pl-blue-dark);
    border: 1px solid #bcd9ee;
    background: #eef8ff;
}

.pl-error {
    color: #8b1e1e;
    border: 1px solid #f0b8b8;
    background: #fff0f0;
}

.pl-print-page {
    margin-top: 26px;
    padding: clamp(20px, 4vw, 38px);
    border: 1px solid #222;
    border-radius: 2px;
    color: #111;
    background: #fff;
    box-shadow: none;
    font-family: Arial, Helvetica, sans-serif;
}

.pl-slip-header {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) 84px;
    align-items: center;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #111;
}

.pl-slip-brand {
    text-align: center;
}

.pl-slip-logo,
.pl-slip-logo-mark {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    justify-self: end;
    border-radius: 0;
    object-fit: contain;
    color: #111;
    background: #fff;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.04em;
}

.pl-slip-brand strong,
.pl-slip-brand span,
.pl-slip-brand small {
    display: block;
}

.pl-slip-brand strong {
    color: #111;
    font-size: clamp(14px, 2vw, 18px);
    line-height: 1.2;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.pl-slip-brand span {
    margin-top: 4px;
    color: #111;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.pl-slip-brand small {
    margin-top: 4px;
    color: #333;
    font-size: 11px;
}

.pl-slip-heading {
    text-align: left;
}

.pl-slip-heading span {
    display: block;
    color: #222;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
}

.pl-slip-heading strong {
    display: block;
    margin-top: 7px;
    color: #111;
    font-size: 14px;
}

.pl-slip-employee {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid #333;
    border-radius: 0;
    background: #777;
}

.pl-slip-info {
    min-width: 0;
    padding: 14px;
    background: #fff;
}

.pl-slip-info span,
.pl-slip-summary span {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pl-slip-info strong {
    display: block;
    overflow: hidden;
    color: #111;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-slip-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 16px 0;
    border: 1px solid #333;
    background: #777;
}

.pl-slip-summary > div {
    padding: 12px;
    border: 0;
    border-radius: 0;
    background: #fff;
}

.pl-slip-summary strong {
    color: #111;
    font-size: 16px;
}

.pl-slip-summary .pl-slip-net {
    background: #f0f0f0;
}

.pl-slip-summary .pl-slip-net strong {
    color: #111;
}

.pl-slip-table-section {
    margin-top: 24px;
}

.pl-slip-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.pl-slip-section-title span {
    color: #111;
    font-size: 12px;
    font-weight: 800;
}

.pl-slip-section-title h3 {
    margin: 0;
    color: #111;
    font-size: 16px;
}

.pl-pay-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pl-pay-table th,
.pl-pay-table td {
    padding: 9px 11px;
    border: 1px solid #555;
    text-align: left;
}

.pl-pay-table th:last-child,
.pl-pay-table td:last-child {
    width: 150px;
    text-align: right;
    white-space: nowrap;
}

.pl-pay-table th {
    color: #fff;
    background: #1b1b1b;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.pl-pay-table tbody tr:nth-child(even) td {
    background: #f3f3f3;
}

.pl-empty-row {
    color: var(--pl-muted);
    text-align: center !important;
}

.pl-slip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid #333;
}

.pl-slip-footer span {
    color: #444;
    font-size: 11px;
    line-height: 1.5;
}

/* The downloaded PDF is deliberately black and white and compact like a
 * government salary statement, while the on-screen result stays modern. */
.pl-print-page.pl-pdf-mode {
    padding: 24px;
    border-color: #111;
    color: #111;
    background: #fff;
    box-shadow: none;
    font-family: Arial, Helvetica, sans-serif;
}

.pl-pdf-mode .pl-slip-header {
    padding-bottom: 12px;
    border-bottom-color: #111;
}

.pl-pdf-mode .pl-slip-logo {
    filter: grayscale(1) contrast(1.25);
}

.pl-pdf-mode .pl-slip-logo-mark {
    border: 1px solid #111;
    color: #111;
    background: #fff;
}

.pl-pdf-mode .pl-slip-brand strong,
.pl-pdf-mode .pl-slip-brand span,
.pl-pdf-mode .pl-slip-heading strong,
.pl-pdf-mode .pl-slip-section-title h3 {
    color: #111;
}

.pl-pdf-mode .pl-slip-brand small,
.pl-pdf-mode .pl-slip-heading span,
.pl-pdf-mode .pl-slip-info span,
.pl-pdf-mode .pl-slip-summary span,
.pl-pdf-mode .pl-slip-footer span {
    color: #444;
}

.pl-pdf-mode .pl-slip-employee {
    border-color: #111;
    background: #111;
}

.pl-pdf-mode .pl-slip-info {
    padding: 9px 11px;
}

.pl-pdf-mode .pl-slip-summary {
    gap: 8px;
    margin: 12px 0;
}

.pl-pdf-mode .pl-slip-summary > div {
    padding: 10px;
    border-color: #777;
    background: #fff;
}

.pl-pdf-mode .pl-slip-summary .pl-slip-net {
    border-color: #111;
    background: #f2f2f2;
}

.pl-pdf-mode .pl-slip-summary strong,
.pl-pdf-mode .pl-slip-summary .pl-slip-net strong {
    color: #111;
    font-size: 16px;
}

.pl-pdf-mode .pl-slip-table-section {
    margin-top: 12px;
}

.pl-pdf-mode .pl-slip-section-title span {
    color: #111;
}

.pl-pdf-mode .pl-pay-table th,
.pl-pdf-mode .pl-pay-table td {
    padding: 6px 8px;
    border-color: #555;
}

.pl-pdf-mode .pl-pay-table th {
    color: #fff;
    background: #111;
}

.pl-pdf-mode .pl-pay-table tbody tr:nth-child(even) td {
    background: #f4f4f4;
}

.pl-pdf-mode .pl-slip-footer {
    margin-top: 14px;
    padding-top: 10px;
    border-color: #111;
}

.pl-pdf-mode .pl-download-pdf {
    display: none;
}

/* Classic government salary statement layout. */
.pl-print-page {
    width: 100%;
    max-width: 920px;
    margin: 26px auto 0;
    padding: clamp(22px, 4vw, 42px);
    border: 1px solid #b7b7b7;
    color: #111;
    background: #fff;
    font-family: "Times New Roman", Times, serif;
    font-size: 12px;
    line-height: 1.25;
}

.pl-slip-header {
    position: relative;
    display: flex;
    min-height: 76px;
    align-items: flex-start;
    justify-content: center;
    padding: 0 82px 12px;
    border: 0;
}

.pl-slip-brand {
    width: 100%;
    text-align: center;
}

.pl-slip-brand strong {
    display: inline-block;
    color: #111;
    border-bottom: 1px solid #111;
    font-family: "Times New Roman", Times, serif;
    font-size: 17px;
    line-height: 1.15;
    letter-spacing: 0;
    text-transform: uppercase;
}

.pl-slip-brand span {
    margin-top: 3px;
    color: #111;
    font-size: 12px;
    font-weight: 700;
    text-transform: none;
}

.pl-slip-brand small {
    margin-top: 2px;
    color: #111;
    font-size: 11px;
}

.pl-slip-logo,
.pl-slip-logo-mark {
    position: absolute;
    top: 0;
    right: 8px;
    object-fit: contain;
}

.pl-slip-logo {
    display: block;
    width: auto;
    max-width: 64px;
    height: auto;
    max-height: 64px;
}

.pl-slip-logo-mark {
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
}

.pl-slip-block,
.pl-slip-table-section {
    margin-top: 10px;
}

.pl-slip-block h3,
.pl-slip-section-title h3 {
    margin: 0 0 5px;
    color: #111;
    font-family: "Times New Roman", Times, serif;
    font-size: 12px;
    font-weight: 700;
}

.pl-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 18px;
}

.pl-detail-item {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 4px;
}

.pl-detail-item span {
    flex: 0 0 auto;
    color: #111;
    font-size: 11px;
    font-weight: 700;
}

.pl-detail-item strong {
    min-width: 0;
    color: #111;
    font-size: 11px;
    font-weight: 400;
    overflow-wrap: anywhere;
}

.pl-employment .pl-detail-grid,
.pl-address-section .pl-detail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pl-payment-section .pl-detail-grid {
    grid-template-columns: 1fr 1fr 2fr;
}

.pl-slip-section-title {
    display: block;
    margin-bottom: 4px;
}

.pl-pay-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px 12px;
    margin: 0 0 5px;
    font-size: 10px;
}

.pl-pay-meta span {
    color: #111;
    font-size: 10px;
    font-weight: 400;
}

.pl-pay-table,
.pl-loan-table {
    width: 100%;
    border-collapse: collapse;
    color: #111;
    font-family: "Times New Roman", Times, serif;
    font-size: 10.5px;
}

.pl-pay-table th,
.pl-pay-table td,
.pl-loan-table th,
.pl-loan-table td {
    padding: 2px 4px;
    border: 1px solid #111;
    color: #111;
    background: #fff;
    line-height: 1.2;
}

.pl-pay-table th,
.pl-loan-table th {
    color: #111;
    background: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-align: center;
    text-transform: none;
}

.pl-pay-table tbody tr:nth-child(even) td {
    background: #fff;
}

.pl-paired-table th:nth-child(1),
.pl-paired-table th:nth-child(4),
.pl-paired-table td:nth-child(1),
.pl-paired-table td:nth-child(4) {
    width: 8%;
    text-align: center;
    white-space: nowrap;
}

.pl-paired-table th:nth-child(2),
.pl-paired-table th:nth-child(5),
.pl-paired-table td:nth-child(2),
.pl-paired-table td:nth-child(5) {
    width: 30%;
    text-align: left;
}

.pl-paired-table th:nth-child(3),
.pl-paired-table th:nth-child(6),
.pl-paired-table td:nth-child(3),
.pl-paired-table td:nth-child(6) {
    width: 12%;
    text-align: right;
    white-space: nowrap;
}

.pl-pay-code-cell {
    color: #111;
    font-size: 9.5px;
    font-weight: 400;
}

.pl-tax-section .pl-detail-grid,
.pl-leave-section .pl-detail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pl-slip-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 10px 0 8px;
    border: 0;
    background: #fff;
}

.pl-slip-summary > div,
.pl-slip-summary .pl-slip-net {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 0;
    color: #111;
    background: #fff;
}

.pl-slip-summary span {
    margin: 0;
    color: #111;
    font-family: "Times New Roman", Times, serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.pl-slip-summary strong,
.pl-slip-summary .pl-slip-net strong {
    color: #111;
    font-size: 11px;
}

.pl-payment-section {
    margin-top: 9px;
}

.pl-address-section {
    margin-top: 14px;
    padding-top: 8px;
    border-top: 1px solid #111;
}

.pl-slip-footer {
    margin-top: 14px;
    padding-top: 8px;
    border-top: 1px solid #111;
}

.pl-slip-footer span {
    color: #333;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9px;
}

@media (max-width: 800px) {
    .pl-payslip-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pl-payslip-form .pl-field:first-child,
    .pl-payslip-form .pl-submit {
        grid-column: 1 / -1;
    }

    .pl-payslip-form .pl-submit {
        margin-top: 0;
    }

    .pl-detail-grid,
    .pl-employment .pl-detail-grid,
    .pl-address-section .pl-detail-grid,
    .pl-payment-section .pl-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .pl-payslip-lookup {
        padding: 18px;
        border-radius: 16px;
    }

    .pl-payslip-form,
    .pl-slip-summary,
    .pl-detail-grid,
    .pl-employment .pl-detail-grid,
    .pl-address-section .pl-detail-grid,
    .pl-payment-section .pl-detail-grid,
    .pl-tax-section .pl-detail-grid,
    .pl-leave-section .pl-detail-grid {
        grid-template-columns: 1fr;
    }

    .pl-payslip-form .pl-field:first-child,
    .pl-payslip-form .pl-submit {
        grid-column: auto;
    }

    .pl-payslip-form .pl-submit {
        width: 100%;
    }

    .pl-print-page {
        padding: 18px 14px;
    }

    .pl-slip-header {
        min-height: 64px;
        padding: 0 58px 10px 0;
    }

    .pl-slip-logo,
    .pl-slip-logo-mark {
        right: 0;
        max-width: 48px;
        max-height: 48px;
    }

    .pl-slip-logo-mark {
        width: 48px;
        height: 48px;
    }

    .pl-slip-brand strong {
        font-size: 13px;
    }

    .pl-slip-brand span,
    .pl-slip-brand small {
        font-size: 10px;
    }

    .pl-slip-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .pl-pay-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pl-slip-table-section {
        overflow-x: auto;
    }

    .pl-pay-table,
    .pl-loan-table {
        min-width: 620px;
    }

    .pl-slip-footer .pl-download-pdf {
        width: 100%;
    }

    .pl-pay-table th:last-child,
    .pl-pay-table td:last-child {
        width: 100px;
    }
}

@media print {
    @page {
        margin: 12mm;
        size: A4 portrait;
    }

    body * {
        visibility: hidden !important;
    }

    .pl-print-page,
    .pl-print-page * {
        visibility: visible !important;
    }

    .pl-print-page {
        position: absolute !important;
        top: 0;
        left: 0;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    .pl-download-pdf,
    .pl-payslip-form,
    .pl-payslip-lookup > h2,
    .pl-form-intro,
    .pl-ajax-message {
        display: none !important;
    }

    .pl-slip-header {
        padding-bottom: 12px;
    }

    .pl-slip-employee,
    .pl-slip-summary > div,
    .pl-pay-table th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
