:root {
  --bg: #14161a;
  --card: #1c1f26;
  --border: #2a2f3a;
  --text: #e6e8ec;
  --muted: #8b93a1;
  --accent: #4f8cff;
  --ok: #3ecf8e;
  --err: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 1.5rem 1rem 3rem;
  max-width: 720px;
  margin-inline: auto;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

body.centered {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .9rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.login { width: min(360px, 100%); }
.login h1 { margin-bottom: 1.1rem; }

label { display: block; margin-bottom: .8rem; font-size: .82rem; color: var(--muted); }
label small { text-transform: none; font-size: .78em; }

input {
  display: block;
  width: 100%;
  margin-top: .3rem;
  padding: .55rem .7rem;
  background: #10131a;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}
input:focus { outline: none; border-color: var(--accent); }

button {
  padding: .5rem .95rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
button:hover { filter: brightness(1.1); }

.ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.ghost:hover { color: var(--text); border-color: var(--muted); filter: none; }
.danger:hover { color: var(--err); border-color: var(--err); }

.login button, .add > button { width: 100%; margin-top: .3rem; }

.machines { list-style: none; margin: 0; padding: 0; }
.machines li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--border);
}
.machines li:last-child { border-bottom: none; }
.machines li:first-child { padding-top: 0; }

.info { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.info strong { display: block; }
.info small { color: var(--muted); font-size: .78rem; }

.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.off { background: #4a505c; }
.dot.unknown { border: 1px solid #4a505c; }

.actions { display: flex; gap: .4rem; flex: none; }

.flash { padding: .6rem .8rem; border-radius: 8px; font-size: .87rem; margin: 0 0 1rem; }
.flash.ok { background: rgba(62, 207, 142, .12); color: var(--ok); }
.flash.error { background: rgba(255, 107, 107, .12); color: var(--err); }

.empty { color: var(--muted); margin: 0; font-size: .9rem; }

@media (max-width: 520px) {
  .machines li { flex-direction: column; align-items: stretch; }
  .actions button { flex: 1; }
}
