:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #dde2e8;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 20px 28px;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
  margin: 0 0 6px;
}

p {
  color: #687486;
  margin: 0;
}

.controls {
  display: flex;
  gap: 10px;
}

input,
button {
  border: 1px solid #c7d0db;
  border-radius: 6px;
  font: inherit;
  height: 38px;
}

input {
  min-width: 220px;
  padding: 0 12px;
}

button {
  background: #216e5f;
  color: #ffffff;
  cursor: pointer;
  padding: 0 16px;
}

main {
  padding: 24px 28px;
}

.stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  margin-bottom: 18px;
}

.stats div {
  background: #ffffff;
  border: 1px solid #dde2e8;
  border-radius: 8px;
  padding: 16px;
}

.stats span {
  display: block;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.stats label {
  color: #687486;
  display: block;
  margin-top: 8px;
}

.table-wrap {
  background: #ffffff;
  border: 1px solid #dde2e8;
  border-radius: 8px;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 860px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #eef1f4;
  padding: 14px 16px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #526071;
  font-size: 13px;
  font-weight: 700;
}

.badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}

.online {
  background: #dff5ec;
  color: #12664f;
}

.offline {
  background: #edf0f4;
  color: #5b6778;
}

.active {
  color: #12664f;
  font-weight: 700;
}

.idle {
  color: #a46000;
  font-weight: 700;
}

.empty,
.error {
  color: #687486;
  text-align: center;
}

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

  .controls {
    flex-direction: column;
  }

  input,
  button {
    width: 100%;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  main {
    padding: 18px;
  }
}
