:root {
  --bg: #e8eef4;
  --bg2: #d5e0ea;
  --ink: #1a2332;
  --muted: #5a6a7a;
  --panel: #f7fafc;
  --line: #c5d0db;
  --accent: #0b6e4f;
  --accent-hover: #095a41;
  --off: #8a3b2d;
  --on: #0b6e4f;
  --error: #9b1c1c;
  --shadow: 0 12px 40px rgba(26, 35, 50, 0.08);
  --radius: 10px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, #cfe0d8 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 100%, #c9d6e8 0%, transparent 50%),
    linear-gradient(160deg, var(--bg), var(--bg2));
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

h1 {
  margin: 0 0 0.35rem;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0;
  font-size: 1.1rem;
}

.muted {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

label {
  display: block;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
}

input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: #fff;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 0.7rem 1.1rem;
  background: var(--accent);
  color: #fff;
}

button:hover {
  background: var(--accent-hover);
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.ghost:hover {
  background: #eef3f7;
}

.error {
  color: var(--error);
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.status-block {
  text-align: center;
  padding: 1.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  background: #fff;
}

.status-block .label {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status {
  margin: 0.4rem 0 1rem;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status.on {
  color: var(--on);
}

.status.off {
  color: var(--off);
}

.history-block h2 {
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

th {
  background: #eef3f7;
  font-weight: 600;
}

tbody tr:last-child td {
  border-bottom: none;
}

@media (max-width: 560px) {
  .bar {
    flex-direction: column;
    align-items: stretch;
  }

  .status {
    font-size: 2rem;
  }
}
