@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #c9e5f8;
    font-family: 'Sarabun', sans-serif;
    color: #333;
}

/* Header Styling */
.header {
    background: #c9e5f8;
    padding: 30px 20px;
    width: 100%;
}

.header-content {
    max-width: 1600px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: left;
    gap: 30px;
    flex-wrap: wrap;
}

.logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0px 5px rgba(0, 0, 0, 0.1);
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header h1 {
    font-size: 36px;
    line-height: 1.2;
}

.contact-info {
    font-size: 18px;
    color: #444;
    font-weight: 500;
}

/* Container & Table Layout */
.container {
    max-width: 1600px;
    margin: -20px auto 40px auto;
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.thead {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 0px;
    font-weight: bold;
}

.thead div {
    background: #efefef;
    padding: 15px;
    text-align: center;
    font-size: 20px;
}

.row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 0px;
    margin-top: 0px;
    align-items: center;
}

.row div {
    border-bottom: 1px solid #eee;
    padding: 0px 10px;
    min-height: 47px;
    display: flex;
    align-items: center;
}

/* Align text for columns */
.row div:nth-child(1) {
    font-weight: bold;
	justify-content: center;
}

.row div:nth-child(2) {
    color: #919191;
}

.row div:nth-child(3) {
	color: #919191;
    justify-content: center;
}

/* Status Badge Styles */
.status-cell {
    justify-content: center;
}

.status-badge {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 16px;
}

/* สีสถานะงาน */
.status-sent {
    background-color: #a8dfb5;
    color: #17951a;
} /* ส่งแล้ว - เขียว */

.status-reserved {
    background-color: #ffeaaa;
    color: #817316;
} /* จอง - เหลือง */

.status-working {
    background-color: #b9ceff;
    color: #4174cf;
} /* กำลังทำ - ฟ้า */

.status-edit {
    background-color: #b89fe7;
    color: #7050a5;
} /* แก้ - ม่วง */

.status-draft {
    background-color: #dbdeeb;
    color: #797685;
} /* ส่งร่าง - เทา */

.status-feedback {
    background-color: #b5b5b5;
    color: #616161;
} /* รอฟีดแบ็ค - น้ำเงินเข้ม */

.status-pause {
    background-color: #ffc1c7;;
    color: #ff3131;
} /* พักทำ - แดง */

.status-brief {
    background-color: #343a40;
    color: #ffffff;
} /* รอบรีพ - เทาเข้ม */

/* Summary Cards Section */
.summary-cards {
	display: flex;
    gap: 20px;
    margin-bottom: 25px;
    align-items: stretch;
}

.card {
	min-width: 200px;
    background: #ffffff;
    border-radius: 10px;
    padding: 15px 20px;
    text-align: center;
    box-shadow: 0 0px 4px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    color: #555;
    margin-bottom: 8px;
}

.card-value {
    font-size: 36px;
    font-weight: bold;
    color: #222;
}

.search-box {
    flex: 1; /* กินพื้นที่ที่เหลือของบรรทัด */
    background: #ffffff;
    border-radius: 16px;
    padding: 15px 20px;
    box-shadow: 0 0px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.search-box label {
    font-size: 18px;
    font-weight: bold;
    color: #555;
    margin-bottom: 8px;
}

.search-box input {
    width: 100%;
    padding: 10px 14px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: #17a2b8;
}

/* ตกแต่งกล่อง Dropdown */
.filter-box {
    flex: 1;
    background: #ffffff;
    border-radius: 16px;
    padding: 15px 20px;
    box-shadow: 0 0px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.filter-box label {
    font-size: 18px;
    font-weight: bold;
    color: #555;
    margin-bottom: 8px;
}

.filter-box select {
    width: 100%;
    padding: 10px 14px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-box select:focus {
    border-color: #17a2b8;
}

/* Styling สำหรับ Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.pagination button {
    background-color: #ffffff;
    border: 1px solid #cccccc;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.pagination button:hover:not(:disabled) {
    background-color: #17a2b8;
    color: #ffffff;
    border-color: #17a2b8;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination #page-info {
    font-size: 15px;
    font-weight: bold;
    color: #444444;
}


/* Responsive Design (สำหรับมือถือและแท็บเล็ต) */
@media (max-width: 992px) {
    .header h1 {
        font-size: 28px;
    }
    
    .contact-info {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
	/* ป้องกันหน้าจอเลื่อนซ้าย-ขวา */
    html, body {
        overflow-x: hidden;
        width: 100%;
    }
	
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

	/* ปรับ Container ให้เต็มความกว้างจอ และจัดกึ่งกลาง */
    .container {
        width: 100%;
        max-width: 100%;
        padding: 15px;
        margin: 0 auto 30px auto;
        border-radius: 15px; /* หรือปรับเป็น 15px หากต้องการมุมโค้ง */
    }

    .thead {
        display: none; /* ซ่อนหัวตารางบนมือถือ */
    }

/* ปรับแถวข้อมูลให้ขยายเต็มความกว้าง */
    .row {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 8px;
        margin-top: 15px;
        background: #ffffff;
        padding: 15px;
        border-radius: 15px;
        border: 1px solid #e0e0e0;
    }

    .row div {
        border-bottom: none;
        padding: 4px 0;
        min-height: auto;
        width: 100%;
        justify-content: flex-start !important;
    }

    /* เพิ่ม Label บอกหัวข้อในมือถือ */
    .row div::before {
        font-weight: bold;
        margin-right: 10px;
        min-width: 90px;
        color: #666;
    }

    .row div:nth-child(1)::before { content: "ชื่อลูกค้า:"; }
    .row div:nth-child(2)::before { content: "ประเภทงาน:"; }
    .row div:nth-child(3)::before { content: "การชำระเงิน:"; }
    .row div:nth-child(4)::before { content: "สถานะงาน:"; }
	
	.status-cell {
        justify-content: flex-start !important;
    }

    .status-badge {
        width: auto;
        padding: 6px 16px;
    }
	
	.summary-cards {
        flex-direction: column;
        gap: 12px;
    }
    
    .card {
        padding: 15px;
    }

    .card-title {
        font-size: 16px;
    }

    .card-value {
        font-size: 28px;
    }
	
	.search-box {
        width: 100%;
        padding: 15px;
    }

    .search-box label {
        font-size: 16px;
    }
	
	.filter-box {
        width: 100%;
        padding: 15px;
    }

    .filter-box label {
        font-size: 16px;
    }
}