:root {
  color-scheme: dark;
  --bg: #06080c;
  --card: #141b24;
  --text: #f4f7fb;
  --muted: #8e98a6;
  --line: rgba(255, 255, 255, 0.06);
  --green: #3ee08a;
  --red: #ff5a63;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1100px 420px at 50% -12%, rgba(90, 120, 160, 0.09), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Avenir Next", "Trebuchet MS", sans-serif;
}

button, input { font: inherit; color: inherit; }

.board {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px 22px;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1 1 auto;
}

.titles { min-width: 0; }

.logo {
  height: 36px;
  width: auto;
  background: #fff;
  border-radius: 10px;
  padding: 5px 8px;
  flex: 0 0 auto;
}

.title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.live {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #c5ced8;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 3px 7px;
}

.sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.counts {
  display: flex;
  gap: 28px;
  padding-top: 2px;
}

.count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
}

.count b {
  font-size: 34px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.count span {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.count.online { color: var(--green); }
.count.offline { color: var(--red); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 16px;
}

.filters { display: flex; gap: 8px; }

.filter {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #c5ced8;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

.filter.active {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.note {
  border: 0;
  background: transparent;
  color: #7f8b9a;
  font-size: 12px;
  cursor: pointer;
  text-align: right;
  padding: 0;
}

.note.bad { color: #ffb020; }

.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  overflow: hidden;
  min-height: 148px;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 26px 12px 18px;
  background: linear-gradient(#171e27, #131a22);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
  background-image: radial-gradient(rgba(255, 255, 255, 0.22) 0.55px, transparent 0.55px);
  background-size: 3px 3px;
}

.card.offline,
.card.unmatched {
  background:
    radial-gradient(90% 72% at 50% 0%, rgba(255, 45, 55, 0.32), rgba(255, 45, 55, 0) 58%),
    linear-gradient(#1b212b, #141b24);
}

.card.online {
  background:
    radial-gradient(70% 50% at 50% 12%, rgba(62, 224, 138, 0.08), rgba(62, 224, 138, 0) 62%),
    linear-gradient(#171e27, #131a22);
}

.light {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-bottom: 6px;
}

.card.online .light {
  background: #7dffa8;
  box-shadow:
    0 0 0 7px rgba(62, 224, 138, 0.12),
    0 0 18px 6px rgba(62, 224, 138, 0.9);
}

.card.offline .light,
.card.unmatched .light {
  background: #ff6a70;
  box-shadow:
    0 0 0 7px rgba(255, 70, 80, 0.14),
    0 0 22px 8px rgba(255, 45, 55, 0.95);
}

.card.unknown .light {
  background: #6d7682;
  box-shadow: none;
}

.name {
  position: relative;
  font-size: 15px;
  font-weight: 650;
  text-align: center;
  overflow-wrap: anywhere;
}

.status {
  position: relative;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.card.online .status { color: var(--green); }
.card.offline .status,
.card.unmatched .status { color: var(--red); }
.card.unknown .status { color: #8b95a3; }

.empty, .unassigned, .foot {
  color: #6f7c8c;
  font-size: 12px;
}

.empty { margin: 28px 0 0; }

.unassigned { margin: 16px 0 0; }

.foot { margin: 18px 0 0; }

.hidden { display: none; }

.login {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}

.login.hidden { display: none; }

.login input {
  background: #10161e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 7px 10px;
}

.login button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
}

.login-error {
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

@media (max-width: 1200px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .board { padding: 18px 14px 16px; }
  .top, .toolbar { flex-wrap: wrap; }
  .top { flex-direction: column; align-items: stretch; }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .note { text-align: left; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .counts { width: 100%; justify-content: flex-start; gap: 22px; }
  h1 { font-size: 20px; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .brand-block { flex-direction: column; align-items: flex-start; width: 100%; }
  .titles, .sub { width: 100%; }
  .logo { height: 30px; }
  h1 { font-size: 18px; }
}
