:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel-hover: #1c232c;
  --border: #2a323d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #3b82f6;
  --ok: #3fb950;
  --bad: #f85149;
  --warn: #d29922;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  text-transform: uppercase;
}

.who-text { display: flex; flex-direction: column; min-width: 0; }
.who-text strong { font-size: 14px; }
.who-text small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.logout {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.logout:hover { background: var(--panel-hover); border-color: var(--muted); }

/* ---- main ---- */
main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 28px 20px 40px; }

h1 { margin: 0 0 4px; font-size: 24px; font-weight: 650; letter-spacing: -0.01em; }
.sub { margin: 0 0 24px; color: var(--muted); font-size: 13px; }

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

/* ---- card ---- */
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  transition: background .12s, border-color .12s, transform .12s;
}
.card:hover { background: var(--panel-hover); border-color: var(--muted); }

.card-head { display: flex; align-items: flex-start; gap: 12px; }
.card-icon { font-size: 26px; line-height: 1; }
.card-title { display: flex; flex-direction: column; min-width: 0; }
.card-title strong { font-size: 15px; }
.card-title small { color: var(--muted); font-size: 12px; }

.card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: auto;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 8px; }
.dot.online { background: var(--ok); }
.dot.offline { background: var(--bad); }
.dot.checking { background: var(--warn); animation: pulse 1s ease-in-out infinite; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.open {
  display: block;
  text-align: center;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.open:hover { filter: brightness(1.12); }

/* ---- footer ---- */
footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 20px; }
  .who-text small { max-width: 42vw; }
}
