#payrollScreen{max-width:1500px;margin:auto}.ph-header,.ph-toolbar,.ph-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.ph-header{justify-content:space-between;margin-bottom:18px}.ph-header h1{margin:4px 0;font-size:30px;letter-spacing:-.7px}.ph-kicker{font-size:11px;font-weight:800;color:#52717c;letter-spacing:1.7px}.ph-banner{padding:15px 18px;border:1px solid #e4c489;background:#fff7e7;color:#74511b;border-radius:12px;margin:14px 0}.ph-banner strong{display:block;margin-bottom:4px}.ph-status{font-size:13px;color:#5a6e78}.ph-tabs{display:flex;gap:7px;border-bottom:1px solid #dce5e9;padding:12px 0;margin:16px 0;overflow:auto}.ph-tabs button{border:0;border-radius:8px;background:#edf2f4;padding:11px 18px;color:#3d5864;font-weight:700;white-space:nowrap}.ph-tabs button[aria-selected=true]{background:#123c49;color:white}.ph-card{background:white;border:1px solid #dbe4e8;border-radius:13px;padding:20px;margin:16px 0;box-shadow:0 3px 12px #153b4710}.ph-card h2{margin:0 0 12px;font-size:19px}.ph-table-wrap{overflow:auto}.ph-table{width:100%;border-collapse:collapse;font-size:13px}.ph-table th{text-align:left;color:#45616c;background:#f3f7f8;font-size:11px;letter-spacing:.3px;white-space:nowrap}.ph-table th,.ph-table td{padding:12px 10px;border-bottom:1px solid #e6edef;vertical-align:top}.ph-table td.num{font-variant-numeric:tabular-nums;font-weight:700;white-space:nowrap}.ph-badge{display:inline-block;border-radius:6px;padding:4px 7px;background:#edf3f5;color:#3f5964;font-size:11px;font-weight:750}.ph-badge.pending{background:#fff1d4;color:#8a5c11}.ph-badge.ok{background:#e1f5eb;color:#266547}.ph-error{color:#a02f35;background:#fff0f0;border:1px solid #efc2c5;padding:12px;border-radius:9px;margin:12px 0;white-space:pre-wrap}.ph-success{background:#e5f5ed;padding:12px;border-radius:9px;margin:12px 0;color:#246245}.ph-grid{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr));gap:12px}.ph-field{display:flex;flex-direction:column;gap:6px;margin:8px 0}.ph-field label{font-size:12px;font-weight:700;color:#46616c}.ph-field input,.ph-field select,.ph-field textarea,.ph-toolbar select,.ph-toolbar input{padding:10px;border:1px solid #ccd9df;border-radius:7px;background:white;min-width:0;font:inherit;width:100%}.ph-field textarea{min-height:72px;resize:vertical}.ph-shift{display:grid;grid-template-columns:95px 170px 1fr 90px 90px 85px 85px 100px;gap:8px;align-items:center;padding:10px 0;border-bottom:1px solid #e7edef}.ph-shift input,.ph-shift select{width:100%;padding:9px 5px;border:1px solid #ccd9df;border-radius:6px;font:inherit;font-size:12px}.ph-shift label{font-size:10px;color:#526b75;display:block}.ph-shift .ph-rowerror{grid-column:1/-1;color:#a02f35;font-size:12px}.ph-shift .ph-exception{grid-column:1/-1;display:flex;gap:8px}.ph-shift .ph-exception input{max-width:400px}.ph-entry-scroll{overflow:auto}.ph-shift{min-width:870px}.ph-request{padding:15px;border:1px solid #e6c98b;background:#fffaf0;border-radius:9px;margin:12px 0}.ph-request.approved{border-color:#bfdccc;background:#f4fbf7}.ph-request.rejected{border-color:#dce3e6;background:#f7f9fa}.ph-request h3{margin:0 0 7px;font-size:15px}.ph-request p{font-size:13px;margin:7px 0}.ph-meta{font-size:12px;color:#627985}.ph-card details{margin:12px 0}.ph-card summary{cursor:pointer;font-weight:700;padding:8px 0}.ph-preview{width:100%;height:600px;border:1px solid #dce5e9;border-radius:9px;background:white}.ph-controls{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.ph-controls label{font-size:13px}.ph-doc{border-top:1px solid #e0e8eb;padding:15px 0}.ph-doc h3{font-size:14px;margin:0 0 6px}.ph-notice{font-size:13px;color:#536d79;line-height:1.6}.ph-history{border-left:2px solid #dbe7eb;padding:4px 14px;margin:14px 0}.ph-history strong{font-size:13px}.ph-private{border-left:3px solid #365d70;padding-left:12px}.ph-counts{display:flex;gap:12px;flex-wrap:wrap}.ph-counts span{padding:10px 14px;background:#f0f5f7;border-radius:9px;font-size:13px}.ph-final{border:1px solid #739c8d;background:#f4faf7}.ph-final button{margin-top:12px}.ph-blockers{font-size:13px;color:#8b4c29;line-height:1.8}.ph-link{color:#1e667d;text-decoration:underline;font-size:13px;background:none;border:0;cursor:pointer}.ph-toolbar select{width:auto;min-width:180px}.ph-toolbar input{width:150px}@media(max-width:750px){.ph-grid{grid-template-columns:repeat(2,minmax(120px,1fr))}.ph-card{padding:14px}.ph-header h1{font-size:26px}.ph-tabs button{padding:10px 13px}.ph-toolbar{align-items:stretch}.ph-table th,.ph-table td{padding:10px 8px}.ph-preview{height:480px}}

