/* CSS สำหรับตารางแสดงข้อมูลเงินเดือน */
.salary-table-header {
    text-align: center;
    margin-bottom: 20px;
    background: white;
    padding: 25px 20px;
    border-radius: 0;
    border-bottom: 1px solid #dee2e6;
}

.salary-table-header h3 {
    margin: 0 0 8px 0;
    font-size: 1.8rem;
    color: #333;
    font-weight: 700;
}

.salary-table-header p {
    margin: 0;
    color: #555;
    font-size: 1.1rem;
    font-weight: 500;
}

.salary-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 18px;
    background: white;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #dee2e6;
}

.salary-filter label {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.salary-filter select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    width: 80px;
    text-align: center;
}

.salary-filter span {
    font-weight: 500;
    color: #333;
    font-size: 16px;
}

.salary-filter button {
    padding: 8px 20px;
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.salary-filter button:hover {
    background: #5a6268;
    border-color: #5a6268;
}

.salary-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    border: 1px solid #dee2e6;
    border-top: none;
}

.salary-data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 15px;
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

.salary-data-table thead {
    background: #f8f9fa;
}

.salary-data-table th {
    padding: 12px 15px;
    text-align: center;
    font-weight: 600;
    color: #333;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    font-size: 14px;
    line-height: 1.3;
    vertical-align: middle;
    letter-spacing: 0.3px;
}

.salary-data-table td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid #dee2e6;
    background: white;
    font-size: 14px;
    vertical-align: middle;
    transition: background-color 0.2s ease;
}

.salary-data-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.salary-data-table tbody tr:hover {
    background: #e8f4fd;
}

/* จัดรูปแบบคอลัมน์ตัวเลข */
.salary-data-table td.number-format {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    padding-right: 8px;
}

/* ปุ่มพิมพ์ */
.print-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.print-btn:hover {
    background: #218838;
}

.print-btn i {
    font-size: 8px;
}

/* ส่วนปุ่มพิมพ์ใบรับรองภาษีด้านล่างตาราง */
.tax-cert-dashboard-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #dee2e6;
}

.tax-cert-controls-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tax-cert-controls-inline label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.tax-cert-controls-inline .fiscal-year-dropdown {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    min-width: 100px;
}

.tax-cert-controls-inline #print-tax-cert-dashboard {
    padding: 8px 16px;
    font-size: 14px;
}

/* กำหนดความกว้างคอลัมน์สำหรับตารางแบบง่าย */
.salary-data-table th:nth-child(1) { width: 12%; } /* ปี พ.ศ. */
.salary-data-table th:nth-child(2) { width: 20%; } /* เดือน */
.salary-data-table th:nth-child(3) { width: 20%; } /* รายรับ */
.salary-data-table th:nth-child(4) { width: 20%; } /* รายจ่าย */
.salary-data-table th:nth-child(5) { width: 20%; } /* รับสุทธิ */
.salary-data-table th:nth-child(6) { width: 8%; }  /* พิมพ์สลิป */

/* Responsive Design */
@media (max-width: 1024px) {
    .salary-data-table {
        font-size: 13px;
    }
    
    .salary-data-table th,
    .salary-data-table td {
        padding: 10px 8px;
    }
    
    .print-btn {
        padding: 6px 12px;
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    .salary-filter {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .salary-filter > * {
        width: 100%;
        max-width: none;
    }
    
    .salary-table-container {
        margin: 0 -15px;
        border-radius: 0;
    }
    
    .salary-data-table {
        font-size: 12px;
        border-radius: 0;
    }
    
    .salary-data-table th {
        padding: 12px 6px;
        font-size: 11px;
        line-height: 1.2;
    }
    
    .salary-data-table td {
        padding: 10px 6px;
    }
    
    .print-btn {
        padding: 6px 10px;
        font-size: 10px;
        border-radius: 15px;
    }
    
    /* ซ่อนบางคอลัมน์ในมือถือเพื่อให้พอดี */
    .salary-data-table th:nth-child(1),
    .salary-data-table td:nth-child(1) {
        display: none; /* ซ่อนปี พ.ศ. */
    }
    
    /* ปรับขนาดคอลัมน์สำหรับมือถือ */
    .salary-data-table th:nth-child(2) { width: 25%; } /* เดือน */
    .salary-data-table th:nth-child(3) { width: 22%; } /* รวมรายรับ */
    .salary-data-table th:nth-child(4) { width: 22%; } /* รวมรายจ่าย */
    .salary-data-table th:nth-child(5) { width: 22%; } /* รับสุทธิ */
    .salary-data-table th:nth-child(6) { width: 9%; }  /* พิมพ์สลิป */
}

@media (max-width: 480px) {
    .salary-table-header h3 {
        font-size: 1.2rem;
    }
    
    .salary-data-table {
        font-size: 11px;
    }
    
    .salary-data-table th {
        padding: 10px 4px;
        font-size: 10px;
    }
    
    .salary-data-table td {
        padding: 8px 4px;
    }
    
    .print-btn {
        padding: 4px 8px;
        font-size: 9px;
        border-radius: 12px;
    }
    
    .print-btn i {
        display: none; /* ซ่อนไอคอนในหน้าจอเล็กมาก */
    }
    
    /* จัดตัวเลขให้อ่านง่ายในมือถือ */
    .salary-data-table td.number-format {
        font-size: 10px;
        font-weight: 600;
    }
}

/* สีสำหรับแถวข้อมูล */
.salary-data-table tbody tr {
    transition: background-color 0.2s;
}

/* การจัดรูปแบบตัวเลข */
.number-format {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 400;
    color: #333;
    text-align: right;
}

/* จัดรูปแบบตัวเลขให้เหมือนในรูป */
.salary-data-table td.number-format {
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 400;
    padding-right: 20px;
}

/* สไตล์พิเศษสำหรับคอลัมน์รับสุทธิ */
.salary-data-table td.net-salary {
    font-weight: 600;
    color: #333;
}

/* สไตล์สำหรับ header แบบ 2 แถว */
.salary-data-table thead tr:first-child th {
    background: #e9ecef;
    font-weight: 700;
    border-bottom: 2px solid #adb5bd;
}

.salary-data-table thead tr:last-child th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 10px;
}