body {
  font-family: Arial, sans-serif;
  margin: 0; padding: 0;
  background: #f5f5f5;
  color: #333;
}

header, nav, main {
  padding: 1em;
}

header {
  background: #0b6efd;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-controls button {
  margin-left: 10px;
  padding: 6px 12px;
  font-size: 0.9em;
  cursor: pointer;
}

nav {
  background: #eee;
  display: flex;
  gap: 1em;
  margin-bottom: 1em;
}

nav button.tab {
  background: none;
  border: none;
  padding: 0.5em 1em;
  font-size: 1em;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

nav button.tab.active {
  border-bottom: 2px solid #0b6efd;
  font-weight: bold;
}

.panel {
  display: block;
}

.panel.hidden {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
  gap: 1em;
}

.card {
  background: white;
  border-radius: 6px;
  padding: 1em;
  box-shadow: 0 2px 5px rgb(0 0 0 / 0.1);
}

.card.big {
  grid-column: span 2;
}

.val {
  font-size: 2em;
  font-weight: bold;
  margin: 0.5em 0;
}

.btnRow {
  display: flex;
  gap: 1em;
  margin: 0.5em 0;
}

button {
  cursor: pointer;
  background: #0b6efd;
  color: white;
  border: none;
  padding: 0.5em 1em;
  border-radius: 4px;
  font-size: 1em;
  transition: background-color 0.3s ease;
}

button:hover {
  background: #094ecf;
}

button.active {
  background: #ffc107;
  color: black;
}

.status-on {
  color: green;
  font-weight: bold;
}

.status-off {
  color: red;
  font-weight: bold;
}

/* LED icon styles */
.led-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  cursor: default;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
  vertical-align: middle;
}

/* ON = สีเหลือง */
.led-icon.on {
  filter: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="yellow" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 21h6v-1H9v1zm3-18C9.14 3 6 6.14 6 10c0 2.34 1.56 4.31 3.75 4.84V16h4.5v-1.16c2.19-.53 3.75-2.5 3.75-4.84 0-3.86-3.14-7-7-7z"/></svg>');
}

/* OFF = สีเทา */
.led-icon.off {
  filter: grayscale(100%);
  background-image: url('data:image/svg+xml;utf8,<svg fill="gray" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 21h6v-1H9v1zm3-18C9.14 3 6 6.14 6 10c0 2.34 1.56 4.31 3.75 4.84V16h4.5v-1.16c2.19-.53 3.75-2.5 3.75-4.84 0-3.86-3.14-7-7-7z"/></svg>');
}

/* Other styling for settings etc. */
.settings label {
  display: block;
  margin-bottom: 0.5em;
}

.settings input[type=number], .settings input[type=time] {
  width: 80px;
  margin-left: 0.5em;
}

.schedAdd {
  margin-top: 0.5em;
  margin-bottom: 1em;
}

.del {
  margin-left: 1em;
  color: red;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 0.9em;
}

/* ปุ่มที่ disabled จะจางและกดไม่ได้ */
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
