body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  background: #f4f4f4;
  color: #333;
  margin: 0;
}

.container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1,
h2 {
  color: #1a1a1a;
}

nav {
  background: #333;
  padding: 1rem;
  text-align: center;
}

nav a {
  color: #fff;
  text-decoration: none;
  margin: 0 15px;
  font-weight: bold;
}

nav a:hover {
  text-decoration: underline;
}

.content-area {
  margin-top: 2rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input[type="text"],
input[type="file"] {
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

button,
input[type="submit"] {
  background: #007bff;
  color: #fff;
  border: none;
  padding: 0.8rem 1.2rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover,
input[type="submit"]:hover {
  background: #0056b3;
}

.error {
  color: #d9534f;
  background: #f2dede;
  padding: 1rem;
  border: 1px solid #ebccd1;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.success {
  color: #3c763d;
  background: #dff0d8;
  padding: 1rem;
  border: 1px solid #d6e9c6;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.device-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.device-table th,
.device-table td {
  padding: 0.8rem;
  border: 1px solid #ddd;
  text-align: left;
}

.device-table th {
  background: #f9f9f9;
}

.device-table input[type="text"] {
  width: 90%;
}

.device-table input[type="checkbox"] {
  transform: scale(1.5);
}

.capabilities-cell {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.capabilities-cell label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-hint {
  font-size: 0.9rem;
  color: #666;
  margin-top: -0.5rem;
  /* Pulls it a bit closer to the input above */
}

footer {
  text-align: center;
  padding: 2rem 0;
  margin-top: 2rem;
  color: #666;
  font-size: 0.9rem;
  border-top: 1px solid #eee;
}

footer a {
  color: #007bff;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.mt-2 {
  margin-top: 2rem;
}

.warning {
  color: #856404;
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.save-changes-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.save-actions-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

/* Override the default warning style when it's inside our new bar */
.save-actions-bar .warning {
  margin: 0; /* Remove bottom margin */
  padding: 0.6rem 1rem; /* Make it slightly shorter to match the button height */
  flex-grow: 1; /* Allow the warning to fill the remaining space */
}

.icon-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button:hover {
  background: #f0f0f0;
  border-radius: 50%;
}

.icon-plus,
.icon-minus {
  display: block;
  width: 20px;
  height: 20px;
  position: relative;
}

.icon-plus::before,
.icon-plus::after,
.icon-minus::before {
  content: '';
  position: absolute;
  background-color: #333;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.icon-minus::before {
  width: 14px;
  height: 2px;
}

.icon-plus::before {
  width: 14px;
  height: 2px;
}

.icon-plus::after {
  width: 2px;
  height: 14px;
}

.device-icon {
  font-size: 1.5rem;
  cursor: pointer;
  user-select: none;
}

.type-icon::before {
  font-family: 'Arial';
}

.type-light::before {
  content: '💡';
}

.type-switch::before {
  content: '🔌';
}

.type-thermostat::before {
  content: '🌡️';
}

/* Review Page Styles */
.review-table .diff-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.review-table .old-value {
  text-decoration: line-through;
  color: #d9534f;
}

.review-table .new-value {
  font-weight: bold;
  color: #3c763d;
}

.review-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}

.review-actions .primary {
  background-color: #28a745;
}

.review-actions .primary:hover {
  background-color: #218838;
}

.empty-table-message-row td {
  text-align: center !important;
  color: #666;
  font-style: italic;
  padding: 1.5rem !important;
}