/* CSS สำหรับสลิปเงินเดือนรูปแบบใหม่ */
.slip-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    font-family: 'Sarabun', 'TH Sarabun New', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #000;
    border: 2px solid #000;
}

.slip-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #000;
}

.slip-title-section h1 {
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 8px 0;
    letter-spacing: 0.5px;
}

.slip-title-section h2 {
    font-size: 14px;
    font-weight: bold;
    margin: 0;
}

.slip-employee-details {
    margin-bottom: 25px;
    font-size: 13px;
}

.detail-row {
    display: flex;
    margin-bottom: 8px;
    align-items: baseline;
}

.detail-label {
    font-weight: normal;
    margin-right: 10px;
}

.detail-value {
    font-weight: normal;
    margin-right: 15px;
}

.slip-table-section {
    margin-bottom: 30px;
}

.slip-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    font-size: 13px;
    border: 2px solid #000;
}

.slip-table th {
    border: none;
    border-bottom: 1px solid #000;
    border-right: 1px solid #000;
    padding: 8px;
    font-weight: bold;
    background: white;
}

.slip-table th:first-child {
    width: 70%;
    text-align: center;
}

.slip-table th:last-child {
    width: 30%;
    text-align: center;
    border-right: none;
}

.slip-table td {
    border: none;
    border-right: 1px solid #000;
    padding: 6px 8px;
    vertical-align: top;
}

.slip-table td:last-child {
    border-right: none;
}

.slip-table td:first-child {
    width: 70%;
}

.slip-table td:last-child {
    width: 30%;
}

.slip-table td:first-child {
    text-align: left;
}

.slip-table td.amount {
    text-align: right;
    font-family: 'Sarabun', 'TH Sarabun New', Arial, sans-serif;
}

.slip-table tbody tr td {
    border-bottom: none;
}

.slip-table .total-row td {
    font-weight: bold;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    border-right: 1px solid #000;
}

.slip-table .total-row td:last-child {
    border-right: none;
}

.slip-table .net-row td {
    font-weight: bold;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    border-right: 1px solid #000;
}

.slip-table .net-row td:last-child {
    border-right: none;
}

.deduction-table {
    margin-top: 0;
    border-top: none;
    border-left: 2px solid #000;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
}

.deduction-table tr:first-child td {
    border-top: none;
}

.slip-signature-section {
    margin: 40px 0 30px 0;
    text-align: center;
}

.signature-line {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
}

.signature-space {
    width: 200px;
    border-bottom: 1px solid #000;
    height: 20px;
    margin: 0 10px;
}

.slip-footer {
    margin-top: 30px;
}

.footer-info {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 13px;
}

.footer-info span {
    margin-right: 15px;
}

/* การจัดรูปแบบสำหรับการพิมพ์ */
@media print {
    .slip-container {
        max-width: none;
        margin: 0;
        padding: 20px;
        border: 2px solid #000;
        box-shadow: none;
    }
    
    .slip-table {
        font-size: 12px;
    }
    
    .slip-table th,
    .slip-table td {
        padding: 4px 6px;
    }
    
    body {
        margin: 0;
        padding: 0;
    }
    
    /* ซ่อนปุ่มต่างๆ เมื่อพิมพ์ */
    .btn, button {
        display: none !important;
    }
}

/* ปรับขนาดสำหรับหน้าจอเล็ก */
@media (max-width: 768px) {
    .slip-container {
        padding: 20px 15px;
        margin: 10px;
    }
    
    .slip-title-section h1 {
        font-size: 14px;
    }
    
    .slip-title-section h2 {
        font-size: 12px;
    }
    
    .slip-table {
        font-size: 12px;
    }
    
    .slip-table th,
    .slip-table td {
        padding: 4px 6px;
    }
    
    .detail-row {
        flex-wrap: wrap;
        font-size: 12px;
    }
    
    .footer-info {
        flex-wrap: wrap;
        font-size: 12px;
    }
    
    .signature-space {
        width: 150px;
    }
}

/* CSS สำหรับลายเซ็น */
.slip-signature-section {
    margin-top: 30px;
    text-align: center;
}

.signature-container {
    margin-bottom: 15px;
}

.signature-image-wrapper {
    display: inline-block;
    margin-bottom: 5px;
}

.signature-image {
    width: 200px !important;
    height: 80px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
    background: transparent !important;
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: crisp-edges !important;
    filter: contrast(1.2) !important;
}

.signature-underline {
    width: 200px !important;
    border-bottom: 1px solid #000 !important;
    margin: 5px auto !important;
    height: 1px !important;
}

.payee-info {
    margin-top: 10px;
}

.payee-info p {
    margin: 5px 0 !important;
    font-size: 12px !important;
    font-weight: normal !important;
    color: #000 !important;
}

/* สำหรับการพิมพ์ */
@media print {
    .signature-image {
        width: 180px !important;
        height: 70px !important;
        object-fit: contain !important;
        filter: contrast(1.5) brightness(0.8) !important;
        image-rendering: -webkit-optimize-contrast !important;
    }
    
    .signature-underline {
        border-bottom: 1px solid #000 !important;
    }
    
    .payee-info p {
        font-size: 11px !important;
    }
}