* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* HEADER */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-logo {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--lavender);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}
.header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.header-sub {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* CONN PILL */
.conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text2);
  transition: all 0.2s;
}
.conn-pill.live { background: #E8F5E0; border-color: #B8D9A0; color: #4A7A2E; }
.conn-pill.loading { background: var(--pink-soft); border-color: var(--pink); color: #A85A78; }
.conn-pill.offline { background: #FFE0E7; border-color: #FFB8CC; color: #A8384E; }
.conn-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.conn-pill.loading .conn-dot { animation: conn-pulse 1.1s infinite ease-in-out; }
@keyframes conn-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* REFRESH BUTTON */
.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.03em;
}
.btn-refresh:hover {
  background: var(--surface);
  border-color: var(--lavender);
  color: var(--lavender);
}
.btn-refresh:active { transform: translateY(1px); }
.btn-refresh:disabled {
  opacity: 0.5;
  cursor: wait;
  pointer-events: none;
}
.btn-refresh.spinning .refresh-icon {
  animation: refresh-spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes refresh-spin {
  to { transform: rotate(360deg); }
}

/* NAV */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
}
.nav-tab {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.15s;
  user-select: none;
}
.nav-tab:hover { color: var(--text); background: var(--surface2); }
.nav-tab.active { color: var(--text); border-bottom-color: var(--pink); font-weight: 600; }
.nav-badge {
  display: inline-block;
  background: var(--pink);
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: middle;
}