.ph-request-entry{margin-top:16px;padding:16px;border:1px solid #d7e2df;border-radius:12px;background:#f7faf9}.ph-add-person{margin:16px 0}.ph-add-person>summary{display:inline-block;cursor:pointer}.ph-add-person[open]>summary{margin-bottom:12px}

.ph-add-person>summary{padding:11px 16px;border:1px solid #d7e2df;border-radius:9px;font-weight:600}

.ph-review-toolbar{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:12px 0}.ph-review-choice{display:flex;align-items:center;gap:8px;font-size:13px;margin-top:10px;cursor:pointer}.ph-review-choice input{width:20px;height:20px;accent-color:#204d71;flex:none}.ph-review-selected{background:#e8f5ed}.ph-row-total{grid-column:1/-1;font-size:13px;font-weight:700;color:#204d71}.ph-sickness{padding:12px;border:1px solid #d6e3df;border-radius:9px;background:#f6faf8;margin-top:15px}.ph-sickness select{width:100%;padding:8px;margin:6px 0}

.ph-sickness-pay{display:grid;gap:8px;min-width:140px}.ph-sickness-pay select{width:100%;min-height:38px;border:1px solid #ccd9df;border-radius:7px;background:#fff;padding:8px;font:inherit}.ph-sickness-pay [role=status]{font-size:12px;line-height:1.4}.ph-sickness-pay .ph-success{padding:5px;margin:0}.ph-sickness-pay .ph-error{padding:5px;margin:0}

/* Payroll review uses bounded employee cards, keeping all actions in the viewport. */
#payrollScreen,#phPanel{min-width:0}
.ph-review-list{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
.ph-review-employee{min-width:0;max-width:100%;box-sizing:border-box;border:1px solid #dbe5e9;border-radius:12px;padding:16px;background:#fff;overflow-wrap:anywhere}
.ph-review-employee.ph-review-selected{background:#e8f5ed;border-color:#8bbca2}
.ph-review-employee-header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap}
.ph-review-employee-header h3{margin:0;font-size:17px;color:#173c49}
.ph-review-approval{display:flex;gap:10px;align-items:center;flex-wrap:wrap;min-width:0;max-width:100%}
.ph-review-approval .ph-review-choice{margin:0}
.ph-review-metrics{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin:16px 0}
.ph-review-metrics>div{min-width:0;background:#f3f7f8;border-radius:8px;padding:10px}
.ph-review-metrics dt{font-size:11px;line-height:1.4;color:#58727e}
.ph-review-metrics dd{font-size:18px;font-weight:750;color:#17343e;font-variant-numeric:tabular-nums;margin:5px 0 0}
.ph-review-payroll{display:flex;align-items:flex-start;gap:20px;flex-wrap:wrap;border-top:1px solid #e6edef;padding-top:12px}
.ph-review-pay-choice{flex:0 1 180px;min-width:0;max-width:100%}
.ph-review-pay-choice>strong,.ph-review-summary>strong{display:block;font-size:12px;color:#526b77;margin-bottom:7px}
.ph-review-summary{flex:1 1 240px;min-width:0;max-width:100%}
.ph-review-summary p{font-size:13px;line-height:1.6;margin:0;white-space:pre-line;overflow-wrap:anywhere}
.ph-review-employee .ph-sickness-pay{min-width:0;width:100%;max-width:220px}
.ph-review-employee .ph-sickness-pay select{box-sizing:border-box}
.ph-review-details{min-width:0;max-width:100%;border-top:1px solid #e6edef;padding-top:8px}
.ph-review-details .ph-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr))}
.ph-review-details input,.ph-review-details select,.ph-review-details textarea{box-sizing:border-box;max-width:100%}
@media(max-width:950px){.ph-review-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:520px){.ph-review-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.ph-review-employee{padding:12px}.ph-review-approval{width:100%}.ph-review-pay-choice,.ph-review-summary{flex-basis:100%}}

.ph-confirm-result{margin:14px 0;padding:14px;border:1px solid #cbded5;border-radius:10px;background:#fff}
.ph-confirm-result>strong{display:block;font-size:15px;line-height:1.5}
.ph-confirm-result p{margin:6px 0 0;font-size:13px;line-height:1.5;white-space:pre-line}
.ph-confirm-result.saved{border-color:#75b68e;background:#e5f5eb;color:#205a36}
.ph-confirm-result.error{border-color:#d8a6a6;background:#fff1f1;color:#8e3030}
.ph-confirm-result.working{border-color:#8eafc1;background:#edf6fb;color:#244f69}
.ph-confirm-result a{display:inline-block;margin-top:12px;text-decoration:none}
.ph-confirm-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:14px}
.ph-confirm-actions button{margin-top:0}
.ph-confirm-ack{display:flex;align-items:flex-start;gap:9px;font-size:13px;line-height:1.6}
.ph-confirm-ack input{flex:none;width:19px;height:19px;margin-top:2px}
