:root {
  --bg: #faf9f8;
  --panel: #ffffff;
  --border: #e1dfdd;
  --text: #201f1e;
  --muted: #605e5c;
  --accent: #0078d4;
  --accent-dark: #106ebe;
  --warn-bg: #fff4ce;
  --ok: #107c10;
  --off: #a19f9d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}

.brand { font-weight: 600; font-size: 16px; }

.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar nav a { color: var(--accent); text-decoration: none; }
.topbar nav a:hover { text-decoration: underline; }

.container { max-width: 960px; margin: 24px auto; padding: 0 24px; }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 24px;
}

h1 { font-size: 22px; margin: 0 0 16px; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: #f3f2f1; font-weight: 600; }
tr:last-child td { border-bottom: none; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.pill.on { background: #dff6dd; color: var(--ok); }
.pill.off { background: #f3f2f1; color: var(--off); }

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
}
.btn:hover { background: #f3f2f1; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { color: #a4262c; border-color: #a4262c; }
.btn.danger:hover { background: #fde7e9; }

.actions { display: flex; gap: 8px; }
form.inline { display: inline; margin: 0; }
button.link { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 14px; padding: 0; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field input[type=text], .field input[type=password], .field input[type=datetime-local], .field textarea, .field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}
.field textarea { min-height: 70px; resize: vertical; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }

.form-actions { display: flex; gap: 12px; margin-top: 24px; }
.validation { color: #a4262c; margin-bottom: 16px; }
.empty { color: var(--muted); padding: 32px; text-align: center; }

.login-wrap { max-width: 360px; margin: 80px auto; }
