/* ========================
   พื้นหลัง + ฟอนต์
======================== */
body {
  font-family: 'Segoe UI', sans-serif;
  background: #303030;
  margin: 0;
  padding: 0;
}

/* ========================
   กล่องหลัก
======================== */
.dashboard-container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* ========================
   ปุ่มหลัก
======================== */
.button {
  display: inline-block;
  padding: 10px 16px;
  background: #505050;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  margin-right: 5px;
}

.button:hover {
  background: #303030;
}

.button.danger {
  background: #444444;
}

.button.danger:hover {
  background: #222;
}

.button.small {
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 8px;
}

/* ========================
   ตาราง
======================== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  table-layout: auto;
}

th, td {
  padding: 12px;
  text-align: center;
  border: 1px solid #ddd;
}

th:last-child,
td:last-child {
  min-width: 380px;
}

/* ========================
   กลุ่มปุ่มในตาราง
======================== */
.action-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.inline-form input {
  width: 65px;
  padding: 5px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* ========================
   ปุ่มใน inline form
======================== */
.inline-form button {
  padding: 5px 10px;
  background-color: #505050;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.inline-form button:hover {
  background-color: #303030;
}

/* ปุ่มลบใน inline-form */
.inline-form button[name="action"][value="delete"] {
  background-color: #A52A2A;
}

.inline-form button[name="action"][value="delete"]:hover {
  background-color: #8B0000;
}

/* ========================
   ฟอร์มเพิ่มอาหาร/วัตถุดิบ
======================== */
#addForm input {
  margin: 5px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

#addForm button {
  padding: 6px 12px;
  margin: 5px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  background: #505050;
  color: white;
  cursor: pointer;
}

#addForm button:hover {
  background-color: #303030;
}


/* ========================
   กล่อง login
======================== */
.login-container {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  text-align: center;
  width: 300px;
  margin: 100px auto;
}

.login-container input {
  width: 94%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 10px;
}

.login-container button {
  width: 100%;
  padding: 10px;
  background: #505050;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
}

.login-container button:hover {
  background: #303030;
}

.error {
  color: red;
  margin-bottom: 1rem;
}

/* ปรับหัวเรื่อง */
.dashboard-container h2 {
  font-size: 24px;
  margin-bottom: 20px;
}

/* ปุ่มกลับ + ปุ่มเคลียร์ */
.dashboard-container .button {
  margin-right: 10px;
}

/* ตารางพนักงาน */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

table thead {
  background-color: #f2f2f2;
}

table th, table td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #ddd;
}

table input[type="text"],
table input[type="number"],
table select {
  width: 60%;
  padding: 10px;
  box-sizing: border-box;
  font-size: 14px;
}

/* ปุ่มเล็ก */
.button.small {
  padding: 6px 12px;
  font-size: 14px;
}

/* ปุ่มลบ */
.button.danger {
  background-color: #A52A2A;
}

.button.danger:hover {
  background-color: #8B0000;
}

/* ส่วนเพิ่มพนักงาน */
form input[type="text"],
form input[type="password"],
form select {
  margin-right: 10px;
  padding: 8px;
  font-size: 14px;
}

form button {
  margin-top: 10px;
}

/* จัดแนวหัวข้อ */
h3 {
  margin-top: 30px;
  font-size: 20px;
  display: flex;
  align-items: center;
}

h3::before {
  content: "";
  margin-right: 8px;
  color: #7f8c8d;
}

<style>
  .edit-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
  }

  .edit-form label {
    font-weight: bold;
  }

  .edit-form input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    min-width: 120px;
  }

  .edit-form button {
    background-color: #d9534f;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
  }

  .edit-form button:hover {
    background-color: #c9302c;
  }

  .edit-form .back-button {
    background-color: #5a5a5a;
  }

  .edit-form .back-button:hover {
    background-color: #444;
  }
</style>

