* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 700px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.8rem;
}

h2 {
  margin: 24px 0 12px;
  font-size: 1.2rem;
  color: #aaa;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
}

/* Sensor Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.card {
  background: #16213e;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border: 2px solid #333;
  transition: border-color 0.3s;
}

.card.ok {
  border-color: #00c853;
}

.card.alert {
  border-color: #ff1744;
  background: #2a1020;
}

.card-label {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 8px;
}

.card-value {
  font-size: 2.2rem;
  font-weight: bold;
}

.card-unit {
  font-size: 0.8rem;
  color: #888;
  margin-top: 4px;
}

/* Float Switches */
.floats-section {
  margin-top: 8px;
}

.floats {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.float-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #16213e;
  border-radius: 8px;
}

.float-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #555;
}

.float-indicator.ok .float-dot {
  background: #00c853;
  box-shadow: 0 0 8px #00c853;
}

.float-indicator.triggered .float-dot {
  background: #ff1744;
  box-shadow: 0 0 8px #ff1744;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.last-update {
  text-align: center;
  color: #666;
  font-size: 0.85rem;
  margin-top: 12px;
}

/* Settings */
.settings {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.setting-group {
  background: #16213e;
  border-radius: 10px;
  padding: 16px;
}

.setting-group h3 {
  font-size: 0.95rem;
  color: #ccc;
  margin-bottom: 12px;
}

.setting-group label {
  display: block;
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 10px;
}

.setting-group input {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #0f3460;
  color: #eee;
  font-size: 1rem;
}

.setting-group input:focus {
  outline: none;
  border-color: #00c853;
}

#save-btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  font-size: 1.1rem;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  background: #00c853;
  color: #111;
  cursor: pointer;
  transition: background 0.2s;
}

#save-btn:hover {
  background: #00e676;
}

#save-status {
  text-align: center;
  margin-top: 10px;
  font-size: 0.9rem;
  min-height: 1.2em;
}

/* Responsive */
@media (max-width: 600px) {
  .cards {
    grid-template-columns: 1fr;
  }
  .settings {
    grid-template-columns: 1fr;
  }
  .floats {
    flex-direction: column;
    align-items: center;
  }
}
