/* PR Form Styles - exact replica of the paper form */
.pr-form {
    font-family: 'Sarabun', 'Inter', sans-serif;
    font-size: 11px;
    color: #000;
    background: #fff;
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
}
.pr-form * {
    box-sizing: border-box;
}

/* Header */
.pr-header {
    text-align: center;
    margin-bottom: 4px;
}
.pr-header h1 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}
.pr-header .pr-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 2px;
}
.pr-header .pr-title-row h2 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}
.pr-num-label {
    font-size: 12px;
    font-weight: 700;
}
.pr-num-box {
    display: inline-flex;
    gap: 1px;
}
.pr-num-box span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 24px;
    border: 1px solid #000;
    font-size: 13px;
    font-weight: 700;
    font-family: monospace;
}
.pr-num-box .pr-sep {
    border: none;
    width: 8px;
}

/* Info row */
.pr-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin: 6px 0 4px 0;
    font-size: 11px;
    flex-wrap: wrap;
    gap: 4px;
}
.pr-info-left {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
}
.pr-info b {
    font-weight: 700;
}
.pr-info .pr-dotted {
    border-bottom: 1px dotted #000;
    min-width: 80px;
    display: inline-block;
    padding: 0 4px;
}
.pr-date-box {
    display: inline-flex;
    border: 2px solid #c00;
    padding: 2px 8px;
    min-width: 80px;
    font-weight: 700;
}
.pr-date-input {
    border: none;
    outline: none;
    font-size: 11px;
    font-family: monospace;
    width: 80px;
    background: transparent;
}

/* Type checkboxes */
.pr-type-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 4px 0 6px 0;
    font-size: 11px;
    flex-wrap: wrap;
}
.pr-type-row b {
    margin-right: 4px;
}
.pr-type-row label {
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
}
.pr-type-row input[type="radio"] {
    width: 13px;
    height: 13px;
    margin: 0;
}

/* Main Table */
.pr-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 10px;
    margin-bottom: 0;
}
.pr-table .pr-col-num {
    width: 3%;
}
.pr-table .pr-col-product {
    width: 19.5%;
}
.pr-table .pr-col-express {
    width: 9.4%;
}
.pr-table .pr-col-unit {
    width: 4%;
}
.pr-table .pr-col-qty,
.pr-table .pr-col-price {
    width: 4.4%;
}
.pr-table .pr-col-request-qty {
    width: 5.6%;
}
.pr-table .pr-col-last-qty {
    width: 4.2%;
}
.pr-table .pr-col-last-price {
    width: 5.6%;
}
.pr-table .pr-col-unit-price {
    width: 5.6%;
}
.pr-table .pr-col-discount {
    width: 5%;
}
.pr-table .pr-col-total {
    width: 4.8%;
}
.pr-table .pr-col-stock {
    width: 5%;
}
.pr-table .pr-col-need-date {
    width: 8.2%;
}
.pr-table .pr-col-last-date {
    width: 8.2%;
}
.pr-table .pr-col-vendor,
.pr-table .pr-col-po {
    width: 6.3%;
}
.pr-table .pr-col-po {
    width: 5.3%;
}
.pr-table th,
.pr-table td {
    border: 1px solid #000;
    padding: 3px 4px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pr-table thead th {
    background: #f8f8f8;
    font-weight: 700;
    font-size: 9.5px;
}
.pr-table tbody td {
    height: 22px;
    font-size: 10.5px;
}
.pr-table tbody tr:hover {
    background: #fafafa;
}
.pr-table .row-num {
    font-weight: 700;
}
.pr-table .col-product {
    text-align: left;
    padding-left: 6px;
}
.pr-table .col-express {
    font-family: monospace;
}
.pr-table .total-row td {
    font-weight: 700;
    background: #f8f8f8;
}

/* Vendor input inside table and generic pr-input */
.pr-vendor-input,
.pr-input {
    border: none;
    outline: none;
    width: 100%;
    text-align: inherit;
    font-size: 10.5px;
    background: transparent;
    font-family: inherit;
    padding: 0;
    margin: 0;
}
.pr-input:focus {
    background: #f5f3ff;
    outline: 1px solid #8f7ff2;
}
.col-qty .pr-input,
.col-price .pr-input {
    text-align: right;
}

/* Footer */
.pr-footer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}
.pr-footer-table td {
    border: 1px solid #000;
    padding: 4px 6px;
    vertical-align: top;
}
.pr-footer-table .sig-cell {
    text-align: center;
    font-weight: 700;
    width: 90px;
    height: 40px;
    vertical-align: middle;
}
.pr-footer-table .remark-cell {
    text-align: left;
}
.pr-footer-table .remark-cell b {
    font-weight: 700;
}

.pr-footer-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #555;
    margin-top: 4px;
    padding: 0 2px;
}
.pr-footer-bottom .right {
    font-weight: 700;
    color: #000;
}

/* PFS-PR additions: fields that are filled in on screen but print as plain text */
.pr-form .pr-dept-select {
    font: inherit;
    font-weight: 700;
    border: 1px solid #6c5ce7;
    border-radius: 3px;
    background: #f3f0ff;
    padding: 1px 4px;
    min-width: 150px;
}
.pr-form .pr-code-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid #000;
    font-family: monospace;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .5px;
}
.pr-form .pr-code-box.is-draft {
    border-style: dashed;
    color: #475569;
}
.pr-form .pr-code-box small {
    font-family: 'Sarabun', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #b45309;
    letter-spacing: 0;
}
.pr-input[type="date"] {
    font-size: 10px;
    text-align: center;
}
.pr-input[type="date"]::-webkit-calendar-picker-indicator {
    margin: 0;
    padding: 0;
    width: 10px;
}
.pr-input[type="date"].is-empty:not(:focus) {
    color: transparent;
}
.pr-input[type="date"].is-empty:not(:focus)::-webkit-calendar-picker-indicator,
.pr-form.is-readonly .pr-input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
}
.pr-table tbody tr:hover .pr-input[type="date"].is-empty::-webkit-calendar-picker-indicator {
    opacity: .5;
}
.pr-form textarea.pr-remark {
    width: calc(100% - 58px);
    min-height: 42px;
    border: none;
    outline: none;
    resize: none;
    vertical-align: top;
    background: transparent;
    font: inherit;
    line-height: 1.35;
    padding: 1px 2px;
}
.pr-form textarea.pr-remark:focus {
    background: #f5f3ff;
    outline: 1px solid #8f7ff2;
}
.pr-form.is-readonly .pr-input:focus,
.pr-form.is-readonly textarea.pr-remark:focus {
    background: transparent;
    outline: none;
}
